/Auth-service

This is responsible for user role and token validation

Primary LanguageGo

Auth-service

Actions Status codecov Go Report Card Codacy Badge

Features

  • Server Preparation for Running the project on localhost
  • Database Migration
  • Registration
  • Login
  • Token Validation

Feature Details

Database Migration

  • Database schema will be created when migrating
  • Rollback query is added for making the database empty

Registration

  • User Signup
  • Encode and Decoding the HTTP credentials
  • Validating all Credentials
  • Phone Number Validation using RegExp

Login

  • User Login
  • Provide JWT token
  • User login validation

Token Validation

  • Token will be validet for unauthorized call
  • User data will given at response for valid token

Project Structure

.
|-- cmd                 # Contains the commands for the project
|-- images              # Contains all image file
|-- internal            # Configuration files and Constants
|-- migration           # Contains migration files
|-- .env.example        # example/structure of .env file
|-- Dockerfile          # Used to build docker image.
|-- go.mode             # Define's the module's import path used for root directory
|-- go.sum              # Contains the expected cryptographic checksums of the content of specific module versions
|-- Makefile            # Makefile to run commands after docker up
|-- readme.md           # Explains project installation and other informations

Tools and Technology

  • Golang
  • PostgreSQL

Installation

  • Step-1: Copy/rename .env.example file as .env. Change the APP_PORT, DB_PORT, DB_NAME,DB_HOST, DB_USER, DB_PASSWORD value as per your DB and Project setup.
  • Step-2: Run migration command go run main.go migrate for Database migration
  • Step-3: To start server run go run main.go server