Skip to content

gandarfh/api-httui

Repository files navigation

Boilerplate - Go API

Architecture

├── internal
│   ├── middleware
│   ├── routes
│   ├── modules
│   │   ├── [module]
│   │   │   ├── [module]_controller.go
│   │   │   ├── [module]_routes.go
│   │   │   ├── dto
│   │   │   ├── entities
│   │   │   ├── repositories
│   │   │   └── services
│   │   └── ...
├── docs
├── infrastructure
│   ├── cache
│   ├── database
│   └── migrations
├── pkg
│   ├── permissions
│   ├── configs
│   ├── errors
│   ├── jwt
│   ├── pagination
├── └── utils
└── main.go

Quick start

  1. Copy .env.example to .env and fill it with your environment values.

  2. Run with docker:

make docker.run
  1. Go to API Docs page (Swagger): localhost:5000/docs/index.html If dont exist swagger page, generate then with this command:

To install swag: go install github.com/swaggo/swag/cmd/swag@latest

make swag
  1. To use live reload, download air package.

To install: go install github.com/cosmtrek/air@latest

  1. To execute live reload:
air run .

📦 Features Roadmap

  • Deployment to aws
  • Http request implementation
  • Logs implementation
  • Implementation AWS stuffs, like: SNS, SKS
  • Documentation - how create new modules
  • Documentation - how connect to database
  • Documentation - how private route by credentials
  • Documentation - how create a new token
  • Documentation - how generate swagger documentation
  • JWT Token generator
  • Middleware to valid credentials or roles (provided by JWT token)
  • Support to MongoDb, MySql, Postgres, Redis
  • Pagination with MongoDb
  • Swagger generator
  • Struct validator who handle path and validation tag on response
  • Multi routes implementation, not found, swagger, public, private
  • Dockerfile to execute binary file

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published