Welcome to our RBAC Backend API project! This project provides a Role-Based Access Control API for managing user roles and permissions.
To get started, clone this repository and install the dependencies:
git clone https://github.com/Afraz33/RBAC-NodeJs
cd RBAC-NodeJs
npm installCreate a .env file, with your credentials by looking up the sample.env file.
npm start Once the server is running, you can access the API at:
http://localhost:8000- The
routesdirectory contains all the route definitions for the API endpoints. - Each route maps to a specific URL endpoint and HTTP method and calls the corresponding controller function to handle the request.
- The
controllersdirectory contains the logic for handling requests from the routes. - Controllers process incoming requests, interact with the models to retrieve or modify data, and send back appropriate responses.
- The
modelsdirectory contains the data models representing entities in the database. - Each model defines the schema and methods for interacting with the corresponding database table.
- The
permissionMiddlewaredirectory contains middleware functions for handling role-based access control. - These middleware functions intercept incoming requests and check whether the user making the request has the necessary permissions to access the requested resource.
- The
jwtMiddlewaredirectory contains middleware functions for JWT (JSON Web Token) authentication. - These middleware functions handle user authentication by verifying JWT tokens included in the request headers.
You can access API Documentation via this link: