kosatnkn / catalyst Goto Github PK
View Code? Open in Web Editor NEWA REST API base implemented as a microservice written in Go using the Clean Architecture paradigm.
License: MIT License
A REST API base implemented as a microservice written in Go using the Clean Architecture paradigm.
License: MIT License
Need a logo
Currently validator is a separate package in the app. Make it an adapter ValidationAdapter.
Some structs have .NEW()
functions instead of .New[Name]
function for initialization. Although this works well it is better to move to the latter convention.
Add a transaction wrapper in usecase level so that queries run from Repositories can be grouped in to database transactions.
This should allow nested transactions so we don't need to worry about transaction management when calling a usecase level function from another usecase level function
Move adapters from externals
to somewhere else in the project since adapters do not directly belong in the domain
Add stack trace to errors in development
mode and define better error types for each layer.
Add Integration Tests for the Sample Set
Using channels
package to to encapsulate all communication channels might confuse the user. Can we change channels
to mediums
so that the usage interface is cleaner.
Write the wiki for the project covering all technical decisions and sample implementations.
Need to double check on the validator initialization process.
validate = validator.New()
en := localsEn.New()
uni = ut.New(en, en)
// this is usually know or extracted from http 'Accept-Language' header
// also see uni.FindTranslator(...)
trans, _ := uni.GetTranslator("en")
validate = validator.New()
enTranslations.RegisterDefaultTranslations(validate, trans)
Research on a new mock server
Remove Glide and add go mod as the dependency manager
Check and fix suppressed errors like this.
message, _ := json.Marshal(wrapper)
Add an Information controller to provide details of the API. This would be helpful in environments where many micro-services are running. A summary such as name, version and purpose of the API can be obtained by calling the root path <base_url>/
of the API.
The error handler is currently showing this signature.
response.Error(ctx, w, err, ctl.container.Adapters.Log)
Need to update it to present this signature
response.Error(ctx, w, err)
Need to create a MySQL adapter
Profile code
The name channels
used for the directory that holds sub packages for different communication mechanisms causes confusion. It is better that we rename this to something that gives more meaning to the functionality. Something like transport
The reason that we implemented the validator as an adapter rather than a package in app is to remove the creation of a validator object for each and every request. But it seems the previous implementation will make much sense if we consider localization of validation errors.
Adapters need to be decoupled from Catalyst
itself so that they can be more maintainable.
doc.go
Create a new error type UnpackerError
to better present unpacking error messages.
{
"errors": {
"type": "Validation Errors",
"trace": "Require following format: {\n\t\t\"street\": <string>,\n\t\t\"city\": <string>,\n\t\t\"planet\": <string>,\n\t\t\"phone\": <string>\n\t}"
}
}
Add CORS
Need a way to create a new project using Catalyst as the template. The project generator needs to do the following
openapi.yaml
document to generate the endpoints, unpackers and transformers and maybe stubs for handler methodsUpdate wiki pages to reflect changes in v2
Write unit tests
Add a Sample
set to showcase all functionality Catalyst
is capable of and remove the Test
set so that it will not interfere with unit test naming conventions.
What to add
sample/
route set for CRUD operationsSampleController
sample
usecase package to handle CRUD operationsSampleRepository
Add openapi.yaml
and mocking server for the sample set
It is said that enveloping data is no longer needed. Research on this and remove data and error wrappers if not necessary.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.