Skip to content

CodeV23/ToDoApp

Repository files navigation


📝 ToDo Application

Python FastAPI SQLAlchemy Alembic PostgreSQL

A full-stack Todo tracking app built with FastAPI + PostgreSQL + Jinja2. Supports authentication, CRUD for tasks, and priority/complete tracking.


Features

✅ User authentication (login / register / logout) ✅ Create, edit, update and delete tasks ✅ Mark tasks as complete with strike-through ✅ Priority levels (1–5) ✅ PostgreSQL + Alembic migrations ✅ Bootstrap-powered frontend


⚡ Tech Stack

  • Backend: FastAPI, SQLAlchemy, Alembic
  • Database: PostgreSQL
  • Frontend: Jinja2 + Bootstrap
  • Auth: OAuth2 password flow

📦 Installation

1️⃣ Clone the repo

git clone https://github.com/your-username/todoapp.git
cd todoapp

2️⃣ Create & activate a virtual environment

python -m venv venv
source venv/bin/activate   # Linux/Mac
venv\Scripts\activate      # Windows

3️⃣ Install dependencies

pip install -r requirements.txt

4️⃣ Configure the database

In database.py, update the connection string with your postgres password:

POSTGRESQL_DATABASE_URL="postgresql://postgres:{your_password_here}@localhost/ToDoApplicationDatabase"

Run migrations:

alembic upgrade head

If you want to generate a new migration:

alembic revision --autogenerate -m "message"
alembic upgrade head

For rolling back database migrations:

alembic downgrade -1

5️⃣ Start the app

uvicorn main:app --reload

App runs at 👉 http://127.0.0.1:8000


📂 Project Structure

TODOAPP/
│── alembic/              # Alembic migration files to safely change database structure without deleting the database
│── routers/              # API routes, including user, admin, authentication and todo related functionality
│── static/               # CSS/JS/Assets. NOTE that frontend was not the focus of this project, so a lot is downloaded here
│── templates/            # HTML Jinja templates for the webpages and the navbar
│── test/                 # Tests using the pytest library, including an example file covering basic uses of pytest
│── database.py           # DB connection setup
│── models.py             # SQLAlchemy models for the users and todos tables
│── main.py               # FastAPI entrypoint
│── alembic.ini           # Alembic config
│── requirements.txt      
│── .gitignore
│── README.md

🚀 Roadmap

  • Research deployment on Render (or similar cloud services)
  • Improve frontend design for a more polished UI/UX (Bootstrap or React)

About

A simple ToDo App utilising FastAPI, CSS, Jinja, Alembic, and PostgreSQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published