A full-stack web application built with FastAPI and Python, featuring an advanced dashboard with a calendar view, email reminders, and user profile management. Designed for serverless deployment on Vercel.
- π User Authentication: Secure Signup & Login using JWT (JSON Web Tokens) and Bcrypt password hashing.
- β Full CRUD for Tasks: Create, Read, Update, and Delete tasks.
- π Dashboard: Real-time statistics showing total, completed, and pending tasks.
- π
Calendar Task View: A monthly calendar that visualizes tasks.
- π’ Green dot for days with tasks.
- π΅ Blue highlight for the current day.
- π΄ Red dot for past days with incomplete tasks.
- β° Optional Time Scheduling: Assign specific start and end times to tasks.
- π§ Automatic Email Reminders: If a scheduled task is not completed by its end time, the system automatically sends a reminder email (requires a Cron Job).
- ποΈ Reschedule Past Tasks: Easily move incomplete tasks from past days to today with a single click.
- π€ User Profile Management: Users can view and update their username, email, and password.
- β‘ Hybrid Background Service: Automatically switches between
asynciobackground loops (Localhost) and Cron Jobs (Vercel) to ensure reliable notifications.
- Backend: Python 3.9+, FastAPI, SQLAlchemy, Pydantic
- Frontend: HTML5, JavaScript (Fetch API), Bootstrap 5
- Database: SQLite (Local), PostgreSQL (Production/Vercel)
- Emailing:
smtplibfor sending email notifications via Gmail/SMTP. - Security: OAuth2, JWT, Passlib (Bcrypt)
todo-python-vercel/
β
βββ api/ # Backend entry point
β βββ index.py
β
βββ database/ # Database connections
β βββ auth_db.py
β βββ todo_db.py
β
βββ models/ # SQLAlchemy & Pydantic models
β βββ user_model.py
β βββ todo_model.py
β
βββ services/
β βββ email_service.py # Logic for sending emails
β
βββ routes/ # API Endpoints
β βββ auth_routes.py
β βββ todo_routes.py
β βββ user_routes.py # /user/profile
β
βββ utils/ # Helper functions
β βββ security.py # Hashing & JWT logic
β
βββ frontend/ # Static UI files
β βββ index.html
β βββ login.html
β βββ signup.html
β βββ dashboard.html
β βββ profile.html
β βββ calendar.js
β
βββ fix_db.py
βββ requirements.txt # Python dependencies
βββ vercel.json # Vercel configuration
Follow these steps to run the project locally.
git clone https://github.com/bikram73/Smart_ToDo_List_Manager.git
cd smart-todo-list# Windows
python -m venv venv
.\venv\Scripts\activate
# Mac/Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtpython -m uvicorn api.index:app --reloadOpen your browser and go to: π http://127.0.0.1:8000
By default, the app uses SQLite for local development. To use PostgreSQL, set the following environment variables:
| Variable | Description |
|---|---|
AUTH_DATABASE_URL |
Connection string for User DB (e.g., postgresql://user:pass@host/auth_db) |
TODO_DATABASE_URL |
Connection string for Todo DB (e.g., postgresql://user:pass@host/todo_db) |
JWT_SECRET |
Secret key for signing tokens (default: supersecretkey) |
EMAIL_USER |
Gmail/SMTP username for sending reminders |
EMAIL_PASS |
Gmail/SMTP App Password |
POST /api/signup- Register a new userPOST /api/login- Login and receive JWT token
GET /api/todos- Get all tasks for logged-in userPOST /api/todos- Create a new taskPUT /api/todos/{id}- Update task detailsPATCH /api/todos/{id}/complete- Mark task as completedDELETE /api/todos/{id}- Delete a task
- Push to GitHub: Upload your code to a GitHub repository.
- Import to Vercel: Go to Vercel and import the repo.
- Configure Environment:
- Add
AUTH_DATABASE_URLandTODO_DATABASE_URL(use Neon or Supabase for free PostgreSQL). - Add
JWT_SECRET. - Add
EMAIL_USERandEMAIL_PASSfor email reminders. - Add
CRON_SECRET(Generate a random password, e.g.,my-secure-cron-password-12345).
- Add
- Deploy: Click deploy! Vercel will handle the serverless backend.
Option A: Vercel Pro (Paid)
- The included
vercel.jsonis configured to run daily. For minute-by-minute updates, you need the Pro plan.
Option B: External Cron (Free - Recommended)
- Create a free account on cron-job.org.
- Create a new Cron Job with URL:
https://smart-to-do-list-manager.vercel.app/api/cron/reminders - Set Schedule to Every 1 Minute.
- Security Configuration (Crucial):
- Look for the Headers section (do NOT use "Requires HTTP authentication").
- Click Add Header (or the
+button). - Key:
Authorization - Value:
Bearer <YOUR_CRON_SECRET>(e.g.,Bearer my-secure-cron-password-12345).
This project is licensed under the MIT License.
Designed & Built by ππ»π π π π ‘π π ππ»