Skip to content

A boilerplate for fiber versioning, Clean Architecture, API versioning, API documentation, Data versioning

License

Notifications You must be signed in to change notification settings

aofdev/fiber-versioning-boilerplate

Repository files navigation

Fiber Versioning Boilerplate

Linter Testing

fiber-versioning-boilerplate

Prerequisite

Make sure you have the following installed outside the current project directory and available in your GOPATH

Features ✨

  • API Versioning
  • Data Versioning
  • Dynamic Struct Type
  • Clean Architecture
  • Postman Collections
  • API Documentation with swagger

Project structure 📁

api
  ├── adapters
  │  └── mongo.go
  ├── app.go
  ├── handlers
  │  ├── errors.go
  │  ├── parser_body.go
  │  └── response.go
  ├── utilities
  │  ├── configuration.go
  │  └── converter.go
  └── versions
    ├── v1
    │  ├── entities
    │  ├── factories
    │  ├── repositories
    │  ├── routes
    │  └── usecases
    └── v2
        ├── entities
        ├── factories
        ├── repositories
        ├── routes
        └── usecases

Development environment setup

make setup

Start the application ⚡️

make start

Testing 🧪

make test

Manual 🗒️

Run make help to list available commands:

Choose a command run in fiber-versioning-boilerplate:

  setup           Initialize project
  docker-start    Start docker-compose
  docker-stop     Stop docker-compose
  start           Start the application
  copy-env        Copy environment file
  gendoc          Generate docs api with swagger
  test            Run tests coverage
  mongo-dump      Dump MongoDB data for testing
  mongo-restore   Restore MongoDB data for testing