https://github.com/matrix278/go-api-template
Template to create API repositories faster on Golang with necessary structure
https://github.com/matrix278/go-api-template
api golang template
Last synced: 4 months ago
JSON representation
Template to create API repositories faster on Golang with necessary structure
- Host: GitHub
- URL: https://github.com/matrix278/go-api-template
- Owner: Matrix278
- Created: 2025-01-25T13:03:42.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-06T18:32:28.000Z (10 months ago)
- Last Synced: 2025-04-10T22:49:22.587Z (10 months ago)
- Topics: api, golang, template
- Language: Go
- Homepage:
- Size: 171 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go API template
This is a template for a Go API project. It includes the following features:
- Clean Architecture
- Swagger Documentation
- Dockerized
- Makefile for easy setup
- API Security
- API Logging
- API Testing
## Requirements
- [Git](https://git-scm.com/downloads) - Git CLI
- [Code Editor](https://code.visualstudio.com) - Basic code editor
- [Golang](https://go.dev) - Golang
- [Docker](https://docs.docker.com/get-docker/) - For containerization and local environment (if you're not using Makefile)
- [GoSec](https://github.com/securego/gosec) & [Golang-Lint](https://github.com/golangci/golangci-lint) - Go Validators
- [GoFumpt](https://github.com/mvdan/gofumpt) - Stricter GoFMT
- [Redoc-CLI](https://redocly.com/docs/redoc/deployment/cli) - For generating API Documentation (npm install -g @redocly/cli)
## Getting started
### Native
Download all necessary modules and run the application
```
go mod download
make run
```
### Docker
#### First application start
```
make docker
```
#### After the first start
After first setup you can use docker-compose to start and stop / restart the application
```
docker-compose up
docker-compose down
```
## Swagger
Swagger documentation is available at [http://localhost:8080/docs](http://localhost:8080/docs)
To generate the Swagger documentation, you can run the following command:
```
make swagger
```
## Contributing
You can find the detailed contributing guidelines by navigating to the [`CONTRIBUTE.md`](/CONTRIBUTE.md/) file in the repository.
## Docs
- [Swagger](http://localhost:8080/docs) - Swagger Documentation, available after running the application