Todo Fastmcp React
No description available
Ask AI about Todo Fastmcp React
Powered by Claude Β· Grounded in docs
I know everything about Todo Fastmcp React. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Todo App - FastAPI + React
A modern, full-stack todo application built with FastAPI (backend) and React + TypeScript (frontend). Features JWT authentication, persistent data storage, and a beautiful, responsive UI.
β¨ Features
Backend (FastAPI)
- JWT Authentication with secure password hashing
- SQLite Database for persistent data storage
- RESTful API with comprehensive CRUD operations
- Input Validation using Pydantic models
- CORS Support for frontend integration
- Modular Architecture with separate modules for auth, database, and models
- Environment Configuration with dotenv support
Frontend (React + TypeScript)
- Modern UI/UX with beautiful gradients and animations
- TypeScript for type safety and better development experience
- Component-based Architecture with reusable components
- Responsive Design that works on all devices
- Real-time Updates with optimistic UI updates
- Error Handling with user-friendly error messages
- Loading States for better user experience
- Priority Levels for todos (Low, Medium, High)
- Todo Descriptions for additional details
- Edit Mode for inline todo editing
π Quick Start
Prerequisites
- Python 3.8+
- Node.js 16+
- npm or yarn
Backend Setup
-
Navigate to backend directory:
cd backend -
Create virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install dependencies:
pip install -r requirements.txt -
Run the server:
uvicorn main:app --reload --host 0.0.0.0 --port 8000
The API will be available at http://localhost:8000
Frontend Setup
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install -
Start the development server:
npm start
The application will be available at http://localhost:3000
π Project Structure
fastapi_react/
βββ backend/
β βββ __init__.py
β βββ main.py # FastAPI application entry point
β βββ config.py # Configuration and environment variables
β βββ models.py # Pydantic data models
β βββ auth.py # Authentication utilities
β βββ database.py # Database operations
β βββ requirements.txt # Python dependencies
β βββ todos.db # SQLite database (created automatically)
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ AuthForm.tsx # Authentication form component
β β β βββ TodoForm.tsx # Todo creation form
β β β βββ TodoList.tsx # Todo list display
β β βββ api.ts # API service layer
β β βββ types.ts # TypeScript type definitions
β β βββ App.tsx # Main application component
β β βββ App.css # Styles
β βββ package.json
β βββ tsconfig.json
βββ README.md
π§ API Endpoints
Authentication
POST /register- Register a new userPOST /token- Login and get JWT token
Todos
GET /todos- Get all todos for authenticated userPOST /todos- Create a new todoGET /todos/{todo_id}- Get a specific todoPUT /todos/{todo_id}- Update a todoDELETE /todos/{todo_id}- Delete a todo
Health Check
GET /health- API health status
π¨ UI Features
Authentication
- Clean login/register form with validation
- Smooth transitions between auth modes
- Error handling with user-friendly messages
- Loading states during authentication
Todo Management
- Add Todos: Quick add with optional description and priority
- Edit Todos: Inline editing with form validation
- Toggle Completion: Click to mark as complete/incomplete
- Delete Todos: Remove todos with confirmation
- Priority Levels: Visual priority badges (Low, Medium, High)
- Progress Tracking: Shows completion percentage
User Experience
- Responsive Design: Works on desktop, tablet, and mobile
- Smooth Animations: Hover effects and transitions
- Loading States: Spinners during API calls
- Error Handling: Clear error messages with dismiss option
- Empty States: Helpful messages when no todos exist
π Security Features
- JWT Authentication with configurable expiration
- Password Hashing using bcrypt
- Input Validation on both frontend and backend
- CORS Protection with specific origins
- SQL Injection Prevention using parameterized queries
- Environment Variables for sensitive configuration
π οΈ Development
Backend Development
- Hot Reload: Server restarts automatically on code changes
- API Documentation: Available at
http://localhost:8000/docs - Type Safety: Full type hints and validation
- Modular Code: Easy to extend and maintain
Frontend Development
- TypeScript: Full type safety
- Component Architecture: Reusable, maintainable components
- API Service Layer: Centralized API communication
- Modern React: Hooks, functional components, and modern patterns
π Deployment
Backend Deployment
- Set environment variables in production
- Use a production WSGI server like Gunicorn
- Set up a proper database (PostgreSQL recommended for production)
- Configure CORS for your domain
Frontend Deployment
- Build the application:
npm run build - Serve the
buildfolder with a static file server - Configure API base URL for production
π€ Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
π License
This project is open source and available under the MIT License.
π Support
If you encounter any issues or have questions:
- Check the API documentation at
http://localhost:8000/docs - Review the browser console for frontend errors
- Check the server logs for backend errors
- Create an issue in the repository
Happy coding! π
