A RESTful API for managing company projects and tasks with role-based access control.
- Clone the repository
- Install dependencies:
npm install - Set up environment variables in
.env - Setup the database:
npm run setup - Seed the database:
npm run seed - Start the server:
npm start
This API is partially implemented and needs JWT authentication and role-based authorization added.
- User registration and login (session-based)
- Full CRUD operations for projects and tasks
- Database relationships and seeding
- Basic authentication middleware
- Add role field to User model
- Replace session authentication with JWT tokens
- Create role-based middleware functions
- Protect endpoints with appropriate role restrictions
- Test authorization flows
POST /api/register- Register new userPOST /api/login- User loginPOST /api/logout- User logout
GET /api/users/profile- Get current user profileGET /api/users- Get all users
GET /api/projects- List projectsGET /api/projects/:id- Get single projectPOST /api/projects- Create projectPUT /api/projects/:id- Update projectDELETE /api/projects/:id- Delete project
GET /api/projects/:id/tasks- List tasks for projectPOST /api/projects/:id/tasks- Create taskPUT /api/tasks/:id- Update taskDELETE /api/tasks/:id- Delete task
john@company.com(Employee) - password: password123sarah@company.com(Manager) - password: password123mike@company.com(Admin) - password: password123
- Employee: View projects/tasks, update task status
- Manager: Create/edit projects, assign tasks, view team progress
- Admin: Full system access, manage users, delete projects