Skip to content

Ubademy-G3/auth.service

Repository files navigation

Auth Microservice

CI codecov

Service for authentication.

This service provides:

  • User registration
  • User authentication via email and password
  • Token verification
  • Password reset

Directory structure

├── index.js
├── src
│   ├── infrastructure
│   │   ├── db
│   │   │   └──  UserSchema.js  
│   │   ├── routes
│   │   │   └──  Auth.js
│   │   └── security
│   │       └──  JwtGenerator.js
│   ├── persistence
│   │   └── repositories
│   │       └── UserRepositoryMongo.js
│   ├── application
│   │   ├── controllers
│   │   │   └── AuthController.js
│   │   ├──serializers
│   │   │   └── UserSerializer.js
│   │   └── useCases
│   │       ├── Authenticate.js
│   │       └── Register.js
│   └── domain
│       ├──UserEntity.js
│       └── UserRepository.js
├── monitoring
├── deploy
└── tests

Tech Stack

  • NodeJS
  • Express (as web framework for NodeJS applications)
  • MongoDB (as NoSQL database)

Local Environment

Requirements

  • Docker
  • Docker-compose

Environment variables

To run this application you need to define the following environment variables:

JWT_SECRET_KEY=YOUR_SECRET_KEY
AUTH_APIKEY=YOUR_AUTH_SERVICE_APIKEY
USER=EMAIL_ADDRESS_SENDER #for password recovery
PASS=EMAIL_PASSWORD_SENDER #for password recovery
SERVICE=EMAIL_SERVICE
PASSWORD_RESET_URL=PASSWORD_RESET_URL

Build and Deploy Services

docker-compose up -d --build

This command deploys the services:

  • authservice_node: Web Service
  • mongo: Database
  • mongo-express: Database admin

Stop services

docker-compose stop

You can try it out at https://staging-auth-service-app-v2.herokuapp.com/api-docs

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •