Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Role-Based API with Redis Sessions

This is a role-based API that handles user authentication, authorization, and session management using Redis. The API uses Redis sessions for secure authentication and includes role-based access control to restrict access to certain endpoints based on user roles (admin, user, moderator).

Deployed on AWS EC2 - http://3.108.150.30/api-docs/ (Swagger Docs Available)

Features

  • User registration, login, and logout functionality
  • Role-based access control (admin, user, guest)
  • Redis session management for secure user authentication
  • API documentation generated with Swagger

Technologies Used

  • Express: Web framework for Node.js
  • MongoDB: Database for storing user data
  • Redis: Session store
  • Swagger: API documentation
  • Bcrypt: For password hashing
  • express-session: For secure authentication
  • Node.js: JavaScript runtime

Prerequisites

Before running the project, ensure you have the following installed:

Installation

  1. Clone the repository:
    git clone https://github.com/Samar-28/RBAC.git
  2. Go to project:
    cd RBAC
  3. Install Dependencies:
    npm i
  4. Create .env:
    MONGO_URI=
    SESSION_SECRET=
    REDIS_HOST=
    REDIS_PORT=
    PORT=
  5. Start the server:
    npm start
  6. Access the API documentation at http://localhost:5000/api-docs

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages