An enterprise-grade, full-stack Task Management application featuring a high-performance FastAPI REST API, a cloud-hosted PostgreSQL database (via Neon.tech), database migrations powered by Alembic, robust JWT Authentication, and an interactive Streamlit dashboard with live analytics and Light/Dark themes.
| Component | Service | Live URL |
|---|---|---|
| Frontend Application | Streamlit Community Cloud | π todolistfastapi000x11.streamlit.app |
| Backend API (Swagger UI) | Render Web Service | π todo-list-vc31.onrender.com/docs |
| API ReDoc | Render Web Service | π todo-list-vc31.onrender.com/redoc |
| Database | Neon Cloud PostgreSQL | Serverless AWS PostgreSQL Cluster |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Streamlit Web Frontend β
β (https://todolistfastapi000x11.streamlit.app) β
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β HTTPS / JSON Payloads
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FastAPI Backend Server β
β (https://todo-list-vc31.onrender.com) β
β β
β β’ /auth (OAuth2 + JWT) β’ /todos (Task CRUD) β
β β’ /user (Profile & Settings) β’ /admin (Admin Controls) β
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β SQLAlchemy 2.0 (psycopg2)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Neon Serverless PostgreSQL Database β
β β’ users table β’ todos table β
β β’ alembic_version (Schema Tracking) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- OAuth2 Password Bearer Flow with cryptographically secure JSON Web Tokens (JWT).
- Password Hashing via
passlib[bcrypt]with salted rounds. - Client & Server-Side Field Validation:
- Password Strength: Minimum 8 characters, at least 1 uppercase, 1 lowercase, 1 digit, and 1 special symbol.
- Email Hygiene: Automatic lowercasing and regex domain validation.
- Indian Phone Number Validation: Validates 10-digit mobile numbers with prefix normalization (
+91or leading0).
- Full CRUD operations: Create, Read, Update (inline status, priority, description), and Delete.
- Live Metric Dashboards: Completed tasks counter, progress percentage bar, and priority distribution bar charts using Altair and Pandas.
- Interactive Controls: Instant search, status filtering (All / Pending / Completed), and multi-criteria sorting (Priority, Title, Date).
- User Directory: View registered users with active/inactive statuses, contact metadata, and total task tallies.
- Global Task Monitor: View and manage all tasks created across the platform with owner attribution (
by @username). - Migration Dashboard: Inspect current Alembic database revision identifiers directly from the UI.
- Built-in Light and Dark theme engine with dynamic CSS styling.
- Responsive, clean layout designed for desktop and mobile views.
TodoApp/
βββ .env.example # Environment variables template
βββ .gitignore # Production-grade Git ignore configuration
βββ alembic.ini # Database migration configuration
βββ database.py # SQLAlchemy engine & session maker
βββ init_db.py # Raw SQL database initialization script
βββ main.py # FastAPI application root & CORS middleware
βββ models.py # SQLAlchemy ORM models (User, Todos)
βββ requirements.txt # Pinned Python package dependencies
βββ alembic/ # Database schema versioning
β βββ env.py # Dynamic .env database connector
β βββ versions/ # Schema migration history
βββ routers/ # FastAPI endpoint modular routers
β βββ __init__.py
β βββ admin.py # Admin metrics & migration endpoints
β βββ auth.py # User registration & JWT authentication
β βββ todos.py # Task CRUD operations
β βββ users.py # Profile management & password updates
βββ frontend/ # Streamlit application
βββ app.py # Main multi-view application entry point
βββ config.py # API endpoints & priority configuration
βββ theme.py # Dynamic Light/Dark styling engine
βββ components.py # Reusable UI cards, badges & elements
βββ validators.py # Client-side input validators
βββ api_client.py # REST API HTTP client layer
βββ views/ # Modular view components
βββ auth.py # Login & registration interface
βββ dashboard.py # Main task management board
βββ profile.py # Account details & contact updater
βββ password.py # Password change form
βββ admin.py # Admin panel & migrations view
| Method | Endpoint | Description | Access |
|---|---|---|---|
POST |
/auth/ |
Register a new user account | Public |
POST |
/auth/token |
Authenticate user & obtain JWT token | Public |
GET |
/auth/me |
Fetch authenticated user profile | User |
GET |
/todos/ |
Retrieve all tasks for current user | User |
POST |
/todos/todo |
Create a new task | User |
PUT |
/todos/todo/{id} |
Update task details or toggle complete | User |
DELETE |
/todos/todo/{id} |
Delete a task by ID | User |
GET |
/user/ |
Retrieve account info | User |
PUT |
/user/password |
Change user password | User |
PUT |
/user/phonenumber/{phone} |
Update registered phone number | User |
GET |
/admin/todo |
Fetch all tasks across all users | Admin |
GET |
/admin/todos |
Fetch all tasks with owner username | Admin |
GET |
/admin/migrations |
Inspect current Alembic schema revision | Admin |
DELETE |
/admin/todo/{id} |
Force delete any task by ID | Admin |
- Python 3.10+
- PostgreSQL (local instance or cloud database like Neon)
git clone https://github.com/krohitrkumar/Todo_list.git
cd Todo_list# Windows
python -m venv .venv
.venv\Scripts\activate
# macOS / Linux
python3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root (refer to .env.example):
# Cloud Database (Neon.tech) or Local PostgreSQL
DATABASE_URL=postgresql://user:password@host:5432/dbname?sslmode=require
# JWT Authentication
SECRET_KEY=your_super_secret_jwt_key_here
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30# Option A: Apply Alembic migrations
alembic upgrade head
# Option B: Run direct initialization script
python init_db.pyStart the FastAPI Backend:
uvicorn main:app --reload --port 8000- Interactive API Docs (Swagger): http://127.0.0.1:8000/docs
Start the Streamlit Frontend:
streamlit run frontend/app.py- Web Application: http://localhost:8501
- Create a new Web Service on Render connected to this repository.
- Set Build Command:
pip install -r requirements.txt && alembic upgrade head - Set Start Command:
uvicorn main:app --host 0.0.0.0 --port $PORT - Add environment variables:
DATABASE_URL,SECRET_KEY,ALGORITHM.
- Create a new app on Streamlit Community Cloud.
- Set Repository:
krohitrkumar/Todo_list - Set Main file path:
frontend/app.py - Under Secrets, specify your backend URL:
API_BASE = "https://todo-list-vc31.onrender.com"
Rohit Kumar
- GitHub: @krohitrkumar
- Repository: krohitrkumar/Todo_list
This project is licensed under the MIT License β see the LICENSE file for details.