A modern backend project built with Django REST Framework, featuring JWT authentication, AI-powered task suggestions via OpenAI, and complete API documentation.
| Technology | Badge |
|---|---|
| Python | |
| Django | |
| DRF | |
| OpenAI | |
| License |
- 📝 Full CRUD operations on tasks
- 🔐 JWT Authentication (Simple JWT)
- 🤖 AI task suggestion endpoint using OpenAI GPT-3.5
- 📄 API documentation with Swagger & ReDoc
- 🛠 Admin panel for managing users and tasks
- 🆕 Signup / Login / Logout pages for user management
- 🔧 Recent modifications:
- Added AI task suggestion improvements
- Refactored
views.pyfor clarity and stability - Added proper signup/login integration
- Updated API endpoints table for clarity
- LATEST: Complete code refactoring with improved quality
- Fixed duplicate model fields (user/owner)
- Updated to modern OpenAI ChatCompletion API
- Added comprehensive error handling and logging
- Improved authentication and permissions
- Enhanced test coverage (7 tests)
- Applied Black code formatting
- Added environment validation command
- Ready for production deployment 🚀
- Deployment guides for Heroku, Railway, Docker, AWS, VPS
- Production-ready Dockerfile and docker-compose.yml
- Heroku Procfile and runtime.txt
- Nginx configuration for reverse proxy
| Feature | Method | URL | Description |
|---|---|---|---|
| Admin Panel | GET | http://127.0.0.1:8000/admin/ | Django admin dashboard |
| Index / Homepage | GET | http://127.0.0.1:8000/ | Simple homepage |
| Signup | GET / POST | http://127.0.0.1:8000/accounts/signup/ | Create a new user account |
| Login | GET / POST | http://127.0.0.1:8000/accounts/login/ | User login page |
| Logout | GET | http://127.0.0.1:8000/accounts/logout/ | Logout current user |
| API Root | GET | http://127.0.0.1:8000/api/ | Root API endpoint |
| Tasks List / Create | GET / POST | http://127.0.0.1:8000/api/tasks/ | View all tasks / Create new task |
| Task Detail | GET / PUT / PATCH / DELETE | http://127.0.0.1:8000/api/tasks// | Retrieve, update or delete a task |
| AI Task Suggestion | POST | http://127.0.0.1:8000/api/suggest-task/ | Get AI-generated task suggestions |
| JWT Obtain Token | POST | http://127.0.0.1:8000/api/token/ | Get access & refresh tokens |
| JWT Refresh Token | POST | http://127.0.0.1:8000/api/token/refresh/ | Refresh access token |
| Swagger Docs | GET | http://127.0.0.1:8000/docs/ | Interactive API documentation |
| ReDoc Docs | GET | http://127.0.0.1:8000/redoc/ | Beautiful ReDoc documentation |
# Clone repository
git clone <your-repo-url>
cd task-manager
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux / Mac
venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Copy environment template and configure
cp .env.development .env
# Edit .env and add your settings (especially OPENAI_API_KEY if you want AI features)
# Check environment configuration (optional but recommended)
python manage.py check_env
# Run migrations
python manage.py makemigrations
python manage.py migrate
# Create a superuser (for admin access)
python manage.py createsuperuser
# Start the server
python manage.py runservercurl -X POST http://127.0.0.1:8000/api/suggest-task/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-jwt-token>" \
-d '{"prompt":"study Django"}'Response Example:
{
"suggestion": "Review Django models and build a small CRUD project."
}Backend: Django 5.2, Django REST Framework
Authentication: JWT (Simple JWT)
AI: OpenAI GPT-3.5
Docs: drf-yasg (Swagger & ReDoc)
Database: SQLite (default, can switch to PostgreSQL)
Code Quality: Black, isort
- Make sure
OPENAI_API_KEYis set in.envto use the AI endpoint - Use
python manage.py check_envto validate your environment configuration - All links above are local URLs, accessible when the server runs
- The AI suggestion endpoint requires authentication (JWT token)
This application is production-ready and can be deployed to various platforms:
- Heroku:
git push heroku main(see DEPLOYMENT.md) - Railway: One-click deploy from GitHub
- Docker:
docker-compose up -d - Digital Ocean: App Platform auto-deploy
- AWS: Elastic Beanstalk or ECS
- VPS: Traditional server deployment with Nginx
📖 Full deployment guide: See DEPLOYMENT.md for detailed instructions for each platform.
- ✅
Procfile- Heroku/Railway deployment - ✅
runtime.txt- Python version specification - ✅
Dockerfile- Production-ready container image - ✅
docker-compose.yml- Multi-container orchestration - ✅
nginx.conf- Reverse proxy configuration - ✅
.dockerignore- Optimized Docker builds
python manage.py check --deploy # Check deployment readiness
python manage.py test # Run all tests
python manage.py collectstatic # Collect static filesThis project is actively maintained, with recent comprehensive refactoring to improve code quality, security, and maintainability.
This project is licensed under the MIT License.