A professional Django REST API for project and task management with time tracking capabilities.
- Authentication System: Secure login/logout with custom landing page
- Project Management: Create, edit, delete, and list projects with pagination and filtering
- Task Management: Comprehensive task management with status tracking and time estimation
- Time Tracking: Start/stop timers for tasks with automatic time accumulation
- Dashboard Analytics: Aggregate metrics and reporting with caching optimization
- Advanced Filtering: Search and filter across projects and tasks
- API Documentation: Auto-generated OpenAPI/Swagger documentation
- Backend: Django 5 + Django REST Framework
- Database: PostgreSQL (with fallback)
- Caching: Redis for performance optimization
- Containerization: Docker & Docker Compose
- Documentation: drf-spectacular (OpenAPI/Swagger)
- Testing: pytest
-
Clone the repository
git clone https://github.com/ndongchrist/Project-Task-APIs.git cd Project-Task-APIs -
Start the application
Before running the command to build images, create a
.envfile and copy the content of.env-docker-sample.txtinto the.env(this will be config for docker services)docker compose up -d --build
-
Run migrations and create sample data
docker compose exec -it web python manage.py migrate #This commands will migrate changes into the DB docker compose exec -it web python manage.py create_sample_data # This commands will create sample data for test docker compose exec -it web python manage.py create_demo_user # email: admin123@devsecurity.com psswd: admin123
-
Access the application
- Access the Application on your browser via(Login Page): http://0.0.0.0:8002/
- Swagger Documentation: http://0.0.0.0:8002/api/docs/ # you need to be login in order to access this documention use the credentials provided by the
create_demo_usercommand - Admin Panel: http://0.0.0.0:8002/admin/
-
Setup virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Environment configuration
Create a file .env at the level of the project and then copy this content inside and make sure it matches your local configuration
# Sample env DB_NAME=your-db-name DB_USER=postgres DB_PASSWORD=your-passwd DB_HOST=localhost DB_PORT=5432 ADMIN_URL=admin/ DEBUG=True SECRET_KEY=your-secret-key REDIS_URL=redis://localhost:6379/0
-
Run migrations and create sample data
python manage.py migrate python manage.py create_sample_data --projects 10 --tasks-per-project 8 python manage.py create_demo_user
-
Start development server
python manage.py runserver
Access the application on a browser via: http://127.0.0.1:8002/
GET /api/v1/projects/- List projects with pagination and filteringPOST /api/v1/projects/- Create new projectGET /api/v1/projects/{id}/- Get project detailsPUT /api/v1/projects/{id}/- Update projectDELETE /api/v1/projects/{id}/- Delete project
GET /api/v1/tasks/- List tasks with filteringPOST /api/v1/tasks/- Create new taskGET /api/v1/tasks/{id}/- Get task detailsPUT /api/v1/tasks/{id}/- Update taskDELETE /api/v1/tasks/{id}/- Delete task
POST /api/v1/tasks/{id}/start-timer/- Start timer for taskPOST /api/v1/tasks/{id}/stop-timer/- Stop active timer
GET /api/v1/dashboard/- Get dashboard overview with metrics
POST /api/token/refresh/- Refreshes the JWT access token using a valid refresh token.POST /api/token/- Obtain JWT access and refresh tokens for authentication.
POST /api/auth/logout/- For Logging outPOST /api/auth/register/- For Registering into the Application
- Database: Optimized queries with
select_related()andprefetch_related() - Caching: Redis caching for dashboard metrics and frequent queries
- Indexing: Strategic database indexes on frequently queried fields
- Pagination: Efficient pagination for large datasets
- Type Hints: Full type annotation throughout the codebase
- Transaction Safety:
@transaction.atomicfor data consistency - Error Handling: Comprehensive error handling with proper HTTP status codes
- Logging: Structured logging for debugging and monitoring
- Validation: Input validation at serializer and model levels
- Constraints: Database-level constraints for data integrity
- UUID: UUIDs as primary keys to prevent enumeration attacks
Run the test suite:
# Using Docker
docker compose exec -it web bash
#then while inside the shell found in the container enter...
pytest --cov=project
# Local development
pytest --cov=project- Implementing the time tracking system with database constraints
- Optimizing queries with Django ORM features
- Creating comprehensive API documentation + Custom Landing Page for accessing API's
- Building a robust caching strategy using Redis
- WebSocket Integration: Real-time timer updates
- Advanced Analytics: More detailed reporting
- File Uploads: Task attachments and project documents
- Notification System: Email/push notifications for task updates
- Implement Celery: Using Celery for Background Tasking for counting or sending emails
- Email Activation For Accounts: Sending Links to Users who register through the API asking the to Activate thier accounts.
- Database Design: Well-normalized schema with proper relationships
- API Architecture: RESTful design with consistent patterns
- Performance: Efficient queries and caching implementation
- Name: Ndongmo Nguimfack Christian
- Email: christianhonore2003@gmail.com
Thank you.. Kindly Waiting for your reviews
