A Go web application built with Gin framework and Swagger documentation.
- Go 1.25.1 or higher
- PostgreSQL (for database)
- Swag CLI for generating Swagger docs
- Clone the repository
- Install dependencies:
go mod download
This project uses a Makefile for convenient command execution:
make run # Run the application
make build # Build the application binary
make swagger # Generate Swagger documentationmake fmt # Format Go code
make lint # Run linter
make test # Run testsmake deps # Download and tidy dependenciesmake clean # Remove build artifacts and generated docsAfter running make swagger, you can access the Swagger UI at:
├── cmd/ # Application entry points
├── internal/ # Private application code
│ ├── config/ # Configuration
│ ├── database/ # Database connection and migrations
│ ├── handlers/ # HTTP handlers
│ ├── models/ # Data models
│ ├── routes/ # Route definitions
│ └── service/ # Business logic
├── docs/ # Generated Swagger documentation
├── migrations/ # Database migrations
├── pkg/ # Public library code
└── tests/ # Test files
-
Start the application:
make run
-
Generate API documentation:
make swagger
-
Visit http://localhost:8080/ping to test the API
-
Visit http://localhost:8080/swagger/index.html for API documentation