A Django-based web application that intelligently prioritizes tasks using a custom scoring algorithm. This tool helps users decide what to work on first by analyzing task properties like due dates, importance, effort, and dependencies.
- Smart Prioritization Algorithm - Multi-factor scoring system
- Multiple Sorting Strategies - Smart, Deadline, Importance, Quick Wins, Eisenhower
- Top 3 Suggestions - Personalized recommendations with explanations
- Edge Case Handling - Gracefully handles missing data, overdue tasks, invalid inputs
- π Eisenhower Matrix - Visual 2D grid (Urgent vs Important) with 4 quadrants
- π Dependency Graph - Visualize task dependencies with circular dependency detection
- π Date Intelligence - Considers weekends and holidays in urgency calculation
- π§ Learning System - Feedback-based algorithm adjustment
- β Comprehensive Tests - 62 unit tests covering all functionality
- π³ Docker Support - Containerized deployment ready
- Modern UI - Dark theme with responsive design and animations
- REST API - Clean JSON endpoints for all operations
# Navigate to project
cd task-analyzer
# Create virtual environment
python -m venv venv
source venv/bin/activate # Mac/Linux
# venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Run migrations
python manage.py migrate
# Start server
python manage.py runserverOpen: http://127.0.0.1:8000/
cd task-analyzer
# Build and run with Docker Compose
docker-compose up --build
# Or run in background
docker-compose up -d --build
# Stop
docker-compose downOpen: http://localhost:8000/
The Smart Task Analyzer uses a weighted multi-factor algorithm to calculate priority scores. Higher scores indicate higher priority.
| Factor | Weight | Max Points | Description |
|---|---|---|---|
| Urgency | 40% | 100 | Based on working days until due date |
| Importance | 30% | 50 | User-defined priority (1-10) Γ 5 |
| Effort | 20% | 15 | Quick wins bonus for small tasks |
| Dependencies | 10% | 20 | Bonus for blocking tasks |
Overdue β +100 points (MAXIMUM URGENCY)
Due Today β +75 points
Due in 1-2 work days β +60 points
Due in 3-5 work days β +40 points
Due in 6-10 work days β +20 points
Due in 11+ work days β +0 points
* Weekends and holidays are excluded from working days
* Tasks due after a long weekend get urgency boost
| Label | Score Range | Meaning |
|---|---|---|
| CRITICAL | β₯150 | Requires immediate attention |
| HIGH | 100-149 | Should be done soon |
| MEDIUM | 60-99 | Normal priority |
| LOW | <60 | Can wait |
Tasks are also classified into 4 quadrants:
| Quadrant | Criteria | Action |
|---|---|---|
| Q1: DO FIRST | Urgent & Important | Handle immediately |
| Q2: SCHEDULE | Not Urgent & Important | Plan time for these |
| Q3: DELEGATE | Urgent & Not Important | Delegate or batch |
| Q4: ELIMINATE | Not Urgent & Not Important | Consider removing |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/tasks/analyze/ |
Analyze and sort tasks |
POST |
/api/tasks/suggest/ |
Get top suggestions |
POST |
/api/tasks/eisenhower/ |
Get Eisenhower Matrix |
POST |
/api/tasks/dependencies/ |
Get dependency graph |
POST |
/api/tasks/feedback/ |
Submit learning feedback |
DELETE |
/api/tasks/feedback/ |
Reset learning system |
Request:
POST /api/tasks/analyze/
{
"tasks": [
{
"id": 1,
"title": "Complete report",
"due_date": "2024-12-31",
"importance": 8,
"estimated_hours": 3,
"dependencies": []
}
],
"strategy": "smart",
"use_date_intelligence": true,
"use_learning": true
}Response:
{
"success": true,
"tasks": [
{
"id": 1,
"title": "Complete report",
"score": 125,
"status_label": "HIGH",
"eisenhower": { "quadrant": "Q1", "label": "DO FIRST" },
"date_context": "3 working days (5 calendar days)",
...
}
],
"strategy": "smart",
"count": 1
}| Strategy | Description |
|---|---|
smart |
Balanced algorithm using all factors (default) |
deadline |
Sort by due date, closest first |
importance |
Sort by importance level, highest first |
quick_wins |
Sort by duration, shortest first |
eisenhower |
Sort by Eisenhower quadrant (Q1βQ2βQ3βQ4) |
| Scenario | Handling |
|---|---|
Missing due_date |
Treated as low urgency (0 points) |
Missing importance |
Defaults to 5 (medium) |
Missing estimated_hours |
Defaults to 2 hours |
| Past due dates (e.g., 1990) | Marked as overdue with maximum urgency |
| Circular dependencies | Detected and flagged visually |
| Weekend due dates | Adjusted urgency based on working days |
| Invalid JSON | Returns clear error message |
task-analyzer/
βββ backend/ # Django Project Configuration
β βββ settings.py # Django settings
β βββ urls.py # Main URL routing
β βββ wsgi.py # WSGI config
βββ tasks/ # Tasks Application
β βββ models.py # Task model definition
β βββ scoring.py # β Scoring algorithm with all features
β βββ views.py # API views
β βββ urls.py # API URL routing
β βββ tests.py # 62 unit tests
βββ frontend/ # Frontend Files
β βββ index.html # Main HTML page
β βββ styles.css # Dark theme styling
β βββ script.js # JavaScript interactivity
βββ Dockerfile # Docker container config
βββ docker-compose.yml # Docker Compose config
βββ .dockerignore # Docker ignore rules
βββ requirements.txt # Python dependencies
βββ manage.py # Django management
βββ README.md # This file
# Run all tests
python manage.py test tasks
# Run with verbose output
python manage.py test tasks --verbosity=2Test Coverage:
- Date parsing (9 tests)
- Urgency calculation (6 tests)
- Date intelligence - weekends/holidays (7 tests)
- Importance scoring (3 tests)
- Effort scoring (4 tests)
- Dependency graph & cycles (5 tests)
- Eisenhower Matrix (5 tests)
- Complete task scoring (5 tests)
- Task analysis strategies (4 tests)
- Suggestions (3 tests)
- API endpoints (5 tests)
- Edge cases (6 tests)
- Dark Theme - Easy on the eyes with amber accent colors
- Two Input Modes - Form-based entry or JSON paste
- Real-time Validation - Immediate feedback on input
- Animated Results - Smooth card animations
- Priority Color Coding:
- π΄ Red = Critical
- π Orange = High
- π‘ Yellow = Medium
- π’ Green = Low
- Responsive Design - Works on desktop and mobile
- Modal Views - Eisenhower Matrix and Dependency Graph popups
docker-compose up --build- Python 3.12 slim base (small image size)
- Auto-runs migrations on build
- Health checks included
- SQLite database support
- Volume mounting for development
This project is created for educational purposes as part of the Singularium Assignment.
Built with using Django, Vanilla JavaScript, and Docker