All Projects → qreasio → Go Starter Kit

qreasio / Go Starter Kit

Licence: mit
Go Rest API starter kit / Golang API boilerplate base on Chi framework

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Go Starter Kit

Electron React Boilerplate
Electron and Create React App boilerplate without any complex setup
Stars: ✭ 21 (-40%)
Mutual labels:  boilerplate
Jekyll Boilerplate
Helpful files to get started working on a new Jekyll website
Stars: ✭ 30 (-14.29%)
Mutual labels:  boilerplate
Express React Boilerplate
🚀🚀🚀 This is a tool that helps programmers create Express & React projects easily base on react-cool-starter.
Stars: ✭ 32 (-8.57%)
Mutual labels:  boilerplate
Hackathon Starter
A boilerplate for Node.js web applications
Stars: ✭ 32,485 (+92714.29%)
Mutual labels:  boilerplate
Catalyst
Typescript NodeJS Microservices Boilerplate with Generator CLI - Moleculer, GraphQL, REST, OAuth2, Jaeger, Grafana, Prometheus, Ory Hydra, Ory Keto w/ Access Control middleware, Moleculer-DB GraphQL mixin, Pug, Redis, sibling client repo (login, persistance layer, react-native-web, ios, android)
Stars: ✭ 30 (-14.29%)
Mutual labels:  boilerplate
Vue Auth Boilerplate
🔑 Vue.js scalable boilerplate with user authentication.
Stars: ✭ 31 (-11.43%)
Mutual labels:  boilerplate
React Redux Boilerplate Example
Stars: ✭ 15 (-57.14%)
Mutual labels:  boilerplate
Swift Template
A template based module generator for Swift projects.
Stars: ✭ 34 (-2.86%)
Mutual labels:  boilerplate
Angular2 Webpack Boilerplate
A boilerplate for Angular 2 and Webpack
Stars: ✭ 30 (-14.29%)
Mutual labels:  boilerplate
Preact Boilerplate
🎸 Ready-to-rock Preact starter project, powered by Webpack.
Stars: ✭ 959 (+2640%)
Mutual labels:  boilerplate
Hot Loader Demo
React Hot Loader 3 minimal demo
Stars: ✭ 27 (-22.86%)
Mutual labels:  boilerplate
Starter Nodejs Rest
DEPRECATED!! Starter for a Node.js REST Application using MongoDB and JSON Web Token
Stars: ✭ 29 (-17.14%)
Mutual labels:  boilerplate
Parcel Boilerplate
a boilerplate for using Parcel JS 😎
Stars: ✭ 31 (-11.43%)
Mutual labels:  boilerplate
Ant Design Pro
👨🏻‍💻👩🏻‍💻 Use Ant Design like a Pro!
Stars: ✭ 30,909 (+88211.43%)
Mutual labels:  boilerplate
Generator Solid Angular
Generator for Solid Angular applications
Stars: ✭ 32 (-8.57%)
Mutual labels:  solid
Create React App Redux
React Router, Redux, Redux Thunk & Create React App boilerplate
Stars: ✭ 885 (+2428.57%)
Mutual labels:  boilerplate
Suicrux
🚀 Ultimate universal starter with lazy-loading, SSR and i18n. [not maintained]
Stars: ✭ 958 (+2637.14%)
Mutual labels:  boilerplate
React Atomic Design
🔬 Boilerplate with the methodology Atomic Design using a few cool things.
Stars: ✭ 972 (+2677.14%)
Mutual labels:  boilerplate
Sao
⚔ Futuristic scaffolding tool
Stars: ✭ 966 (+2660%)
Mutual labels:  boilerplate
Enso
Laravel Vue SPA, Bulma themed. For demo login use `[email protected]el-enso.com` & `password` -
Stars: ✭ 959 (+2640%)
Mutual labels:  boilerplate

Go Starter Kit

This project is opinionated Go starter kit / golang boilerplate that uses the golang standards project layout, using best and proven libraries and implements best practices for great foundation of Golang API project.

Background

When I want to start to build Go API project, i don't have a good solid base to start and usually I add the library and add another required thing one by one along the time, and then change again if I find another better library or another better way to do thing. So I tried to research architecture, library and software component/layer that I think better suits to be included for solid golang project.

Architecture

This project follows SOLID & Clean architecture

Features

  • [x] Versioning
  • [x] Pagination
  • [x] Configuration
  • [x] Logging
  • [x] Error Handling
  • [x] Validation
  • [x] Health Check
  • [x] Data Seed
  • [x] DB Migration
  • [x] Run & Manage via CLI Command
  • [x] Makefile
  • [x] Linter
  • [x] Unit Test
  • [x] Docker & Docker Compose
  • [x] Integration Test sample

Todo:

  • [ ] Add more examples for service, repository and test
  • [ ] JWT base Authentication
  • [ ] Observability/Metrics
  • [ ] Kubernetes deployment
  • [ ] Use Cobra for CLI
  • [ ] Viper for better handling env and config

Website

Github: https://github.com/qreasio/go-starter-kit

Gostarterkit site: https://gostarterkit.com

Go Libraries

  • Go 1.14
  • Base web framework & Routing using github.com/go-chi/chi
  • Validation with github.com/go-playground/validator/
  • Database with github.com/jmoiron/sqlx
  • Logging with go.uber.org/zap
  • Migration with github.com/go-migrate/migration
  • YAML with gopkg.in/yaml.v2
  • Linter with github.com/golangci/golangci-lint
  • Go static analysis with staticcheck.io https://github.com/dominikh/go-tools
  • Mock generator using github.com/golang/mock

Get Started

Below are the steps if you want to run locally without docker

  1. Set required environment variable

    ENV=local

  2. Set configuration

    Change config/local.yaml configuration value properly and make sure can connect to blank MySQL database properly

  3. Run migration

    make migrate

  4. Add seed data

    make seed

  5. Run app

    make run

  6. Open the browser

    Visit the url

    http://localhost:8080/v1/users

Run Test

go test -v ./internal/user/...

Get Started Using Docker Compose

Below are the steps if you want to run locally with docker & docker compose

  1. Build docker image

    Generate the docker imgae by this command:

    docker build --rm -t starterkitapi -f dockerfile.api .

  2. Run with docker compose

    Copy the sample.env to .env and adjust it then run the docker compose with this command:

    docker-compose up

  3. Open the browser

    Visit the url

    http://localhost:8080/v1/users

  4. Quit & Cleanup

    Click Ctrl+C to quit in console then run these commands below to clean up all things:

    docker-compose rm -v

Inspiration

Golang Project Layout https://github.com/golang-standards/project-layout

ArdanLabs Service https://github.com/ardanlabs/service

GORSK - GO(lang) Restful Starter Kit https://github.com/ribice/gorsk/

Go REST API starter kit https://github.com/qiangxue/go-rest-api

Author

Isak Rickyanto

Twitter: @isakric

Personal site: https://rickyanto.com

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].