• This repository has been archived on 03/Dec/2022
  • Stars
    star
    142
  • Rank 258,495 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 5 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🐶Go (Golang)🚀REST / GraphQL API + Postgres boilerplate

Build Status codecov MIT Licence Open Source Love

Go (Golang) REST / GraphQL API Boilerplate

Note: in demo, I disabled email

Used libraries:


  • Components Diagram

diagram image

  • See Swagger Doc http://localhost:3000/swagger/index.html

swagger image

  • See GraphQL Playground http://localhost:3000/graphql

graphql image


Features

  • User Auth functionality (Signup, Login, Forgot Password, Reset Password)
  • JWT Authentication
  • REST API
  • GraphQL API
  • Gorm (Golang SQL DB ORM) with Postgres implementation and auto migration
  • Configs via environmental variables
  • Email notification (Welcome email, Reset password email)
  • Swagger REST API documentation
  • GraphQL playground
  • Unit tests
  • Dependency injection

Run locally

Create .env at root, i.e.

MAILGUN_API_KEY=key-b9jksfh8s9843uhfsdhds
MAILGUN_DOMAIN=xxxxx.mailgun.org

EMAIL_FROM=support@go_api_boilerplate.com

DB_HOST=localhost
DB_PORT=5432
DB_USER=your-user
DB_PASSWORD=your-password
DB_NAME=local-dev-db

JWT_SIGN_KEY=secret
HAMC_KEY=secret
PEPPER=secret

ENV=development

APP_PORT=3000
APP_HOST=http://localhost

Run

# Terminal 1
docker-compose up        # docker-compose up (Run postgres)
docker-compose down      # docker-compose down (Shutdown postgres)

# Terminal 2
go run github.com/99designs/gqlgen -v # Generate Graphql stuff
swag init -g app/app.go               # Generates Swagger
go run *.go                           # Run application
go test -v -cover ./...               # Run go test

Todo

  • Input Validations
  • Custom Error messages
  • Logger
  • More unit tests

maybe?

  • gRPC
  • Redis Streams
  • Redis PubSub
  • WebSocket
  • MongoDB

Contribution

Welcome for suggestions

More Repositories

1

ecommerce-backend-api

Work in progress ... PostgreSQL, Express, Stripe, JWT Auth, Mailgun
JavaScript
22
star
2

kickstarter-clone

Kickstarter clone built with Node.js / Express / MongoDB / Stripe / Elasticsearch (experimental)
JavaScript
17
star
3

node-postgres-api-starter

Node.js / Express / MongoDB / PostgreSQL / Authentication API Starter Kit
JavaScript
15
star
4

ecommerce-front

ECommerce Front-End (React, Immutable, Redux, JWT)
JavaScript
11
star
5

stock_price_predictor

Stock Price Predictor with Deep Learning
Jupyter Notebook
11
star
6

fastify-rest-graphql-api

🍀Node.js (Fastify) Typescript REST / GraphQL API + Postgres Boilerplate
TypeScript
6
star
7

node-mongo-api-starter

Node.js / Express / MongoDB / Mongoose / Authentication API Starter Kit
JavaScript
6
star
8

udacity-intro-to-html-and-css

Udacity - Intro to HTML and CSS (Nanodegree) notes and practice
HTML
5
star
9

offline-caltrain

Offline first CalTrain schedule web app for mobile & desktop (GTFS, Service Worker, IndexedDB via Lovefield)
JavaScript
4
star
10

react-flickr

[Project] React Flickr client - ES2015, React 0.14.3, Webpack
HTML
3
star
11

sensei-server

✎Sensei server - Node.js / Express / Typescript / Postgres / TypeORM/Apollo-Server/GraphQL stack
TypeScript
3
star
12

go_pg_rest_api_starter

Go x Postgres x JWT x Mailgun REST API starter (example)
Go
2
star
13

em-dashboard

Ember.js Corporate Dashboard Project
JavaScript
2
star
14

utage

Party Planner Progressive Web App(Offline, A11y, Mobile installable) React Redux Immutable
HTML
2
star
15

go-simple-rest-api

Simple REST API built with Go / Postgres / JWT (Practice)
Go
1
star
16

D3-MapData

Meteorites Landing World Map - Data Visualization with D3.js
JavaScript
1
star
17

react-recipe

Recipe App with React.js
JavaScript
1
star
18

vanillaJSNote

Vanilla JavaScript Note app
JavaScript
1
star
19

next-typescript-knex-express

Next.js Typescript Express Knex Postgres starter
TypeScript
1
star
20

coding-love-scraper

Node.js GIF scraper for Coding Love web site
JavaScript
1
star
21

D3-HeatMap

D3.js utilized Heat Map for Global Surface Temperature 1753 - 2015
JavaScript
1
star
22

rest-api-et

Boilerplate: Express, Typescript, Knex, Postgres API
TypeScript
1
star
23

twitter-clone

Node MySQL (raw) + Redis - Twitter Clone
JavaScript
1
star
24

design_patterns_typescript

Work in progress ...
TypeScript
1
star
25

health-tracker

[Project] Health Tracking App using Backbone.js
JavaScript
1
star
26

restaurant-reviewer-api

Restaurant Reviewer Backend API built with Node / Express / MongoDB / JSON Web Token
JavaScript
1
star