https://github.com/nanotaboada/go-samples-gin-restful
🧪 Proof of Concept for a RESTful API made with Go and Gin
https://github.com/nanotaboada/go-samples-gin-restful
conventional-commits docker docker-compose gin-tonic github-actions go golang gorm integration-testing proof-of-concept rest-api restful-api samples sqlite vs-code
Last synced: 9 days ago
JSON representation
🧪 Proof of Concept for a RESTful API made with Go and Gin
- Host: GitHub
- URL: https://github.com/nanotaboada/go-samples-gin-restful
- Owner: nanotaboada
- License: mit
- Created: 2023-11-20T22:25:45.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-07T14:08:20.000Z (18 days ago)
- Last Synced: 2025-06-07T15:19:53.499Z (18 days ago)
- Topics: conventional-commits, docker, docker-compose, gin-tonic, github-actions, go, golang, gorm, integration-testing, proof-of-concept, rest-api, restful-api, samples, sqlite, vs-code
- Language: Go
- Homepage:
- Size: 537 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# 🧪 RESTful API with Go and Gin
## Status
[](https://github.com/nanotaboada/go-samples-gin-restful/actions/workflows/go.yml)
[](https://sonarcloud.io/summary/new_code?id=nanotaboada_go-samples-gin-restful)
[](https://app.codacy.com/gh/nanotaboada/go-samples-gin-restful/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[](https://codecov.io/gh/nanotaboada/go-samples-gin-restful)
[](https://goreportcard.com/report/github.com/nanotaboada/go-samples-gin-restful)
[](https://www.codefactor.io/repository/github/nanotaboada/go-samples-gin-restful)
[](https://codebeat.co/projects/github-com-nanotaboada-go-samples-gin-restful-master)## About
Proof of Concept for a REST API made with [Go](https://go.dev/) and [Gin](https://gin-gonic.com/).
## Structure

_Figure: Simplified, conceptual project structure and main application flow. Not all dependencies are shown._
## Start
```console
go run .
```## Documentation
```console
http://localhost:9000/swagger/index.html
```
## Container
### Docker Compose
This setup uses [Docker Compose](https://docs.docker.com/compose/) to build and run the app and manage a persistent SQLite database stored in a Docker volume.
#### Build the image
```bash
docker compose build
```#### Start the app
```bash
docker compose up
```> On first run, the container copies a pre-seeded SQLite database into a persistent volume
> On subsequent runs, that volume is reused and the data is preserved#### Stop the app
```bash
docker compose down
```#### Optional: database reset
```bash
docker compose down -v
```> This removes the volume and will reinitialize the database from the built-in seed file the next time you `up`.
## Credits
The solution has been coded using [Visual Studio Code](https://code.visualstudio.com/) with the [Go](https://marketplace.visualstudio.com/items?itemName=golang.go) extension.
## Terms
All trademarks, registered trademarks, service marks, product names, company names, or logos mentioned on this repository are the property of their respective owners. All usage of such terms herein is for identification purposes only and constitutes neither an endorsement nor a recommendation of those items. Furthermore, the use of such terms is intended to be for educational and informational purposes only.