luigimorel / mongo-go-api

A modular REST API supporting user account management (auth, verification)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mongo-Go REST API

mongo-api is a REST API using MongoDB, Redis, Docker and JWT.

Features!

  • Uses Gin for routing
  • Uses a salt to hash the password
  • Uses JWT for authentication
  • Uses struct separation to hide sensitive information from call responses
  • Error handling
  • Viper for secret management

Installation

mongo-api requires Go 1.9+ to run.

Install the dependencies and devDependencies and start the server.

$ git clone https://github.com/morelmiles/mongo-api.git
$ cd mongo-api
$ go run main.go

Building for source

For production release:

$ go build

Todos

  • Write Tests

Tech

Project uses a number of open source projects to work properly:

  • Gin - Implements a request router and dispatcher in Go
  • MongoDB - document-based, big community, database
  • Redis - in-memory database using key-value pairs
  • Docker - Build, Share, and Run Any App, Anywhere

API endpoint - http://localhost:8080 Swagger endpoint - http://localhost:8080/swagger/index.html

Run app as a container

At the root of the project

docker build -t my-app-image .
  1. Start the Redis and MongoDB containers
$ docker run --name my-mongo-container -d mongo

$ docker run --name some-redis -d redis

About

A modular REST API supporting user account management (auth, verification)


Languages

Language:Go 98.2%Language:Dockerfile 1.8%