04FoodTechB2B2CUS Schools
Main Street Cafe
School meal management for a US catering company — nutrient-tracked menus, dietary-aware weekly planning for parents, kitchen prep label sheets, and operational analytics for three distinct roles.
Visit app.mainstreetcafehotmeals.comOverview
Main Street Cafe digitizes school lunch programs end-to-end: the catering company publishes menus with per-serving nutrition; school administrators manage students and classes, bulk-register parents, and send invitations; parents plan each child's Monday–Friday meals honoring dietary restrictions; kitchens receive printed label sheets and prep reports every week.
The problem
School meal programs run on spreadsheets and phone calls. The caterer needs accurate per-school, per-class, per-student meal counts ahead of each week; parents need confidence about allergens and nutrition; kitchen staff need printable, sortable labels they can trust during service.
Context
Built for a live catering operation and iterated through a formal v2 requirements cycle — replacing dated menus with persistent weekly templates, adding Friday-only items, in-portal parent registration, and one-session multi-child switching based directly on operational feedback.
My role
Full-stack engineer across the Vite/React client and Express/Mongoose server — data modeling, reporting pipelines, realtime notifications, and document generation.
- Modeled the v2 WeeklyMealSelection template — one document per student keyed by day — replacing legacy dated selections with automatically repeating weekly plans
- Implemented the friday-only menu rule end-to-end: schema flag, validation, admin UI, and parent planner filtering
- Built kitchen label generation with PDFKit: A4 sheets of 16 labels sorted Day → School → Class → Student with food-safety notes and a one-click 'Next Week's Labels' auto-range
- Created analytics pipelines with MongoDB aggregations ($lookup/$unwind/$group pivots, date-string normalization) powering meal statistics, monthly enrollment trends, and grouped selection reports
- Delivered multi-sheet XLSX exports (xlsx + file-saver) and client-side PDF/print flows for school reports
- Engineered realtime menu-change notifications via Socket.io with a notification fan-out join table and per-parent read receipts
- Implemented role-based access middleware performing live user lookups per request, plus bulk parent registration with emailed credentials via SendGrid
- Integrated presigned direct uploads to S3-compatible storage and maintained Swagger/OpenAPI documentation for the API
Architecture & technical decisions
- Client
- React 18 + Vite with RTK Query services per domain, react-hook-form, Tailwind CSS, Recharts dashboards, and role-gated route guards comparing cookie-bound tokens per role.
- Server
- Express REST API (/api/v1) on MongoDB/Mongoose with Joi validation middleware, JWT auth with a single authRole(roles) factory, Winston/Loggly logging, and Swagger UI.
- Documents & files
- Server-rendered PDFKit label sheets; presigned PUT uploads to DigitalOcean Spaces for menu imagery and avatars.
- Notifications
- Broadcast Notification + ParentNotification join pattern giving unread badges, mark-as-read semantics, and socket-triggered refetches on the client.
Key features
Nutrition-forward menus
Menus embed per-serving calories, protein, fat, and carbohydrates surfaced on parent-facing cards and printed materials alike.
Dietary-aware planning
Per-student dietary restrictions (nuts, gluten, dairy, shellfish, etc.) recorded post-login, editable by parents, and visible on kitchen labels.
Operational reports
Weekly prep matrices (meals × schools with totals), monthly enrollment trends, and downloadable selections — exportable to Excel or PDF.
School administration
Class/student management, individual or whole-class emailed invitations, bulk parent account creation, and announcements.
Challenges & solutions
Challenge 01
Kitchen staff depend on paper during service — reports had to be deterministic, printable, and forgiving of missing selections.
Solution — Server-side PDF rendering with default-meal fallbacks, stable multi-level sorting, weekend skipping, and automatic next-week date ranges so Monday printing is a single click.
Challenge 02
Parents with multiple children were re-navigating per child, causing abandoned selections.
Solution — Child-switcher dropdown persisted within the session, scoped planner state per student, and unified notifications across children.
Challenge 03
Migrating a live program from v1 dated menus to v2 weekly templates without losing history.
Solution — Dedicated migration scripts (dietary fields to students, orphan cleanup) ran alongside legacy endpoints until parity was verified, then old paths were retired deliberately.
Outcome & what makes it interesting
Shipped and iterated against real school-term deadlines; the v2 spec's changes were implemented exactly as operations requested, demonstrating a tight build–measure–learn loop with a live business.
- Software that ends up on a kitchen printer — designing for thermal-label reality, not just screens
- Aggregation pipelines turning raw selections into decisions (prep counts, enrollment trends)
- Requirements-driven iteration: v1 → v2 documents map almost one-to-one onto shipped commits