Built with React + TypeScript (Vite) on the front end and Express + MongoDB on the backend. This repo contains a responsive UI, user authentication, cart/order flows, and Razorpay checkout integration.
Short summary: a small full-stack food ordering app demonstrating a production-like flow (auth, OTP, cart, create/verify payments).
- Frontend:
client/— React 18 + TypeScript, Vite, Tailwind (UI components live inclient/src/Components). - Backend:
server/— Express API with Mongoose models and controllers. - Monorepo scripts: root
package.jsonprovides adevscript to run both client and server concurrently.
- Node.js v16+ (recommended v18+)
- MongoDB (local or Atlas)
- A terminal (PowerShell on Windows works fine)
- Clone the repo
git clone https://github.com/Durgeshwar-AI/Food-App.git
cd Food-App- Install dependencies (root uses
concurrentlyto run both services)
npm install
cd client && npm install
cd ../server && npm install
cd ../- Run development servers
- Option A — run both client & server from root (recommended):
npm run dev- Option B — run individually in two terminals:
# Terminal A
cd server
npm run dev
# Terminal B
cd client
npm run devNotes:
- Root
npm run devusesconcurrently "cd client && npm run dev" "cd server && npm run dev". - Server
npm run devusesnodemon index.js;npm startrunsnode index.js.
Create a .env file for the server (in server/) with at least:
PORT— server port (e.g.,5000)MONGO_URI— MongoDB connection stringJWT_SECRET— secret for signing JWTsCORS_APPROVED— allowed origin (client URL)RAZORPAY_KEY_IDandRAZORPAY_SECRET— for payments (if used)- SMTP configuration for email OTPs (e.g.,
SMTP_HOST,SMTP_USER,SMTP_PASS)
Client-side envs (if needed) go in client/.env, e.g.:
VITE_API_URL— base API url (e.g.,http://localhost:5000/api)
Keep secrets out of source control.
- Root:
npm run dev— runs both client and server concurrently
- Client (
client/package.json):npm run dev— start Vite dev servernpm run build— build production bundlenpm run preview— preview built app
- Server (
server/package.json):npm run dev— start server withnodemonnpm start— run server withnode
- Food routes:
/api/food— get all, search, popular, add/update/delete (admin) - User routes:
/api/user— register, login, send-otp, verify-otp, refresh token, update profile - Cart routes:
/api/cart— manage cart, create order, verify payment - Order routes:
/api/order— create orders, history, change status
Look in server/Routes/ and server/Controllers/ for concrete handlers.
Food-App/
├─ client/ # React + TS (Vite)
│ └─ src/ # Components, pages, hooks, data
├─ server/ # Express API
│ ├─ Controllers/
│ ├─ Models/
│ ├─ Routes/
│ └─ DB/
└─ package.json # root dev script (concurrently)
- Fork, create a branch, add changes, open a PR.
- Keep commits focused and include tests or screenshots when relevant.
Add screenshots to docs/screenshots/ and reference them here (optional).
MIT — see LICENSE.
Made with ❤️ by Durgeshwar