A modern full-stack Todo application built with React (frontend), FastAPI (backend), and PostgreSQL (database).
- User Authentication: Sign up, log in, and log out securely
- Todo Management: Create, read, update, and delete your todos
- User-specific Data: Todos are private and tied to your account
- Timestamps: Each todo shows its creation time
- Modern UI: Beautiful, responsive, and intuitive interface
- Error Handling: Friendly error messages and robust backend validation
todo/
├── backend/ # FastAPI backend
│ ├── auth.py # Authentication routes and logic
│ ├── config.py # Loads environment variables
│ ├── database.py # PostgreSQL connection
│ ├── greet.py # Greeting routes
│ ├── main.py # FastAPI app entrypoint
│ ├── todos.py # Todo CRUD operations
│ ├── utils.py # Utility functions
│ ├── requirements.txt # Python dependencies
│ └── .env # Environment variables (not committed)
├── frontend/ # React frontend
│ ├── public/ # Static files
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── App.jsx # Main App component
│ │ └── index.js # Entry point
├── .vscode/ # VS Code tasks
├── start_servers.bat # Batch script to start both servers
└── README.md # This file
cd backend- Create a
.envfile with your PostgreSQL credentials (see.env.exampleif provided) - Install dependencies:
pip install -r requirements.txt - Run:
uvicorn main:app --reload
cd frontend- Install dependencies:
npm install - Start:
npm start
Store all sensitive info (DB credentials, secrets) in backend/.env (never commit this file).
- Deploy backend (FastAPI) to Render, Railway, or Fly.io
- Deploy frontend (React) to Vercel or Netlify
- Set frontend API URLs to your deployed backend
This project is licensed under the MIT License.
CREATE TABLE auth (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user VARCHAR(60),
email VARCHAR(30) UNIQUE,
password VARCHAR(60)
);CREATE TABLE todo (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title VARCHAR(30),
descr VARCHAR(60),
status VARCHAR(30)
);- Sign Up: Create a new account with username, email, and password
- Log In: Access your account using email and password
- Add Todos: Fill out the form with title, description, and status
- View Todos: See all your todos listed on the main page
- Update Todos: Edit existing todos (feature available)
- Delete Todos: Remove todos you no longer need
- Import errors: Make sure you're running the server from the
backenddirectory - Database errors: The SQLite database is automatically created on first run
- Port conflicts: The backend uses port 8000 by default
- npm start fails: Make sure you're in the
frontenddirectory and runnpm installfirst - API connection errors: Ensure the backend server is running on port 8000
- CORS errors: The backend is configured to allow requests from
localhost:3000
- Restart both servers if you encounter issues
- Check that both servers are running on their respective ports
- Clear browser cache if you see old error messages
- Check console logs in browser developer tools for detailed error information
- Make changes to backend code (Python files)
- The simple server will need to be restarted manually
- Make changes to frontend code (React/JavaScript files)
- The React development server will auto-reload
- Test your changes in the browser
The application comes with sample todos:
- "class_start" - "class starts at 5:30PM" (status: open)
- "class_end" - "class ends at 7:30PM" (status: open)
Feel free to fork this project and submit pull requests for any improvements.
This project is open source and available under the MIT License.
Built as a learning project demonstrating full-stack web development with React and Python.
Happy Coding! 🚀