This is the backend repository of our application.
| Domain | Description |
|---|---|
| Repository | GitHub |
| Language | Go |
| Framework | Gin |
| Hosting | Heroku with Docker |
| Database | Heroku Postgres |
| Continuous Integration | CircleCI |
| Test | Gingko Gomega gotestsum |
| Formatter | gofmt |
| Dependency Injection | Wire |
go mod downloadThe development of this project is on a windows machine. Steps described in the following sections will be based on windows commands.
- Ensure that port number is set in the environment variable. The local server will be listening on this port.
SET PORT=3000- Ensure that database url is set in the environment variable.
SET DATABASE_URL=<uri>- Run the project from the root directory.
go run main.goAs dependency injection is one of the most important design principles to reduce tight-coupling among components, we made use of Google's code generation tool, Wire, to achieve this.
To generate the dependency graph, run in the root directory
wire ./...As we are using the Ginkgo testing framework, we can run all the tests in this module with any of the below commands in the root folder.
ginkgo ./...or
go test -v ./...To view test files, turn on the visibility of _test.go files in the .vscode/settings.json file by setting the config to false, or simply comment it.
{
"files.exclude": {
// "**/*_test.go": true
}
}- Create a docker file
- Create a circleci yml file
- Push code to code repository