Giter VIP home page Giter VIP logo

identity-provider's Introduction

Identity Provider:

1. Overview:

This API is a piece in a Microservices project, I'm working on right now. And it's for managing user identities across multiple services thought out this project.

2. Installation:

  1. Download the project by cloning it
   git clone https://github.com/Hakona-Matata/identity-provider
  1. Install the requirements:
cd identity-provider
npm i

3. Configuration:

  1. Prepare environment variables:

// Open the env.example file
// get the needed environment variables ready, such as:

MONGO_URI:"your mongodb url"
etc...

  1. Start the server
// Run in any environment you want

npm run dev         // For development mode (recommend this)
npm run stage       // For staging mode
npm run prod        // For production mode

4. API Documentation:

Documentation link | postman

While several documentation options were considered, Postman was chosen for this piece!

The documentation will provide a comprehensive overview for all the available endpoints, expected requirements, requests, and responses examples.

5. Used Tech Stack:

The core technologies, I've used were:

  • Javascript, and actually it wasn't a good option during the development journey, I'll use "Typescript" from now on in the other project pieces!
  • ExpressJS: A Framework built above NodeJS for creating a web applications.
  • Mongoose: A Object Data modeling library (ODM) for "MongoDB and NodeJS" applications.
  • jsonwebtoken: A library for generating and verifying tokens.
  • jest: A javascript testing framework that's highly flexible, and can be used for a wide range from "simple unit testing" to "complex end to end (E2E) testing".

6. Architecture:

I've been trying to follow the "Domain Driven Design (DDD)" as much as possible and here it's the API architecture :


/src
   /core              // The necessary files for making the API alive!
   /domain            // The domain-specific logic of the application
   /infrastructure    // The details of the infrastructure of the application
   /shared            // The shared code across the application

7. Worth Mentioning:

  1. "Some design patterns", I'm proud of using were:

    • service repository pattern: The basic idea is to have a service layer that provides a high-level API for the business logic, which in turn interacts with a repository layer that abstracts away the persistence details. The repository provides methods to create, read, update, and delete (CRUD) data, and the service layer uses these methods to implement business logic.
  2. I've been using "Object oriented programming (OOP)" and utilized it's concepts and principles, such as:

    • Encapsulation
    • Abstraction
    • Composition
    • Inheritance
  3. Followed "the clean code principles" as much as possible.

8. Features:

This API is categorized into modules, such as :

(See documentation for more details!)

  • Auth

    • Sign up
    • Verify
    • Log In
  • Session:

    • Get all
    • Cancel
    • Renew
    • Validate
  • Account:

    • Deactivate
    • Confirm Activation
    • Delete
    • Cancel
  • Password:

    • Change
    • Forget
    • Reset
  • Otp over Email:

    • Initiate Enabling
    • Confirm Enabling
    • Verify (During login)
    • Disable
  • Otp over Sms:

    • Initiate Enabling
    • Confirm Enabling
    • Verify (During login)
    • Disable
  • Totp:

    • Initiate Enabling
    • Confirm Enabling
    • Verify (During login)
    • Disable
  • Backup Codes:

    • Initiate Enabling
    • Confirm Enabling
    • Recover
    • Regenerate
    • Disable

9. Notes:

This API is not 100% finished. I Know, that I'll do more modification in the future to make suit and be easily integrated to the other pieces of the project!

10. Results of API tests:

identity-provider's People

Contributors

ahmedelgaidi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.