Directory Structure - payfazz/tango GitHub Wiki
.ci
This directory store files needed for CI/CD integration:
Dockerfilefor building docker imageJenkinsfilefor configure jenkins pipelinebuilder.shandproject.ymlfor supporting CI/CD integration
cmd
This directory should have 3 sub directories which used to store main.go files for 3 types of service entry point:
migratefor running migration code insidedatabase/migrationdirectory into databasegenerate-sqlfor generating sql migration query from migration code insidedatabase/migrationdirectorytangolater will be changed toproject-name
config
This directory is used for storing configuration files which can be overriden using unix environment variables
database
This directory should have 2 sub directories which used to:
- store migration inside
migrationdirectory - store seed code inside
seeddirectory
internal
This directory should have at least 3 sub directories which used to:
- store global value constants inside
valuedirectory - domain and core application files should be stored inside
domainsdirectory - it is recommended to store dashboard related services in separate directory named
dashboard - (OPTIONAL) if you need to develop an application using event sourcing it is recommended to store all aggregate event struct inside
aggregatedirectory
lib
This directory is used to store library code which used for specific helper method(s) or object(s) which interact with third-party partner or used multiple times inside services
test
This directory should have 2 sub directories and 1 file that is used to:
- store testing entry point as shell scripts inside
scriptsdirectory - migration code for testing inside
migratedirectory - testing methods should be stored into
test.go
transport/container
This directory should store service container, middleware and library initialization inside container directory
transport/grpc
This directory should store grpc transport files that should have 4 sub directories that is used to:
- required application grpc middleware inside
appdirectory - additional custom grpc middleware inside
middlewaredirectory - grpc routing, middleware and server initialization inside
serverdirectory - grpc controller files inside
controllerdirectory
transport/http
This directory should store http transport files that should have 6 sub directories that is used to:
- required application http middleware inside
appdirectory - additional custom http middleware and http middleware container inside
middlewaredirectory - http routing inside
routedirectory - http controller files inside
controllerdirectory - initialize http server inside
serverdirectory