fiber-proto is a Go REST API project built with the Fiber framework.
It demonstrates a structured backend architecture with routing, handlers, models, database integration (MongoDB), and Swagger documentation support.
The project includes a simple CRUD example (e.g., Todo API) and is structured for scalability and maintainability.
- REST API built with Fiber
- Structured project layout (app, handlers, models, router)
- MongoDB integration
- Environment-based configuration
- Swagger documentation support
- Makefile for development tasks
- CRUD example implementation
main.go– Application entry pointapp/– Application bootstrap and initializationrouter/– Route definitionshandlers/– HTTP handlersmodels/– Data modelsdatabase/– Database connection logicconfig/– Configuration managementdocs/– Swagger/OpenAPI documentation
- Go 1.20+
- MongoDB
- Make (optional)
git clone https://github.com/<your-username>/fiber-proto.git
cd fiber-protoCopy the example environment file:
cp .env.example .envEdit .env with your MongoDB connection string and other configuration values.
Download dependencies:
go mod downloadStart the server:
go run main.goOr use Makefile (if configured):
make runIf Swagger is configured, documentation will be available at:
http://localhost:PORT/swagger/index.html
(Adjust PORT according to your configuration.)
Example CRUD routes (e.g., Todos):
GET /todosGET /todos/:idPOST /todosPUT /todos/:idDELETE /todos/:id
Build:
go buildFormat:
go fmt ./...