Skip to content

The goal of this boilerplate is to have a solid and structured foundation to build microservice in Golang

Notifications You must be signed in to change notification settings

distributed-go/microservice-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 

Repository files navigation

recruiter-api

Go Restful API Boilerplate

Easily extendible RESTful API boilerplate aiming to follow idiomatic go and best practice.

The goal of this boiler is to have a solid and structured foundation to build upon on.

Any feedback and pull requests are welcome and highly appreciated. Feel free to open issues just for comments and discussions.

Features

The following feature set is a minimal selection of typical Web API requirements:

  • Configuration using viper
  • CLI features using cobra
  • PostgreSQL support including migrations using go-pg
  • Structured logging with Logrus
  • Routing with chi router and middleware
  • JWT Authentication using jwt-go with example passwordless email authentication
  • Request data validation using ozzo-validation
  • HTML emails with gomail

Start Application

  • Clone this repository
  • Create a postgres database and set environment variables for your database accordingly if not using same as default
  • Run the application to see available commands: go run main.go
  • First initialize the database running all migrations found in ./database/migrate at once with command migrate: go run main.go migrate
  • Run the application with command serve: go run main.go serve
  • Go to http://127.0.0.1:8001/recruiter-api/v1/swagger to view the swagger API docs

API Routes

chechout src/web/docs folder for swagger API documentation

Testing

Package auth/pwdless contains example api tests using a mocked database.


Screenshot from 2021-11-16 23-24-49

About

The goal of this boilerplate is to have a solid and structured foundation to build microservice in Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages