https://github.com/04bhavyaa/todoapp-fastapi-clean-architecture
A Todo app built with FastAPI, PostgreSQL, Docker, and Bootstrap 5, following Clean Architecture principles. Features JWT authentication, password strength validation, and a modern responsive frontend.
https://github.com/04bhavyaa/todoapp-fastapi-clean-architecture
backend bootstrap clean-architecture docker fastapi frontend fullstack jwt-authentication password-validation postgresql pytest python sqlachemy testing todo-app webapp
Last synced: 13 days ago
JSON representation
A Todo app built with FastAPI, PostgreSQL, Docker, and Bootstrap 5, following Clean Architecture principles. Features JWT authentication, password strength validation, and a modern responsive frontend.
- Host: GitHub
- URL: https://github.com/04bhavyaa/todoapp-fastapi-clean-architecture
- Owner: 04bhavyaa
- Created: 2025-09-05T16:18:06.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-09-05T17:54:50.000Z (8 months ago)
- Last Synced: 2025-09-05T19:36:56.545Z (8 months ago)
- Topics: backend, bootstrap, clean-architecture, docker, fastapi, frontend, fullstack, jwt-authentication, password-validation, postgresql, pytest, python, sqlachemy, testing, todo-app, webapp
- Language: Python
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Clean Architecture FastAPI Todo App
A full-stack Todo application built with FastAPI, PostgreSQL, Docker, and a modern Bootstrap frontend. The project follows Clean Architecture principles for maintainability and scalability.
## Tech Stack
- **Backend:** FastAPI, SQLAlchemy, Python 3.11+
- **Frontend:** HTML, CSS, JavaScript, Bootstrap 5, Font Awesome
- **Database:** PostgreSQL (Dockerized)
- **Auth:** JWT, bcrypt
- **Testing:** Pytest (unit & e2e), Docker Compose
- **DevOps:** Docker, Docker Compose
## Features
- User registration, login, and JWT authentication
- Secure password hashing and validation (with strength meter)
- Add, complete, and delete todos
- Password change with validation
- PostgreSQL database (Dockerized)
- Clean, modular backend structure
- Fully containerized with Docker Compose
- Frontend is served automatically by FastAPI (no separate static server needed)
- Comprehensive tests: unit and end-to-end tests in the `tests/` folder
## Project Structure
```
├── src/
│ ├── main.py # FastAPI app entrypoint
│ ├── api.py # API route registration
│ ├── entities/ # SQLAlchemy models (User, Todo)
│ ├── users/ # User logic (controller, service, model, validators)
│ ├── todos/ # Todo logic (controller, service, model)
│ ├── auth/ # Auth logic (JWT, password hashing)
│ ├── database/ # DB connection/core
│ ├── exceptions.py # Custom exceptions
│ ├── logging.py # Logging config
│ └── rate_limiting.py # (Optional) Rate limiting logic
├── frontend/
│ ├── index.html # Main UI
│ ├── app.js # Frontend logic
│ └── style.css # Custom styles
├── tests/
│ ├── conftest.py # Pytest fixtures
│ ├── test_auth_service.py
│ ├── test_todos_service.py
│ ├── test_users_service.py
│ └── e2e/ # End-to-end API tests
│ ├── test_auth_endpoints.py
│ ├── test_todo_endpoints.py
│ └── test_users_endpoints.py
├── requirements.txt
├── requirements-dev.txt
├── docker-compose.yml
├── Dockerfile
├── pyproject.toml
└── README.md
```
## Getting Started
### Prerequisites
- Docker & Docker Compose
- (Optional) Python 3.11+ for local dev
### Quick Start (Docker)
```sh
git clone https://github.com/04bhavyaa/todoapp-fastapi-clean-architecture.git
cd todoapp-fastapi-clean-architecture
docker compose up --build
```
- Visit [http://localhost:8000](http://localhost:8000) in your browser. The frontend is served automatically by FastAPI.
### Local Development
1. Create a virtual environment and install dependencies:
```sh
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txt
```
2. Start PostgreSQL (or use Docker Compose)
3. Run the FastAPI app:
```sh
uvicorn src.main:app --reload
```
4. Visit [http://localhost:8000](http://localhost:8000) — the frontend is served automatically.
5. (Additional) To run all tests:
```sh
pytest
```
## Usage
- Register a new user
- Login to get access to your todos
- Add, complete, and delete todos
- Change your password (with strength validation)
## Project Gallery
