fiber-boilerplate icon indicating copy to clipboard operation
fiber-boilerplate copied to clipboard

Simple and scalable boilerplate to build powerful and organized REST projects with Fiber.

Fiber Boilerplate

Go Reference

Simple and scalable boilerplate to build powerful and organized REST projects with Fiber.

Directory Structure

├── app
│   ├── database
│   │   ├── schema
│   │   │   └── article.go
│   │   └── seeder
│   │       └── article_seeder.go
│   ├── middleware
│   │   ├── register.go
│   │   └── token
│   │       └── token.go
│   ├── module
│   │   └── article
│   │       ├── article_module.go
│   │       ├── controller
│   │       │   ├── article_controller.go
│   │       │   ├── article_controller_mock.go
│   │       │   └── controller.go
│   │       ├── repository
│   │       │   ├── article_repository.go
│   │       │   └── article_repository_mock.go
│   │       ├── request
│   │       │   └── article_request.go
│   │       └── service
│   │           ├── article_service.go
│   │           └── article_service_mock.go
│   └── router
│       └── api.go
├── build
│   ├── Dockerfile
│   └── DockerfileAir
├── cmd
│   └── example
│       ├── generate.go
│       └── main.go
├── config
│   └── example.toml
├── docker-compose.yaml
├── go.mod
├── go.sum
├── internal
│   └── bootstrap
│       ├── database
│       │   └── database.go
│       ├── logger.go
│       └── webserver.go
├── LICENSE
├── Makefile
├── README.md
├── storage
│   ├── ascii_art.txt
│   ├── private
│   │   └── example.html
│   ├── private.go
│   └── public
│       └── example.txt
└── utils
    ├── config
    │   └── config.go
    ├── response
    │   ├── response.go
    │   └── validator.go
    └── utils.go

Usage

You can run that commands to run project:

go mod download

go run cmd/example/main.go or air -c .air.toml if you want to use air

Docker

docker-compose build
docker-compose up

CUSTOM="Air" docker-compose up # Use with Air

Tech Stack

To-Do List

  • [x] More error-free logging.
  • [x] Add makefile to make something shorter.
  • [x] Introduce repository pattern.
  • [ ] Add unit tests.
  • [x] Add mocking with GoMock.

License

fiber-boilerplate is licensed under the terms of the MIT License (see LICENSE).