A full-stack recipe sharing app with an AI-powered recipe assistant.
- Frontend: React + TypeScript + Vite + Redux Toolkit + React Query + MUI + Styled Components
- Backend: Node.js + Express + TypeScript + MongoDB (Mongoose) + JWT
- AI: Google Gemini 2.5 Flash
- Storage: Cloudinary (recipe images), MongoDB (data)
- Monorepo: npm workspaces (
client,server,shared)
- Browse, search, and filter recipes by category
- Create, edit, and delete recipes with image upload
- Like/unlike recipes
- User profiles
- AI recipe assistant (chat-based, Gemini-powered)
racipe_shering/
├── client/ # React frontend (Vite)
├── server/ # Express API
└── shared/ # Shared TypeScript types
- Node.js 18+
- MongoDB instance (local or Atlas)
- Cloudinary account
- Google Gemini API key
server/.env (copy from server/.env.example):
PORT=5000
CLIENT_URL=http://localhost:5173
MONGODB_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
GEMINI_API_KEY=your_gemini_api_key
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_key
CLOUDINARY_API_SECRET=your_cloudinary_secret
client/.env.local (copy from client/.env.example):
VITE_API_URL=http://localhost:5000/api
npm install
npm run devThis starts the server on port 5000 and the client on port 5173.
npm run build| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /api/auth/register | - | Register |
| POST | /api/auth/login | - | Login |
| POST | /api/auth/logout | - | Logout |
| GET | /api/auth/me | yes | Current user |
| GET | /api/recipes | - | List recipes (filter by category, author; paginate with page/limit) |
| GET | /api/recipes/:id | - | Get recipe |
| POST | /api/recipes | yes | Create recipe |
| PUT | /api/recipes/:id | yes (owner) | Update recipe |
| DELETE | /api/recipes/:id | yes (owner) | Delete recipe |
| POST | /api/recipes/:id/like | yes | Toggle like |
| GET | /api/recipes/me/likes | yes | My liked recipes |
| POST | /api/upload/image | yes | Upload image to Cloudinary |
| POST | /api/ai/chat | yes | Chat with recipe assistant |
- Client: Vercel (configured in
client/vercel.json) - Server: Railway (set
RAILWAY_URLin client.env.production) - Auth uses httpOnly cookies — ensure
CLIENT_URLandsameSite: 'none'are correct for cross-origin production.