Implementation api (Golang)
- Gin
- Mongo Driver
- Swagger
Before the start you need to install docker and run it.
1.Clone repository
2.Install dependencies
go mod download
3.Start dev database
docker-compose --profile dev up -d
4.Start app
make run-core
Before the start you need to install docker and run it.
docker-compose --profile prod up -d
After the start applications (auth in env):
Generate new documentation:
swag init -g ./cmd/core/main.go -o docs
If you want to test endpoints. You can import this file in Postman
- go-simple-api.postman_collection.json
.
├── Dockerfile
├── Makefile
├── README.md
├── cmd
│ └── core
│ ├── auth
│ │ ├── controller.go
│ │ ├── repository.go
│ │ └── routes.go
│ ├── main.go
│ └── post
│ ├── controller.go
│ ├── repository.go
│ └── routes.go
├── config
│ └── init.go
├── docker-compose.yml
├── docs
│ ├── docs.go
│ ├── swagger.json
│ └── swagger.yaml
├── go.mod
├── go.sum
└── utils
├── constants
│ ├── collections.go
│ └── error-messages.go
├── exception
│ └── exception.go
├── helpers
│ ├── get-context-data.go
│ └── get-context-userid.go
├── middleware
│ ├── base-auth-swagger.go
│ ├── guard.go
│ └── validator.go
├── models
│ ├── auth.go
│ ├── error.go
│ ├── post.go
│ └── user.go
├── schemas
│ ├── post.go
│ └── user.go
├── server
│ └── app.go
└── services
└── auth.go
- 1.23.1