A simple Django-based task management application with user authentication, PostgreSQL database, and Docker containerization.
This application was developed as part of a technical assessment to demonstrate full-stack development skills. It provides a complete task management system where users can create, view, update, and delete their tasks. Each user can only access their own tasks, ensuring data privacy and security.
- User registration and authentication
- CRUD operations for tasks (Create, Read, Update, Delete)
- Task filtering by status
- Responsive design with Tailwind CSS
- RESTful API with Swagger documentation
- Docker containerization with separate services for Django, PostgreSQL, and Nginx
- Backend: Django 4.2
- Database: PostgreSQL 14
- Frontend: Tailwind CSS
- API: Django REST Framework
- Documentation: drf-yasg (Swagger)
- Containerization: Docker & Docker Compose
- Testing: pytest & Django Test Framework
Interactive API documentation is available at /api/swagger/
when the application is running. This provides a user-friendly interface to explore and test all API endpoints.
- Docker and Docker Compose installed on your system
For first-time setup, use the following commands:
# Clone the repository
git clone https://github.com/climax-coder/simple-django-tasks-app
cd task-manager
# Set up and start the application (builds containers, runs migrations, and starts services)
make setup
This command will:
- Build all Docker containers
- Start the application services
- Run database migrations
- Set up initial configuration
After the setup is complete, create an admin user to access the admin interface:
make createsuperuser
Follow the prompts to create your admin account. the default password is password
.
After the initial setup, use these commands for day-to-day development and maintenance:
# Start the application (if it's not already running)
make up
# Stop the application
make down
# Restart the application (after code changes)
make restart
# View real-time logs
make logs
# Run API tests
make test
# Run database migrations (after model changes)
make migrate
# Access Django shell for debugging
make shell
# Clean up all containers and volumes (complete reset)
make clean
For a full list of available commands:
make help
- Make code changes
- Use
make restart
to apply changes - Use
make logs
to check for errors - Use
make test
to run tests and verify functionality - Repeat as needed
- Web Interface: http://localhost
- Admin Interface: http://localhost/admin
- API Documentation: http://localhost/api/swagger/
If you prefer not to use the Makefile, you can run the commands directly:
-
Build and start the containers:
docker compose build docker compose up -d
-
Run migrations:
docker compose exec web python manage.py migrate
-
Create a superuser (admin) account:
docker compose exec web python manage.py createsuperuser
If you want to run the application in development mode without Docker:
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
cd task_manager pip install -r requirements.txt
-
Set up environment variables (copy .env.example to .env and modify as needed)
-
Run migrations and start the server:
python manage.py migrate python manage.py runserver
The API uses token-based authentication. Include the token in the Authorization header:
Authorization: Token <your-token>
The application provides a RESTful API for task management:
Endpoint | Method | Description | Request Body | Response |
---|---|---|---|---|
/api/tasks/ |
GET | List all tasks for the authenticated user | - | Array of task objects |
/api/tasks/ |
POST | Create a new task | Task object | Created task object |
/api/tasks/{id}/ |
GET | Retrieve a specific task | - | Task object |
/api/tasks/{id}/ |
PUT | Update a specific task | Task object | Updated task object |
/api/tasks/{id}/ |
DELETE | Delete a specific task | - | 204 No Content |
{
"id": 1,
"title": "Task Title",
"description": "Task description",
"status": "pending", // Options: pending, in_progress, completed
"due_date": "2025-06-01",
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
}
task_manager/
├── apps/
│ └── tasks/ # Tasks application with models, views, and API
│ ├── api.py # API viewsets and permissions
│ ├── forms.py # Form definitions for task creation/editing
│ ├── models.py # Task data model
│ ├── serializers.py # API serializers
│ ├── tests.py # Model and view tests
│ ├── test_api.py # API endpoint tests
│ ├── urls.py # URL routing for task views
│ └── views.py # View controllers
├── task_manager/ # Project configuration
│ ├── settings.py # Django settings
│ ├── urls.py # Main URL routing
│ └── wsgi.py # WSGI configuration
├── templates/ # HTML templates
│ ├── base.html # Base template with common layout
│ └── tasks/ # Task-specific templates
├── static/ # Static files (CSS, JS, images)
├── theme/ # Tailwind CSS configuration
├── Dockerfile # Docker configuration for Django app
├── requirements.txt # Python dependencies
└── manage.py # Django management script
nginx/ # Nginx configuration
├── nginx.conf # Nginx server configuration
docker-compose.yml # Docker Compose services definition
.env # Environment variables
Makefile # Easy setup and management commands
This application follows a modern web application architecture with:
-
Three-Tier Architecture:
- Presentation Layer: Django templates with Tailwind CSS
- Application Layer: Django views and REST API
- Data Layer: PostgreSQL database
-
Containerization:
- Web Container: Django application server
- Database Container: PostgreSQL database
- Proxy Container: Nginx for serving static files and reverse proxy
-
API Architecture:
- RESTful API using Django REST Framework
- JWT-based authentication
- Swagger/OpenAPI documentation
This project was built with a focus on:
-
Clean, maintainable code structure:
- Modular application design with separation of concerns
- Clear naming conventions and code organization
- Comprehensive docstrings and comments
-
Secure user authentication:
- Django's built-in authentication system
- Permission-based access control
- User isolation (users can only access their own tasks)
-
Responsive UI with modern design:
- Tailwind CSS for utility-first styling
- Mobile-first responsive design
- Clean, intuitive user interface
-
Comprehensive API with documentation:
- RESTful API design principles
- Swagger/OpenAPI documentation
- Proper error handling and status codes
-
Easy deployment with Docker:
- Multi-container setup with Docker Compose
- Environment variable configuration
- Production-ready settings
-
Test coverage for critical functionality:
- Unit tests for models and views
- API endpoint tests
- Authentication and permission tests
- Model-View-Template (MVT): Following Django's core design pattern
- Repository Pattern: Encapsulating data access logic in the models
- Service Layer: Business logic separated from views
- Permission Classes: Custom permission handling for API access