A modern, full-featured todo list application built with FastAPI and Databricks Lakebase integration. Features a beautiful, responsive UI with real-time task management.
- FastAPI: High-performance web framework for building APIs
- Uvicorn: ASGI server for running the FastAPI application
- Python-dotenv: Environment variable management
- Databricks SDK: Integration with Databricks services and Lakebase
- PostgreSQL: Database backend via psycopg2
- HTML5/CSS3: Modern, responsive frontend design
- Create Tasks: Add new todo items with title and description
- Mark Complete: Toggle task completion status with checkboxes
- Edit Tasks: Click any task to open detailed editing modal
- Delete Tasks: Remove tasks permanently
- Tab Navigation: Switch between "Active Tasks" and "All Tasks" views
- Beautiful Design: Modern gradient background with clean card-based layout
- Responsive: Works perfectly on desktop, tablet, and mobile
- Real-time Updates: Instant UI updates without page refreshes
- Loading States: Visual feedback during API operations
- Error Handling: User-friendly error messages and recovery
- Schema Isolation: User-specific database schemas based on email
- Email Derivation: Automatic schema creation from user identity
- Input Validation: Client and server-side validation
- XSS Protection: HTML escaping for user-generated content
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
- Copy
example.envto.env - Fill in your actual Databricks credentials:
DATABRICKS_HOSTDATABRICKS_CLIENT_IDDATABRICKS_CLIENT_SECRETLAKEBASE_INSTANCE_NAMELAKEBASE_DB_NAMEMY_EMAIL(your email for schema derivation)
- Copy
-
Run the application:
python app.py
-
Open your browser to
http://localhost:8000
POST /api/todos- Create a new todo itemGET /api/todos- List todo items (with optionalinclude_completedparameter)GET /api/todos/{id}- Get a specific todo itemPUT /api/todos/{id}- Update a todo itemPUT /api/todos/{id}/status- Change todo statusDELETE /api/todos/{id}- Delete a todo item
GET /health- Health check endpoint
The app automatically creates user-specific database schemas based on email addresses:
- Email:
john.doe@company.com→ Schema:john_doe - Tables are created as
{schema}.vibe_coding_lists
- Singleton Pattern: Efficient connection pooling with automatic token refresh
- OAuth Integration: Seamless Databricks authentication
- Token Refresh: Automatic renewal every 59 minutes
- Connection Pooling: Optimized database connections
CREATE TABLE IF NOT EXISTS vibe_coding_lists (
id serial primary key,
user_email TEXT NOT NULL,
title TEXT NOT NULL,
description TEXT,
status TEXT NOT NULL DEFAULT 'pending',
created_at TIMESTAMP NOT NULL DEFAULT now(),
updated_at TIMESTAMP NOT NULL DEFAULT now()
);