A full-featured Task and Project Management REST API built with Django and Django REST Framework. Supports task categorization, project membership with role-based access control, and invitation links.
- Register/Login via email & password
- JWT-based secure authentication (
SimpleJWT
) - Token blacklisting on logout
- Profile view & update support
- Create, read, update, delete tasks
- Set priority, due dates, completion & favorite flags
- Task filtering: status, priority, search, due today
- Task toggles: mark as completed / favorite
- Bulk task retrieval via project or category
- Create, read, update, delete categories
- Set categories to tasks
- Filter tasks by category
- Create and manage projects
- Built-in roles: Admin, Moderator, Member, Viewer
- Assign roles to members
- Restrict actions based on roles
- Invitation system via share links with expiration & usage limits
- SQLi, XSS & JSON payload protection
- Custom regex validators for usernames, categories, phone numbers
- Rate-limited endpoints (optional)
- Read-only roles protected by permissions
- Python 3.11+ / Django 5.1
- Django REST Framework
- PostgreSQL
python-decouple
for environment managementdjangorestframework-simplejwt
for authentication- GitHub Actions for CI with coverage enforcement
- Python >= 3.11
- PostgreSQL >= 13
git clone https://github.com/Brunowar12/TaskManagerSystem.git
cd TaskManagerSystem
python -m venv venv
source venv/bin/activate # or venv\Scripts\Activate on Windows
pip install pip-tools
pip-sync requirements.txt
Create a .env
file:
DEBUG=True
SECRET_KEY=your-secret-key
DB_NAME=taskmanager_db
DB_USER=your-db-user
DB_PASSWORD=your-password
DB_HOST=localhost
DB_PORT=5432
Run database migrations:
python manage.py migrate
python manage.py createsuperuser
python manage.py collectstatic --noinput
python manage.py runserver
Visit:
- http://127.0.0.1:8000 for Django backend
- Swagger UI: http://127.0.0.1:8000/swagger/
- ReDoc: http://127.0.0.1:8000/redoc/
POST /api/auth/register/
– Register new userPOST /api/auth/login/
– Log in, get tokensPOST /api/auth/logout/
– Logout and blacklist tokenPOST /api/auth/token/refresh/
– Refresh JWT
GET /api/tasks/
– List tasks (filters, pagination)POST /api/tasks/
– Create a taskPATCH /api/tasks/{id}/
– Update a taskDELETE /api/tasks/{id}/
– Delete a taskPOST /api/tasks/{id}/toggle-favorite/
POST /api/tasks/{id}/toggle-completed/
GET /api/projects/
– List accessible projectsPOST /api/projects/
– Create new projectPOST /api/projects/{id}/assign_role/
– Assign rolePOST /api/projects/{id}/generate_share_link/
– Create invitationPOST /api/projects/join/{token}/
– Join via linkDELETE /api/projects/{id}/delete-share-link/{link_id}/
Run the full test suite:
coverage run --source='.' manage.py test api.tests
coverage report -m
Tests cover:
- Role-based permissions
- CRUD for tasks, projects, categories
- Security checks (XSS, SQLi, payload limits)
- Share link lifecycle
GitHub Actions runs all tests and enforces 90%+ coverage.
Style guide: Follow PEP8, use type hints and write tests.
- Fork the repo
- Create your feature branch:
git checkout -b feature/xyz
- Commit:
git commit -m "feat: added xyz"
(feat:
,fix:
,test:
) - Push:
git push origin feature/xyz
- Open a pull request
MIT License © 2024 Brunowar12