( Web development course - My picked final project )
Welcome to HomeChef, a full-stack, component-driven social network for recipe sharing and smart ingredient matching!
Built with a robust FastAPI + PostgreSQL backend and a highly optimized React (Vite) + TailwindCSS frontend.
- Core: FastAPI (Python 3.11+) — high-performance, asynchronous, fully type-hinted
- Database: PostgreSQL managed through SQLAlchemy ORM
- Authentication: OAuth2 with JWT Bearer Tokens via specialized form-data flows
- Build Tool & Runtime: Vite + React 18
- Styling: TailwindCSS (modern, responsive custom UI)
- State Management: Global
AuthContextto eliminate deep prop drilling - Service Layer Isolation: All API interactions are abstracted into
/services/recipeService.js - Component Structure: Modular, reusable architecture (
RecipeCard,Navbar, etc.)
Following strict decoupled architecture principles:
src/
├── components/ # Reusable UI elements (Navbar, RecipeCard, etc.)
├── context/ # Global state wrappers (AuthContext for sessions & sign out)
├── pages/ # Independent pages (Home, CreateRecipe, etc.)
├── services/ # API layer wrapper (recipeService, interceptors)
├── App.jsx # Application root router
└── main.jsx # React mount entry point
Below are the core user-facing experiences available before admin or authentication restrictions apply.
The social hub of ChefHome.
- Aggregated feed of approved community recipes
- Powered by the reusable
RecipeCardcomponent - Smart navigation header with globally synchronized authentication state
Don't know what to cook? Just enter the ingredients you have.
- Ingredients are searched directly from the database
- Debounced typeahead search for fast and responsive suggestions
- Search and select ingredients
- Click 🚀 جستجوی غذاها بر اساس این مواد
- The application:
- Queries the service layer
- Runs a client-side matching algorithm
- Instantly displays compatible recipes
Missing an ingredient?
Use the built-in support prompt to notify the ادمین immediately.
Share your favorite recipes with the community.
To maintain database parsing integrity, the form includes intelligent validation.
If users separate ingredients using:
-/|
The application blocks submission and instructs them to use:
- Persian comma:
، - Standard comma:
,
This guarantees consistent ingredient parsing and matching.
A focused recipe reading experience.
- Dynamic route handling via
/recipe/:id - Step-by-step cooking instructions
- Preparation and cooking timers
- Ingredient breakdown and measurements
A restricted administrative dashboard providing complete content control.
Track:
- Total users
- Approved recipes
- Active ingredients
Add new ingredients directly into the database with category support via the:
💾 ثبت و ذخیره دیتابیس pipeline
Review and approve user-submitted recipes before publication to the public feed.
The application uses a centralized:
<AuthProvider>
<Router />
</AuthProvider>architecture.
- Users submit credentials through a
FormDatapayload - Authentication is handled by the
/tokenendpoint
Upon successful authentication:
- JWT tokens are stored securely
- User information is dispatched to
AuthContext - Dependent components (e.g.,
Navbar) update automatically
Signing out:
- Clears authentication variables
- Removes session storage safely
- Redirects users back to
/login - Prevents stale or empty-state rendering cycles
cd backend
python -m venv venv
# Linux / macOS
source venv/bin/activate
# Windows
venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000cd frontend
npm install
npm run devOpen your browser and navigate to the local Vite development server:
http://localhost:5173
Start exploring recipes and happy cooking! 🍽️



