Full-stack food ordering app with client and restaurant dashboards.
backend/: Express server (JavaScript, ESM)frontend/: Vite + React app (JavaScript)
This repo uses npm workspaces, so there is a single package-lock.json at the top level.
- Role-based auth (client and restaurant)
- Restaurant menus and item management
- Orders with delivery estimates and status tracking
- Client cart and checkout flow
- Swagger API docs
Install dependencies (from repo root):
npm installRun both backend + frontend in dev:
npm run devOr run them separately:
npm run dev:backend
npm run dev:frontend- Backend:
http://localhost:3000 - Frontend: Vite default (usually
http://localhost:5173) - Frontend proxies
/api/*to the backend viafrontend/vite.config.js
Health endpoint:
curl http://localhost:3000/api/healthSwagger docs:
- UI:
http://localhost:3000/api/docs - JSON:
http://localhost:3000/api/docs.json
Copy backend/.env.example to backend/.env, then fill the values provided by an admin:
cp backend/.env.example backend/.envVariables to set:
MONGODB_DB_NAME=fastfood
MONGODB_DB_USER=your_user
MONGODB_DB_PASSWORD=your_password
MONGODB_CLUSTER_HOST=your_cluster_host
MONGODB_APP_NAME=cluster_name
JWT_SECRET=replace_with_secure_secret
JWT_EXPIRES_IN=30d
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secretYou can also set MONGODB_URI directly (takes precedence):
MONGODB_URI="mongodb+srv://user:password@cluster.mongodb.net/?appName=FastFoodCluster0"Seed files live in backend/db/:
meal.json(catalog)users.json(mock users and restaurants)menus.json(menu items per restaurant)orders.json(orders across statuses)
To seed the database:
npm run seed -w backendThe seed script clears and repopulates the meals, users, menus, and orders collections.
Test the connection first if needed:
npm run db:check -w backendAll mock users use password123.
Clients:
mario.rossi@fastfood.testlucia.bianchi@fastfood.testgiulia.verdi@fastfood.testluca.neri@fastfood.testsara.conti@fastfood.test
Restaurants:
burger.station@fastfood.testpasta.corner@fastfood.testsushi.way@fastfood.testpizza.lab@fastfood.testgreen.bowl@fastfood.test
From repo root:
npm run dev
npm run dev:backend
npm run dev:frontend
npm run build
npm run preview
npm run startBackend only:
npm run seed -w backend
npm run db:check -w backend