The "rbac-healthcare-system" repository is a Node.js project that implements Role-Based Access Control (RBAC) for healthcare system, defining roles like admin, doctor, and patient with specific permissions. It features JWT authentication, MongoDB integration, and a modular architecture with controllers, routes, and models. Unit tests are included to ensure reliability.
To view the Swagger UI schema, navigate to http://localhost:3000/api-docs
in your browser after running the server.
- Node.js: Backend runtime environment.
- express.js: Web framework for Node.js.
- MongoDB: NoSQL database for storing user data.
- mongoose: ODM for MongoDB.
- express-validator: Server side validation for input fields
- bcrypt: Library for hashing passwords.
- JSON Web Tokens (JWT): Standard for creating secure access tokens.
- jest: Testing framework for JavaScript, used to write and run unit tests.
- supertest: Library for testing HTTP endpoints in Node.js applications.
- swagger-ui-express: Middleware to serve auto-generated Swagger API documentation in Express.js applications.
- swagger-jsdoc: Library to generate Swagger API documentation from JSDoc comments in your code.
- Clone the repository
git clone https://github.com/carpodok/rbac-healthcare-system
- Navigate to the project directory:
cd rbac-healthcare-system
- Install required dependencies
npm install
- Creat a
.env
file on the root of the project and add the following environment variables
PORT=3000
MONGODB_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
- To start the server, run the following command on the root of the project path;
npm start
For the development purpose;
npm run dev
- The application will be running on
http://localhost:3000
Contributions are welcome! Please open an issue or submit a pull request for any improvements or suggestions.
This project is licensed under the MIT License.