Skip to content

Latest commit

Β 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“‹ TaskFlow β€” Full-Stack Task & Todo Management Platform

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.

FastAPI Python PostgreSQL Streamlit Render Neon License: MIT


🌐 Live Production Deployments

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

πŸ›οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 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)           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

✨ Key Features

πŸ” Authentication & Data Validation

  • 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 (+91 or leading 0).

πŸ“Š Task Management & Real-time Analytics

  • 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).

πŸ›‘οΈ Role-Based Admin Panel

  • 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.

🎨 Intuitive User Experience

  • Built-in Light and Dark theme engine with dynamic CSS styling.
  • Responsive, clean layout designed for desktop and mobile views.

πŸ“ Repository Structure

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

πŸ“‘ REST API Reference

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

πŸ’» Local Development Setup

1. Prerequisites

  • Python 3.10+
  • PostgreSQL (local instance or cloud database like Neon)

2. Clone the Repository

git clone https://github.com/krohitrkumar/Todo_list.git
cd Todo_list

3. Create & Activate a Virtual Environment

# Windows
python -m venv .venv
.venv\Scripts\activate

# macOS / Linux
python3 -m venv .venv
source .venv/bin/activate

4. Install Dependencies

pip install -r requirements.txt

5. Configure Environment Variables

Create 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

6. Run Database Setup

# Option A: Apply Alembic migrations
alembic upgrade head

# Option B: Run direct initialization script
python init_db.py

7. Launch the Application

Start the FastAPI Backend:

uvicorn main:app --reload --port 8000

Start the Streamlit Frontend:

streamlit run frontend/app.py

🚒 Deployment Guide

Deploy Backend to Render

  1. Create a new Web Service on Render connected to this repository.
  2. Set Build Command: pip install -r requirements.txt && alembic upgrade head
  3. Set Start Command: uvicorn main:app --host 0.0.0.0 --port $PORT
  4. Add environment variables: DATABASE_URL, SECRET_KEY, ALGORITHM.

Deploy Frontend to Streamlit Cloud

  1. Create a new app on Streamlit Community Cloud.
  2. Set Repository: krohitrkumar/Todo_list
  3. Set Main file path: frontend/app.py
  4. Under Secrets, specify your backend URL:
    API_BASE = "https://todo-list-vc31.onrender.com"

πŸ‘¨β€πŸ’» Author

Rohit Kumar


πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages