TaskFlow API is a backend REST API for task management built with Python, Django, Django REST Framework, PostgreSQL, and Docker.
This project is an MVP that provides user authentication and personal task management with filtering, search, ordering, pagination, and basic automated testing.
- User registration
- User login
- Token-based authentication using DRF TokenAuthentication
- Create a task
- List user tasks
- Retrieve task details
- Update a task
- Delete a task
- Each task belongs to one user
- Each user can only view and manage their own tasks
- Filter tasks by:
statusprioritydue_date
- Search tasks by:
titledescription
- Order tasks by:
created_attitledue_date
- Page number pagination is enabled
- Default page size:
5
- PostgreSQL database
- Dockerized development environment
- Environment variables managed with
.env
- Python
- Django
- Django REST Framework
- PostgreSQL
- Docker
- Docker Compose
taskflow-api/
├── config/
│ ├── settings.py
│ ├── urls.py
│ ├── asgi.py
│ └── wsgi.py
├── tasks/
│ ├── models.py
│ ├── serializers.py
│ ├── views.py
│ ├── urls.py
│ └── tests.py
├── users/
│ ├── serializers.py
│ ├── views.py
│ ├── urls.py
│ └── tests.py
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
├── manage.py
└── README.md
Each task includes:
idownertitledescriptionstatusprioritycreated_atdue_date
tododone
lowmediumhigh
POST /api/users/register/
Example request body:
{
"username": "testuser",
"email": "user@example.com",
"password": "yourpassword123"
}
POST /api/users/login/
Example request body:
{
"username": "testuser",
"password": "yourpassword123"
}
Example response:
{
"token": "your_token_here",
"username": "testuser",
"email": "user@example.com"
}
GET /api/tasks/
POST /api/tasks/
Example request body:
{
"title": "Finish Django project",
"description": "Complete the MVP and test endpoints",
"status": "todo",
"priority": "high",
"due_date": "2026-04-20"
}
GET /api/tasks/<id>/
PUT /api/tasks/<id>/
PATCH /api/tasks/<id>/
DELETE /api/tasks/<id>/
Authorization: Token your_token_here
GET /api/tasks/?status=todo
GET /api/tasks/?priority=high
GET /api/tasks/?due_date=2026-04-20
GET /api/tasks/?search=django
GET /api/tasks/?ordering=title
GET /api/tasks/?ordering=-created_at
GET /api/tasks/?ordering=due_date
SECRET_KEY=your_secret_key
DEBUG=True
ALLOWED_HOSTS=127.0.0.1,localhost
POSTGRES_DB=your_db_name
POSTGRES_USER=your_db_user
POSTGRES_PASSWORD=your_db_password
POSTGRES_HOST=your_db_host
POSTGRES_PORT=your_db_port
docker compose up --build
docker compose exec web python manage.py migrate
docker compose exec web python manage.py createsuperuser
http://localhost:8000/
Run automated tests:
docker compose exec web python manage.py test
The project includes tests for:
- User registration
- User login
- Task creation
- Task ownership isolation
- Permission checks
- This is an MVP backend project
- Uses DRF TokenAuthentication
- All task endpoints require authentication
- Users can only access their own tasks
- PostgreSQL data is persisted with a Docker volume
- Add more advanced tests
- Add user profile endpoint
- Add
in_progressstatus - Add API documentation (Swagger)
- Switch to JWT authentication
- Prepare production settings