A full-stack task management application built with Django REST Framework (backend) and React (frontend). This application allows users to create, read, update, and delete tasks with a clean, minimalistic user interface.
- ✅ Create Tasks - Add new tasks with title and optional description
- ✅ View Tasks - Display all tasks with filtering options
- ✅ Edit Tasks - Update task title and description
- ✅ Toggle Completion - Mark tasks as completed or pending
- ✅ Delete Tasks - Remove tasks from the list
- ✅ Filter Tasks - View all, pending, or completed tasks
- ✅ Statistics Dashboard - Track completion rates and task counts
- ✅ Responsive Design - Works on desktop and mobile devices
OperationTest/
├── backend/ # Django REST Framework backend
│ ├── manage.py
│ ├── backend/
│ │ ├── settings.py
│ │ ├── urls.py
│ │ └── ...
│ └── tasks/ # Django app for task management
│ ├── models.py # Task model definition
│ ├── views.py # API ViewSets
│ ├── serializers.py # DRF serializers
│ ├── urls.py # API URL routing
│ └── ...
└── frontend/ # React frontend
├── package.json
├── src/
│ ├── components/ # Reusable React components
│ │ ├── TaskForm.tsx
│ │ └── TaskItem.tsx
| | └── ...
│ ├── pages/ # Page components
│ │ └── LandingPage.tsx
│ ├── services/ # API service layer
│ │ └── taskService.ts
│ └── ...
└── ...
- Django 5.2.6 - Web framework
- Django REST Framework 3.16.1 - API framework
- django-cors-headers 4.9.0 - CORS handling
- SQLite - Database (default Django database)
- React 18.3.1 - Frontend framework
- TypeScript - Type safety
- Tailwind CSS 3.4.14 - Styling
- Axios - HTTP client
- Vite - Build tool
Before running this application, make sure you have the following installed:
- Python 3.10+
- Node.js 16+ and npm
- Git (for cloning the repository)
-
Navigate to the backend directory:
cd backend -
Create and activate a virtual environment:
# Windows python -m venv venv venv\Scripts\activate # macOS/Linux python3 -m venv venv source venv/bin/activate
-
Install Python dependencies:
pip install -r "requirements.txt" -
Run database migrations:
python manage.py makemigrations python manage.py migrate
-
Start the Django development server:
python manage.py runserver
The backend API will be available at:
http://localhost:8000
-
Navigate to the frontend directory:
cd frontend -
Install Node.js dependencies:
npm install
-
Install Axios for API calls:
npm install axios
-
Start the React development server:
npm run dev
The frontend application will be available at:
http://localhost:5173
The backend provides the following REST API endpoints:
| Method | Endpoint | Description | Request Body |
|---|---|---|---|
GET |
/tasks/ |
List all tasks | None |
POST |
/tasks/ |
Create a new task | {"title": "string", "description": "string", "completed": false} |
GET |
/tasks/{id}/ |
Retrieve a specific task | None |
PUT |
/tasks/{id}/ |
Update a task (full update) | {"title": "string", "description": "string", "completed": boolean} |
PATCH |
/tasks/{id}/ |
Partially update a task (e.g., toggle completion) | {"completed": boolean} |
DELETE |
/tasks/{id}/ |
Delete a task | None |
{
"id": "integer (auto-generated)",
"title": "string (required, max 200 chars)",
"description": "string (optional)",
"completed": "boolean (default: false)",
"created_at": "datetime (auto-generated)"
}GET /tasks/ - List all tasks:
[
{
"id": 1,
"title": "Complete project documentation",
"description": "Write comprehensive README and API docs",
"completed": false,
"created_at": "2025-10-01T10:30:00Z"
},
{
"id": 2,
"title": "Review code",
"description": "",
"completed": true,
"created_at": "2025-10-01T09:15:00Z"
}
]POST /tasks/ - Create a task:
// Request
{
"title": "New task",
"description": "Task description",
"completed": false
}
// Response (201 Created)
{
"id": 3,
"title": "New task",
"description": "Task description",
"completed": false,
"created_at": "2025-10-01T11:00:00Z"
}-
TaskForm - Create and edit tasks
- Expandable form interface
- Validation for required fields
- Clean, minimalistic design
-
TaskItem - Display individual tasks
- Checkbox for completion toggle
- Hover effects for action buttons
- Edit and delete functionality
-
LandingPage - Main application interface
- Statistics dashboard
- Task filtering (All, Pending, Completed)
- Responsive grid layout
- Minimalistic Design - Clean white background with subtle gray accents
- No Gradients - Flat design with simple color palette
- Responsive Layout - Works on desktop, tablet, and mobile
- Accessible - Proper contrast ratios and keyboard navigation
- Modern Typography - Clear hierarchy and readable fonts
CORS Settings (for development):
# settings.py
CORS_ALLOW_ALL_ORIGINS = True # Only for developmentDatabase Configuration:
- Using SQLite by default
- Database file:
backend/db.sqlite3 - Automatically created on first migration
API Base URL:
// src/services/taskService.ts
const API_BASE_URL = 'http://localhost:8000/tasks';- Start both servers (backend on :8000, frontend on :5173)
- Create tasks using the form at the top of the page
- View statistics in the dashboard cards
- Filter tasks using the All/Pending/Completed tabs
- Edit tasks by clicking the edit button (appears on hover)
- Toggle completion by clicking the checkbox
- Delete tasks by clicking the delete button (appears on hover)
-
CORS Errors:
- Ensure
django-cors-headersis installed and configured - Check that
CORS_ALLOW_ALL_ORIGINS = Trueis set (development only)
- Ensure
-
API Connection Issues:
- Verify backend server is running on
http://localhost:8000 - Check that the frontend API URL matches the backend URL
- Verify backend server is running on
-
Database Issues:
- Run
python manage.py makemigrations tasks - Run
python manage.py migrate
- Run
-
Frontend Build Issues:
- Delete
node_modulesand runnpm installagain - Check that all dependencies are properly installed
- Delete
This project is for educational and demonstration purposes.