Skip to content

bikram73/Smart-ToDo-List-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Smart To-Do List Manager (Advanced Dashboard)

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.


πŸš€ Features

Core Features

  • πŸ” 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.

Advanced Dashboard Features

  • πŸ“… 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 asyncio background loops (Localhost) and Cron Jobs (Vercel) to ensure reliable notifications.

πŸ› οΈ Tech Stack

  • Backend: Python 3.9+, FastAPI, SQLAlchemy, Pydantic
  • Frontend: HTML5, JavaScript (Fetch API), Bootstrap 5
  • Database: SQLite (Local), PostgreSQL (Production/Vercel)
  • Emailing: smtplib for sending email notifications via Gmail/SMTP.
  • Security: OAuth2, JWT, Passlib (Bcrypt)

πŸ“‚ Project Structure

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

⚑ Installation & Local Setup

Follow these steps to run the project locally.

1. Clone the Repository

git clone https://github.com/bikram73/Smart_ToDo_List_Manager.git
cd smart-todo-list

2. Create Virtual Environment

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

# Mac/Linux
python3 -m venv venv
source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Run the Application

python -m uvicorn api.index:app --reload

5. Access the App

Open your browser and go to: πŸ‘‰ http://127.0.0.1:8000


πŸ”‘ Environment Variables

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

πŸ“‘ API Endpoints

Authentication

  • POST /api/signup - Register a new user
  • POST /api/login - Login and receive JWT token

Todos

  • GET /api/todos - Get all tasks for logged-in user
  • POST /api/todos - Create a new task
  • PUT /api/todos/{id} - Update task details
  • PATCH /api/todos/{id}/complete - Mark task as completed
  • DELETE /api/todos/{id} - Delete a task

☁️ Deployment (Vercel)

  1. Push to GitHub: Upload your code to a GitHub repository.
  2. Import to Vercel: Go to Vercel and import the repo.
  3. Configure Environment:
    • Add AUTH_DATABASE_URL and TODO_DATABASE_URL (use Neon or Supabase for free PostgreSQL).
    • Add JWT_SECRET.
    • Add EMAIL_USER and EMAIL_PASS for email reminders.
    • Add CRON_SECRET (Generate a random password, e.g., my-secure-cron-password-12345).
  4. Deploy: Click deploy! Vercel will handle the serverless backend.

5. Set Up Automatic Reminders (Cron Job)

Option A: Vercel Pro (Paid)

  • The included vercel.json is configured to run daily. For minute-by-minute updates, you need the Pro plan.

Option B: External Cron (Free - Recommended)

  1. Create a free account on cron-job.org.
  2. Create a new Cron Job with URL: https://smart-to-do-list-manager.vercel.app/api/cron/reminders
  3. Set Schedule to Every 1 Minute.
  4. 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).

πŸ“„ License

This project is licensed under the MIT License.


Designed & Built by πŸ‘‰πŸ»πŸ…‘πŸ…˜πŸ…šπŸ…‘πŸ…πŸ…œπŸ‘ˆπŸ»

About

πŸ“ Smart To-Do List Manager is a feature-rich task management system with authentication, calendar-based dashboard, email reminders, and real-time stats, powered by FastAPI, PostgreSQL, and serverless deployment on Vercel.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors