A task management application built with Django REST framework and React. Manage your tasks effortlessly with this full-stack web application! 🚀
- 🆕 Add Tasks: Create new tasks with a title.
- 📋 View Tasks: List all existing tasks in a clean, organized format.
- ❌ Delete Tasks: Remove tasks when they’re done.
- 💻 Full-Stack Setup: Django REST framework as backend, React as frontend.
- Backend: Django, Django REST Framework
- Frontend: React, Axios (for API requests)
- Database: SQLite (default with Django, can switch to PostgreSQL or MySQL)
- Utilities: Django CORS Headers, Axios
Follow these steps to get the project running on your local machine:
Make sure you have the following installed:
- Python 3.x 🐍
- Node.js and npm 🌐
-
Clone the Repository:
git clone https://github.com/saeidsaadatigero/task-manager.git cd task-manager
-
Set up a Virtual Environment:
python -m venv .venv source .venv/bin/activate # For Windows use `.venv\Scripts\activate`
-
Install Backend Dependencies:
pip install -r requirements.txt
-
Run Migrations:
python manage.py migrate
-
Start the Backend Server:
python manage.py runserver
Django server will be running at
http://127.0.0.1:8000/
🎉 -
Setup CORS (if needed): Add
CORS_ALLOWED_ORIGINS
in Django settings to allow requests from the frontend:# settings.py CORS_ALLOWED_ORIGINS = [ "http://localhost:3000", ]
-
Navigate to the
frontend
Directory:cd frontend
-
Install Frontend Dependencies:
npm install
-
Start the React Development Server:
npm start
React app will be running at
http://localhost:3000/
🥳
Here’s a quick overview of the project layout:
task-manager/
├── backend/ # Django backend
│ ├── task_manager/ # Django project configuration
│ └── api/ # API app containing views, models, and serializers
│
└── frontend/ # React frontend
├── src/
│ ├── components/ # React components (TaskList, TaskForm, TaskItem)
│ ├── App.js # Main React App component
│ ├── api.js # Axios API configuration
│ └── index.js # React entry point
- Go to
http://localhost:3000
to view the task manager app. - 🖊️ Use the input form to add new tasks. Tasks are saved in the backend and loaded on page refresh.
- 🗑️ Delete tasks by clicking the “Delete” button next to each item.
These are the main API endpoints exposed by Django:
GET /api/tasks/
- Get all tasksPOST /api/tasks/
- Create a new taskDELETE /api/tasks/<id>/
- Delete a specific task
- CORS Errors: Add the frontend URL (
http://localhost:3000
) inCORS_ALLOWED_ORIGINS
in Django settings. - Database Issues: If SQLite gives trouble, delete the
db.sqlite3
file and re-run migrations (python manage.py migrate
).
Contributions are welcome! Feel free to submit issues, create pull requests, or fork the repo and make your own changes. 🎉
This project is licensed under the MIT License.
Made with ❤️ by Saeid Saadatigero