Video Demonstration: Loom Video
GitHub Repository: https://github.com/Omarhus01/cs162-web-application-assignment
A full-stack hierarchical task management system built with Flask and React, featuring intelligent task completion cascading and 5-level nesting support.
This application allows users to organize complex projects through nested tasks and subtasks. Built with a Flask REST API backend and React frontend, it supports up to 5 levels of task nesting with smart completion logic: checking a parent completes all children, and completing all children auto-completes the parent.
The system uses session-based authentication to keep users' data private, and features a recursive component architecture that dynamically renders the task hierarchy. The dark cyberpunk-themed interface makes it both functional and visually distinctive.
- Multi-user Support - Private todo lists with session-based authentication
- 5-Level Nesting - Organize tasks into deep hierarchies (Extension 1)
- Smart Completion - Intelligent cascading when checking/unchecking tasks
- Persistent State - Collapse/expand states saved to database
- Task Movement - Move tasks between lists with all subtasks
- Duplicate Prevention - Validates unique names in context
- Cyberpunk UI - Custom dark theme with neon accents
- Priority System - Color-coded badges (๐ด High, ๐ก Medium, ๐ข Low)
- Inline Editing - Double-click to edit task titles
- Create & Move - Create new lists directly from move dropdown
- Task Statistics - Real-time progress tracking
Backend
- Flask 2.3.3 - REST API framework
- SQLAlchemy - Database ORM with self-referential relationships
- SQLite - Embedded database
- Werkzeug - Password hashing
- Pytest - Testing framework (52 tests, 86% coverage)
Frontend
- React 18 - Component-based UI
- React Router 6 - Client-side routing
- Axios - HTTP client
- Bootstrap 5 - Responsive framework
- Custom CSS - Cyberpunk theme
- Python 3.11+
- Node.js 14+
- npm 6+
Windows:
cd "TodoApp w\backend"
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt
python app.pymacOS/Linux:
cd "TodoApp w/backend"
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
python3 app.pyโ
Backend runs on http://localhost:5000
cd "TodoApp w/frontend"
npm install
npm startโ
Frontend runs on http://localhost:3000
The database is created automatically on first run. No manual configuration needed!
- Register - Create account with username, email, password
- Login - Enter credentials to access dashboard
- Create List - Click "+ New List" to organize tasks
- Add Tasks - Create top-level tasks with title, description, priority
- Add Subtasks - Click "โฎ" โ "โ Add Subtask" (up to 5 levels deep)
- Complete - Click checkbox (cascades to all subtasks)
- Edit - Double-click title or click "โฎ" โ "โ๏ธ Edit"
- Change Priority - Click priority badge โ Select level
- Move to List - Click "โฎ" โ "Move to List" โ Select or create list
- Delete - Click "โฎ" โ "๐๏ธ Delete" (removes all subtasks)
- Collapse/Expand - Click โถ/โผ button (state persists)
- Check parent โ All children auto-check
- Check all children โ Parent auto-checks
- Uncheck parent โ Children keep their state
- Uncheck any child โ Parent auto-unchecks
cd "TodoApp w\backend"
.\venv\Scripts\Activate.ps1
pytest tests/ -v52 tests, 100% pass rate, 86% coverage
| Category | Tests | Coverage |
|---|---|---|
| Authentication | 5 tests | Register, login, sessions |
| Todo Lists | 10 tests | CRUD + duplicate validation |
| Tasks | 15 tests | CRUD, toggle, collapse, move |
| Business Logic | 13 tests | Cascading, nesting, depth limits |
| Duplicates | 8 tests | Name validation across contexts |
# With coverage report
pytest tests/ --cov=app --cov=models --cov-report=htmlโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ React Frontend (localhost:3000) โ
โ Components: Login, Dashboard, ListView, โ
โ TaskItem (recursive), AuthContext โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTP/JSON REST API
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Flask Backend (localhost:5000) โ
โ Routes: /api/auth/*, /api/lists/*, โ
โ /api/tasks/* (15 endpoints) โ
โ Middleware: CORS, Sessions, Auth โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SQLAlchemy ORM
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SQLite Database (todoapp.db) โ
โ Tables: users, todo_lists, tasks โ
โ Relationships: UserโLists(1:N), โ
โ ListโTasks(1:N), TaskโSubtasks(1:N) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Self-referential Tasks -
parent_idforeign key enables unlimited nesting - Recursive Components - TaskItem renders itself for subtask trees
- Cascade Logic - Helper functions traverse tree up/down on completion
- Session Auth - HTTP-only cookies with server-side validation
- React Portals - Dropdowns render outside hierarchy for proper z-index
| Requirement | Status | Implementation |
|---|---|---|
| Multi-user support | โ | Session auth with user isolation |
| User authentication | โ | Register/login with password hashing |
| Task completion | โ | Toggle with smart cascading |
| Hierarchical tasks | โ Enhanced | 5 levels (Extension 1) vs MVP's 3 |
| Collapse/expand | โ | Persistent state in database |
| Move tasks | โ | Top-level tasks with all descendants |
| Persistent storage | โ | SQLite with SQLAlchemy ORM |
โ Extension 1: Enhanced Hierarchy
- 5 levels of nesting instead of MVP's 3 levels
get_depth()method enforces limit- Color-coded borders for visual hierarchy
- Backend validation prevents Level 6+
โ Extension 3: Unit Testing
- 52 tests with 100% pass rate
- 86% code coverage (models: 96%, app: 83%)
- Fixtures for test isolation
- Comprehensive edge case validation
- Password Hashing - Werkzeug pbkdf2:sha256 with 260k iterations
- Session Management - HTTP-only cookies with secret key signing
- SQL Injection Prevention - SQLAlchemy ORM with parameterized queries
- XSS Prevention - React auto-escapes all user content
- Authorization - Every endpoint verifies user ownership
- CORS - Restricted to localhost:3000 in development
Port 5000 in use:
# Windows
netstat -ano | findstr :5000
taskkill /PID <PID> /FModule not found:
cd backend
.\venv\Scripts\Activate.ps1
pip install -r requirements.txtDatabase locked:
# Stop Flask, delete instance/todoapp.db, restart FlaskCannot connect to backend:
- Verify Flask running on http://localhost:5000
- Check
axios.defaults.withCredentials = truein api.js - Confirm CORS enabled in app.py
TodoApp w/
โโโ backend/
โ โโโ app.py # Flask API (763 lines, 15 routes)
โ โโโ models.py # Database models (298 lines)
โ โโโ requirements.txt # Python dependencies
โ โโโ tests/ # 52 unit tests
โ โ โโโ test_auth.py
โ โ โโโ test_lists.py
โ โ โโโ test_tasks.py
โ โ โโโ test_business_logic.py
โ โ โโโ test_duplicates.py
โ โโโ instance/ # Database (auto-created)
โ โ โโโ .gitkeep # Ensures folder exists in git
โ โโโ venv/ # Python virtual env (gitignored)
โ
โโโ frontend/
โ โโโ src/
โ โ โโโ components/
โ โ โ โโโ Auth/ # Login & Register
โ โ โ โโโ Dashboard/ # Lists overview
โ โ โ โโโ TodoList/ # ListView component
โ โ โ โโโ Task/ # TaskItem (recursive, 919 lines)
โ โ โโโ context/
โ โ โ โโโ AuthContext.jsx # Global auth state
โ โ โโโ services/
โ โ โ โโโ api.js # Axios API client
โ โ โโโ App.js # React Router setup
โ โ โโโ index.css # Cyberpunk theme (1100+ lines)
โ โโโ package.json
โ โโโ node_modules/ # Node packages (gitignored)
โ
โโโ README.md # This file
โโโ SETUP.md # Quick start guide
This project was built iteratively over several phases:
- Backend Foundation - Flask API with authentication and database models
- Frontend Setup - React components with routing and state management
- Core Features - Task CRUD, nesting, completion logic
- Smart Cascading - Upward and downward completion propagation
- UI Polish - Cyberpunk theme, inline editing, React Portals
- Testing - Comprehensive pytest suite with 86% coverage
- Refinements - Duplicate validation, "Create & Move" feature, bug fixes
I used AI assistance (GitHub Copilot, specifically Claude sonnet 4 and 4.5 alternatively) as a collaborative tool while maintaining full understanding of the code. I made sure I know what is being done, not just sendign the assignment and askign for it to be made. I also made sure that I can have the features that if I'm offered a TODO list as a user, I'd be happy to have these. I asked for it to be dark themed as it's much better forr my eyes than ligh versions. I made sure to cover all edge cases, there might be more but I made sure that whatever I can think of is handled in a good way.
๐ Thank you for checking out this project!