Directory Structure - payfazz/tango GitHub Wiki

.ci

This directory store files needed for CI/CD integration:

  1. Dockerfile for building docker image
  2. Jenkinsfile for configure jenkins pipeline
  3. builder.sh and project.yml for 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:

  1. migrate for running migration code inside database/migration directory into database
  2. generate-sql for generating sql migration query from migration code inside database/migration directory
  3. tango later will be changed to project-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:

  1. store migration inside migration directory
  2. store seed code inside seed directory

internal

This directory should have at least 3 sub directories which used to:

  1. store global value constants inside value directory
  2. domain and core application files should be stored inside domains directory
  3. it is recommended to store dashboard related services in separate directory named dashboard
  4. (OPTIONAL) if you need to develop an application using event sourcing it is recommended to store all aggregate event struct inside aggregate directory

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:

  1. store testing entry point as shell scripts inside scripts directory
  2. migration code for testing inside migrate directory
  3. 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:

  1. required application grpc middleware inside app directory
  2. additional custom grpc middleware inside middleware directory
  3. grpc routing, middleware and server initialization inside server directory
  4. grpc controller files inside controller directory

transport/http

This directory should store http transport files that should have 6 sub directories that is used to:

  1. required application http middleware inside app directory
  2. additional custom http middleware and http middleware container inside middleware directory
  3. http routing inside route directory
  4. http controller files inside controller directory
  5. initialize http server inside server directory