Skip to content

By using rapid-go you can quickly start developing a great API......

Notifications You must be signed in to change notification settings

abyssparanoia/rapid-go

Folders and files

NameName
Last commit message
Last commit date
Apr 23, 2019
Mar 25, 2019
Apr 27, 2019
Apr 23, 2019
Apr 23, 2019
Apr 23, 2019
Apr 27, 2019
Apr 22, 2019
Apr 19, 2019
Apr 23, 2019
Apr 27, 2019
Apr 22, 2019
Apr 27, 2019

Repository files navigation

rapid-go

motivation

rapid-go is a boilerplate that accelerates API development based on layered architecture and clarifying responsibilities.

stack

  • golang 1.11 (I will actively raise go version)
  • mysql (correspondence such as firestore is easy)
  • Chi (as Router)
  • squirrel (as query builder)
  • sqlx (map the result of sql to an object)
  • gin (for hot reload ,not framwork)
  • docker
  • mockgen (generate mock codes from inteface)
  • zap (as logger)
  • firebase auth (as authenticate service)

development

  • init
make init
  • build
> make build
  • start
> make start
> curl http://localhost:3001/ping
  • stop
> make down
  • generate mock from interface (service,domain/repository)
> make mockgen_task
  • run test
> make test

about layer

infrastructure

  • data layer
  • It is responsibility to handle the data
  • interested in database etc.

entity

  • struct for setting the result of SQL etc....

infra/repository

  • write the actual data manipulation process

domain

model

  • domain model

domain/repository

  • write interface for infrastructure/repository and convert entity to domain

service layer

  • write application logic using repository

handler

  • write the process about request and response