https://github.com/pvarentsov/go-backend-template
Clean architecture based backend template in Go.
https://github.com/pvarentsov/go-backend-template
backend-template clean-architecture go go-boilerplate go-template
Last synced: about 1 year ago
JSON representation
Clean architecture based backend template in Go.
- Host: GitHub
- URL: https://github.com/pvarentsov/go-backend-template
- Owner: pvarentsov
- License: mit
- Created: 2022-01-09T11:02:51.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-02T20:20:28.000Z (almost 4 years ago)
- Last Synced: 2025-03-21T21:22:55.533Z (about 1 year ago)
- Topics: backend-template, clean-architecture, go, go-boilerplate, go-template
- Language: Go
- Homepage:
- Size: 8.32 MB
- Stars: 51
- Watchers: 2
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

Backend Template
> Clean architecture based backend template in Go.
## Makefile
Makefile requires installed dependecies:
* [go](https://go.dev/doc/install)
* [docker-compose](https://docs.docker.com/compose/reference)
* [migrate](https://github.com/golang-migrate/migrate)
```shell
$ make
Usage: make [command]
Commands:
rename-project name={name} Rename project
build-http Build http server
migration-create name={name} Create migration
migration-up Up migrations
migration-down Down last migration
docker-up Up docker services
docker-down Down docker services
fmt Format source code
test Run unit tests
```
## HTTP Server
```shell
$ ./bin/http-server --help
Usage: http-server
Flags:
-h, --help Show context-sensitive help.
--env-path=STRING Path to env config file
```
**Configuration** is based on the environment variables. See [.env.template](./config/env/.env.template).
```shell
# Expose env vars before and start server
$ ./bin/http-server
# Expose env vars from the file and start server
$ ./bin/http-server --env-path ./config/env/.env
```
## Request Collection
* [InsomniaV4](./assets/api-collection.insomnia-v4.json)
## License
This project is licensed under the [MIT License](https://github.com/pvarentsov/go-backend-template/blob/main/LICENSE).