Full-stack AI meal planning platform built as a pnpm monorepo. NestJS handles business logic, Python FastAPI runs the AI brain with LangGraph and RAG, and Next.js delivers a performant frontend with real-time streaming.
Key Features
- pnpm monorepo with NestJS backend, Python FastAPI AI service, and Next.js frontend
- LangGraph StateGraph powering the AI meal generation pipeline
- Real-time SSE streaming from Python → NestJS → Next.js
- PostgreSQL + BullMQ for data persistence and async job processing
- Stripe subscription billing with end-to-end webhook flow
- 95+ Lighthouse score with SSG/ISR and optimized bundle
Tech Stack
Backend
AI
Frontend
Infrastructure
Challenges & Solutions
Reliable AI Meal Generation
LLM outputs are non-deterministic — generated meals could have invalid nutritional data, duplicate recipes, or fail dietary constraints.
LangGraph StateGraph with dedicated nodes for generation, validation, and diversity enforcement. Each node validates structured output against schemas before passing to the next stage.
Real-Time Streaming Across Services
Meal generation takes 10-30s through the AI pipeline. Users need immediate feedback, but the response crosses 3 service boundaries (Python → NestJS → Next.js).
SSE streaming pipeline where Python FastAPI streams tokens to NestJS, which proxies them to the Next.js frontend. Users see meals being generated in real-time.
Recipe Retrieval Quality
Simple keyword search returned irrelevant recipes. Users with specific dietary needs (keto, vegan, allergen-free) got poor matches.
RAG pipeline with Qdrant vector DB for semantic recipe retrieval. USDA nutritional data validates macro targets. Retrieval quality improved significantly over keyword-based search.