A full-stack recipe management application with a FastAPI backend and React TypeScript frontend.
- 📝 Create, read, update, and delete recipes
- 🔍 Search recipes by title, description, or cuisine
- 🏷️ Filter recipes by cuisine type
- 📱 Responsive design for mobile and desktop
- 🎨 Modern UI with smooth animations
Backend:
- FastAPI (Python web framework)
- SQLAlchemy (ORM)
- SQLite (Database)
- Pydantic (Data validation)
Frontend:
- React with TypeScript
- Axios (HTTP client)
- CSS Grid & Flexbox
- Responsive design
coder-demo/
├── backend/
│ ├── main.py # FastAPI app and routes
│ ├── models.py # Database models and Pydantic schemas
│ ├── database.py # Database connection and CRUD operations
│ ├── seed_data.py # Sample data for testing
│ ├── start.sh # Backend startup script
│ └── recipes.db # SQLite database (created automatically)
└── frontend/
├── src/
│ ├── components/ # React components
│ ├── types/ # TypeScript interfaces
│ ├── api/ # API client functions
│ └── App.tsx # Main app component
└── public/ # Static assets
- Python 3.8+
- Node.js 16+
- npm or yarn
-
Navigate to the backend directory:
cd backend
-
Start the backend server:
./start.sh
For devcontainer/codespace environments, use:
./start_simple.sh
Or set up manually:
python3 -m venv venv source venv/bin/activate # On Windows: venv\\Scripts\\activate pip install fastapi uvicorn sqlalchemy pydantic python-multipart python seed_data.py # Add sample data uvicorn main:app --reload --host 0.0.0.0 --port 8000
The API will be available at http://localhost:8000
- API documentation:
http://localhost:8000/docs
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Start the development server:
npm start
The app will open at http://localhost:3000
GET /
- Health checkGET /recipes/
- Get all recipesPOST /recipes/
- Create a new recipeGET /recipes/{id}
- Get a specific recipePUT /recipes/{id}
- Update a recipeDELETE /recipes/{id}
- Delete a recipeGET /recipes/search/
- Search recipes with query parameters
- View Recipes: The main page displays all recipes in a card layout
- Add Recipe: Click "Add New Recipe" to create a new recipe
- Search: Use the search bar to find recipes by title or description
- Filter: Select a cuisine type to filter recipes
- View Details: Click "View" on any recipe card to see full details
- Edit Recipe: Click "Edit" to modify a recipe
- Delete Recipe: Click "Delete" to remove a recipe (with confirmation)
The app comes with 5 sample recipes:
- Classic Spaghetti Carbonara (Italian)
- Chicken Tikka Masala (Indian)
- Chocolate Chip Cookies (American)
- Thai Green Curry (Thai)
- Caesar Salad (American)
- Backend runs on port 8000 with auto-reload enabled
- Frontend runs on port 3000 with hot reloading
- CORS is configured to allow frontend-backend communication
- User authentication and personal recipe collections
- Recipe ratings and reviews
- Image upload for recipes
- Recipe sharing and social features
- Advanced search with ingredients
- Meal planning and shopping lists
- Recipe import from URLs