A robust, full-stack Todo application built with a modern FastAPI backend and a sleek React frontend. Designed for performance, scalability, and developer experience.
Built with FastAPI, following a layered architecture (Controllers, Services, Repositories) for maintainability.
- Framework: FastAPI (High performance, easy to learn, fast to code, ready for production)
- Database: PostgreSQL with SQLAlchemy ORM
- Migrations: Alembic
- Authentication: JWT (JSON Web Tokens)
- Validation: Pydantic v2
- Testing: Pytest
Built with React and Vite for a lightning-fast development experience.
- Framework: React 19
- Build Tool: Vite
- Styling: TailwindCSS v4
- Language: TypeScript
- HTTP Client: Axios
- Docker & Docker Compose (Recommended)
- Node.js 22+ (For local frontend dev)
- Python 3.11+ (For local backend dev)
The easiest way to run the entire stack.
-
Clone the repository
git clone <repo-url> cd todo-fastapi
-
Start the application
docker compose up --build -d
This will start:
- Backend API at
http://localhost:8000 - Frontend App at
http://localhost:3000 - PostgreSQL Database
🧪 Automated Testing: The backend automatically runs all 31 tests on startup to ensure everything is working correctly. You can watch the test results with:
docker compose logs backend -f
- Backend API at
-
Access the App
- Frontend: http://localhost:3000
- API Docs (Swagger): http://localhost:8000/docs
- API Docs (ReDoc): http://localhost:8000/redoc
- Navigate to the backend directory:
cd backend - Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Run migrations (ensure DB is running via Docker or locally):
export POSTGRES_HOST=localhost alembic upgrade head - Start the server:
python -m app.main
- Navigate to the frontend directory:
cd frontend - Install dependencies:
npm install
- Start the dev server:
npm run dev
The backend follows a well-documented, Laravel-inspired architecture. Comprehensive documentation covering all aspects of the backend implementation can be found in the backend/docs directory.
This documentation includes:
| Topic | Description | Link |
|---|---|---|
| Database Access | How to use the DB helper, sessions, and transaction management. | 📖 Read Docs |
| Authentication | JWT implementation, user sessions, and security best practices. | 📖 Read Docs |
| Migrations | Managing database schema changes with Alembic. | 📖 Read Docs |
| Testing | How to write and run tests with Pytest, including fixtures and best practices. | 📖 Read Docs |
| Management | CLI commands for common tasks like generating controllers and models. | 📖 Read Docs |
💡 Tip: Start with the Database Access and Authentication docs to understand the core patterns used throughout the application.
# Run migrations
docker compose exec backend alembic upgrade head
# Create a new migration
docker compose exec backend alembic revision --autogenerate -m "message"
# Open Python Shell
docker compose exec backend python
# Run Tests
docker compose exec backend pytestEnsure you have activated your virtual environment (source backend/venv/bin/activate)
# Run migrations
alembic upgrade head
# Create a new migration
alembic revision --autogenerate -m "message"
# Run App
python -m app.maintodo-fastapi/
├── backend/ # FastAPI Application
│ ├── alembic/ # Migration scripts
│ ├── app/
│ │ ├── controllers/ # Request handlers
│ │ ├── models/ # SQLAlchemy models
│ │ ├── routers/ # API Routes
│ │ ├── services/ # Business logic
│ │ └── ...
│ ├── docs/ # Detailed documentation
│ └── tests/ # Pytest tests
├── frontend/ # React Application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Application pages
│ │ └── ...
├── docker-compose.yml # Docker services config
└── README.md # This file
- Full Authentication: Sign up, Login, Logout with JWT.
- Task Management: Create, Read, Update, Delete (CRUD) tasks.
- Filtering & Search: Filter by status, priority, and search text.
- Responsive Design: Beautiful UI that works on desktop and mobile.
- Dark/Light Mode: (Coming soon)
- Drag & Drop: Reorder tasks easily.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
