A Task Management System Backend using Django Rest Framework (DRF) to handle user and task creation, assignment, and comments with API endpoints for user management and data retrieval. Includes Swagger UI integration for API documentation and comprehensive unit-testing coverage.
-
Clone the repository:
git clone https://github.com/tawhidwasik08/drf-task-manager.git
-
Create a new virtual environment
python3 -m venv tms_venv
-
Activate the virtual environment. (For windows)
tms_venv\Scripts\activate.bat
-
Install the project dependencies.
pip install -r requirements.txt
-
Move to backend/ directory
cd backend
-
Setup database
python manage.py makemigrations python manage.py migrate
-
Run the server
python manage.py runserver
- The API should now be accessible at
http://localhost:8000/
- Admin panel should checked for different user role tokens at
http://localhost:8000/admin/
- Superuser name:su_admin_01 , password:12345
- If any superuser is non existent. Run
python manage.py test createsuperuser
from/backend/
-
Users
- Users can be created freely with any of the 3 roles - admin, manager, team_member. Authentication is not implemented at registration to avoid demo showing complexity.
- Admin has access to everything except for updating any comment.
- Manager has access to -
- Getting all users info
- Creating, updating, deleting Tasks and task comments
- Getting info of tasks of which he is the creator
- Assigning team_members to a task by updating the task
- Team member has access to
- Creating, updating and deleting task comments
- Access token for each user will be generated at registration.
-
Tasks
- Creator will be auto assigned by the user who is currently authorized
- Can be filtered through:
- Assigned to a user_id, completed or not, due date
- Sort descending or ascending by due date, task id, priority
-
Task Comments
- Only admin or the creator of the comment can update or delete it.
- Admin, Task Creator Manager or Task Assignees can only comment on a given task.
-
Others
- Pagination is done by LimitOffsetPagination. Limit and offset parameters are given in available endpoints.
- There are 28 test cases. Run
python manage.py test
from/backend/
- There is a data generator script. Run
python data_generator.py
from/backend/
The API documentation is available at Swagger UI for detailed information about the endpoints and request/response formats.
Method | Endpoint | Function | Role Permission |
---|---|---|---|
GET | /users/ | get multi/single user info | Admin, Manager |
POST | /users/ | create new user | Unauthorized |
GET | /tasks/ | get tasks info | All |
POST | /tasks/ | create a task | Admin, Manager |
GET | /tasks/{task_id}/ | get single task info | All |
PATCH | /tasks/{task_id}/ | update task | Admin, Manager |
DELETE | /tasks/{task_id}/ | delete task | Admin, Manager |
GET | /task-comments/ | get task_comments | All |
POST | /task-comments/ | create task_comments | All |
GET | /task-comments/{comment_id}/ | get single task_comment info | All |
PATCH | /task-comments/{comment_id}/ | update a task_comment | All |
DELETE | /task-comments/{comment_id}/ | delete a task_comment | All |