This is a full-stack Task Management application with Role-Based Access Control (RBAC). It allows users to create, read, update, and delete tasks based on their assigned roles. The application is built with a Node.js/Express backend, MongoDB database, and React frontend.
- User Authentication: JWT-based login and registration system
- Role-Based Access Control: Three roles (admin, manager, user) with distinct permissions
- Task Management:
- Admin: Full CRUD access to all tasks
- Manager: Can create, read, and update tasks
- User: Can view tasks and update their status
- Responsive React frontend
- RESTful API backend
Before you begin, ensure you have met the following requirements:
- Node.js (v14.0.0 or later)
- npm (v6.0.0 or later)
- MongoDB (v4.0.0 or later)
- Clone the repository:
git clone https://github.com/your-username/task-management-app.git- Install dependencies:
cd backend npm install
cd backend npm install
- Set up environment variables:
-
In the
backenddirectory, create a.envfile with the following content: -
Replace
your_jwt_secret_herewith a secure random string
- Start the backend server:
cd backend npm start
- Start the frontend development server:
cd frontend npm start
The React app will run on http://localhost:3000
- Open your browser and navigate to
http://localhost:3000to use the application
- POST
/api/auth/register: Register a new user - POST
/api/auth/login: Login a user - GET
/api/auth/me: Get current user info - GET
/api/tasks: Get all tasks (filtered by user role) - POST
/api/tasks: Create a new task (admin and manager only) - PATCH
/api/tasks/:id: Update a task - DELETE
/api/tasks/:id: Delete a task (admin only)
Contributions to this project are welcome. Please follow these steps:
- Fork the repository
- Create a new branch:
git checkout -b feature-branch-name - Make your changes and commit them:
git commit -m 'Add some feature' - Push to the original branch:
git push origin feature-branch-name - Create the pull request
This project is licensed under the MIT License - see the LICENSE.md file for details.