DOC-20241210-WA0000.
DOC-20241210-WA0000.
Objective
Develop a comprehensive RESTful API for a task management system using Node.js. The API
should include user authentication, role-based access control, task management, and
integration with a third-party notification service. Document the API using the OpenAPI
Specification (OAS) to ensure clarity and ease of understanding for other developers.
Core Requirements
1. User Registration
2. User Login
● Endpoint: Allow registered users to log in using their credentials (username/email and
password).
● Functionality:
○ Validate user credentials.
○ Issue a JWT token upon successful login.
● Security: Implement rate limiting to prevent brute-force attacks.
3. User Logout
6. Task Management
● CRUD Operations:
○ Create Task: Endpoint to create a new task with fields such as title, description,
due date, priority, and status.
○ Read Task: Endpoint to retrieve a list of tasks, with optional filtering and sorting
parameters.
○ Update Task: Endpoint to update task details.
○ Delete Task: Endpoint to delete a task.
● Security: Ensure tasks are associated with users and enforce access control.
7. Task Assignment
● Functionality:
○ Assign tasks to users.
○ Allow managers to assign tasks to users within their team.
● Endpoints:
○ View assigned tasks.
○ Update task assignments.
Advanced Features (Bonus Points)
1. Real-Time Updates
2. Analytics
● Endpoints: Provide basic analytics endpoints to track the number of tasks completed,
pending, and overdue.
● Functionality: Retrieve task completion statistics by user and team.
3. Caching
4. Rate Limiting
● Functionality: Implement search and filtering for tasks based on various criteria (e.g.,
status, priority, due date).
● Performance: Ensure efficient querying and indexing for optimal performance.
Additional Notes
Libraries and Middleware
● Flexibility: Feel free to use any additional libraries or middleware that you find suitable
for the implementation.
● Best Practices: Ensure the chosen libraries are well-maintained and commonly used in
the industry.
2. Documentation
● Setup: Provide detailed documentation on how to set up and run the application locally.
● Instructions: Include instructions for installing dependencies, configuring environment
variables, and starting the server.
● API Overview: Provide an overview of the API endpoints, including their purpose and
usage examples.
● Assumptions: Document any assumptions or design decisions made during the
implementation.
3. Functional Requirements
● Compliance: Ensure the API meets all functional requirements outlined in the
assignment.
● Error Handling: Implement proper error handling and validation for all endpoints.
● RBAC: Verify that role-based access control is correctly enforced for each endpoint.
4. API Documentation
● OpenAPI: Document the API using OpenAPI Specification (OAS) version 3.0.
● Interactive Docs: Provide a link to the Swagger UI or ReDoc page where the API
documentation can be interactively explored.
● Details: Ensure the documentation includes details such as endpoint paths, request
methods, request and response schemas, query parameters, and authentication
requirements.
● Deployment: Deploy the API to a cloud provider (e.g., Heroku, AWS, GCP) for
demonstration purposes.
● URL: Provide the URL for the deployed API in the documentation.
● Security: Ensure the deployment is secure and accessible.