-
Place all read me here or any other info needed here. for set up and development.
-
create a ".env" file where we will keep all environment related constants. like database username,password, secret key and mail info.
-
Create a "main.go" file in root, this will serve as the project/web-server entry point.
-
Create a "Makefile" this will contain some basic commands to run the project.
-
Create these folders:
-
Controllers: contains a controller that accepts a request and calls a particular service to process it.
-
Services: contains service that has the logic all the process like manipulating the DB and giving back the desired result.
-
Models: contains the struct for storing data in DB OR fetching data from DB.
-
DB: keep you DB related operations here. these can be used in services to fetch/update/insert/delete data from DB. *** Place DB connection file as well inside this folder.
-
Routes: Keep all your routes here and pass the name of controller.
-
Config: keep all your configuration things here like. fetching variables from .env file or even db config can be place here.
-
Constants: keep all constants here, can also categorise them in separate files.
-
Utils: Keeps all commonly used functions here like capitalising first Latter, etc.
-
We are now ready to start coding with this folder structure.