A meal planning application for Nigerian cuisine with strict compatibility rules.
- Backend: NestJS (TypeScript)
- Frontend: Next.js 15 (App Router) + Tailwind CSS + Shadcn UI
- Database: PostgreSQL
- ORM: Prisma
mealplanner/
βββ backend/ # NestJS API
β βββ prisma/
β β βββ schema.prisma
β β βββ seed.ts
β βββ src/
β βββ meal-planner/
β βββ prisma.service.ts
β βββ main.ts
βββ frontend/ # Next.js dashboard
βββ app/
βββ components/
The system enforces authentic Nigerian meal pairings:
- SWALLOW (Eba, Pounded Yam, Semo) must be paired with SOUP (Egusi, Ogbono, Efo)
- RICE_PLAIN (White Rice) must be paired with SAUCE (Tomato Stew)
- RICE_ONEPOT (Jollof, Fried Rice) is standalone
- TUBER_BOILED (Yam) must be paired with SAUCE
- LEGUME (Beans, Moi-Moi, Akara) is standalone
docker compose up -d- Create a PostgreSQL database on Railway
- Copy the DATABASE_URL
- Update
backend/.env
# Backend
cd backend
npx prisma generate
npx prisma db push
npx prisma db seed
npm run start:dev
# Frontend (new terminal)
cd frontend
npm run devBackend: http://localhost:4000 Frontend: http://localhost:3000
# Start PostgreSQL
docker compose up -d postgres
# Then run backend manually (see below)cd backend
npm install
# NestJS will auto-load .env file
# DATABASE_URL is already configured for local PostgreSQL
npm run start:devBackend: http://localhost:4000
cd frontend
npm install
npm run devFrontend: http://localhost:3000
POST /meal-planner/generate- Generate 7-day meal planGET /meal-planner/current- Get today's meal planPOST /meal-planner/swap/:mealTime- Swap breakfast/lunch/dinner
- Create PostgreSQL database on Railway
- Create new service from GitHub repo
- Point to
/backendas root directory - Railway will auto-detect Node.js and use:
- Build:
npm install && npx prisma generate && npm run build - Start:
npx prisma db push && npx prisma db seed && npm run start:prod
- Build:
- Environment variable
DATABASE_URLwill be auto-injected by Railway PostgreSQL service
- Import GitHub repo to Vercel
- Set root directory to
frontend - Add environment variable:
NEXT_PUBLIC_API_URL= your Railway backend URL (e.g.,https://mealplanner-production.up.railway.app)
- Vercel will auto-detect Next.js and deploy
MIT