A rest API service based on golang.
make start
make build
make wire
make swagger
make seed
.
└── go-rest-starter/
├── cmd/ # Entry point for starting the application.
├── docs/ # Swagger documentation generation file.
├── db/ # For migrating table.
├── internal/
│ ├── data/ # Handles migrations (currently for PostgreSQL, future support dynamic).
│ ├── mods/ # Core project layers.
│ ├── routes/ # Routes api.
│ ├── server/ # Creates and starts a new server instance.
│ └── wirex/ # Generated dependency injection code.
├── pkg/ # Reusable global utilities and helpers.
├── seeder/ # Seed Data into database.
├── tests/ # Testing code for the project.
└── Makefile # Build, run, and utility commands via make.
cmd/
: Contains the entry point of the application. Themain.go
file initializes the configuration, loads dependencies, and starts the server.docs/
: Stores the generated Swagger documentation files, including JSON, YAML, and the generator logic.db/
: For migrating tables into database.internal/
: Encapsulates the application's internal logic.
data/
: Manages database migrations. Currently supports PostgreSQL, with future dynamic database support plannedmods/
: Contains the core layers:dal
(Data Access),biz
(Business Logic),api
(API routes and handlers), andschema
(data models and validation).server/
: Responsible for creating and starting the server.routes/
: List All Routes in API.wirex/
: Handles Google Wire-based dependency injection.
pkg/
: A collection of reusable global utilities, such as error handling and utility functions.seeder/
: Seed Data for various purposes in database.tests/
: Contains all testing-related code, separated into unit and integration test directories.Makefile
: Defines build and run commands usingmake
.README.md
: Provides a guide for developers working on the project.
Happy Coding 🔥🚀