Inspiration
Hong Kong sends 3,600 tonnes of food waste to landfills every day — 30% of all municipal waste. For school cafeteria managers, the challenge is personal: 40kg of food goes uneaten every Tuesday. Existing solutions are either expensive ERP dashboards or sustainability tools that track waste after it happens — when it's too late to act.
We built EcoOS Core to answer one question before lunch is served: how much will be wasted today?
What it does
EcoOS Core is a terminal-themed AI prediction platform for Hong Kong school cafeterias. Input three parameters — menu, attendance, weather — and an ensemble ML engine (Random Forest, XGBoost, Neural Network, Linear Regression, LLM) forecasts waste quantity in kg with a confidence interval, risk level, and three ranked interventions with projected cost savings.
It also includes an Intelligent Triage console (raw reports → structured action plans) and a Session Impact Tracker (real-time kg, CO₂e, cost metrics).
How we built it
Frontend: Next.js 14 with TypeScript and Tailwind CSS — terminal-green-on-black aesthetic with scanlines, CRT effects, and a boot sequence.
Backend: API routes for prediction and triage. HuggingFace Inference API for LLM-powered predictions when available, deterministic local fallback (predictWasteLocally) that computes waste from menu keywords, day-of-week multipliers, weather factors, temperature effects, and attendance scaling — guaranteeing the demo never fails.
Architecture: Five-model ensemble with feature engineering (menu category, weather sentiment, day-of-week patterns), confidence scoring, and a ranked intervention generator.
Hosting: Vercel, two Git remotes, automated deploys.
Challenges we faced
The auth redirect race. React 18's automatic batching caused a subtle bug: users logged in, landed on the dashboard, and were immediately redirected back to login because auth state wasn't flushed before the route guard ran. Fixed with setTimeout(0) to yield the event loop plus a sessionStorage guard flag.
The prediction API must never error. During judging, an API failure would look terrible. We built a deterministic fallback predictor that runs from first principles — no external dependencies, zero chance of failure. HuggingFace is a bonus, not a requirement.
Terminal CSS from scratch. Scanlines that don't break layout, CRT glow without overflow, green-on-black readable when projected — every visual detail was hand-tuned.
Accomplishments that we're proud of
- Zero-failure demo. The prediction API never errors — HuggingFace or fallback, it always returns a result.
- Auth race conquered. A subtle React 18 batching bug isolated and fixed in 3 lines of code.
- Terminal aesthetic from scratch. Every scanline, CRT glow, and boot sequence hand-built in CSS.
- Built for Hong Kong, not generic. Every text, mock user, and data reference is localized to Hong Kong school cafeterias. ## What we learned
What's next for EcoOS Core — AI Food Waste Prediction for HK Schools
Deploy in 10 Hong Kong school cafeterias as a pilot. Integrate with real POS systems. Train on actual waste records (not synthetic). Add SMS alerts for threshold breaches.
Built With
- 14
- api
- css
- github
- huggingface
- inference
- instruct
- llama
- meta
- next.js
- obs
- react
- scikit-learn
- studio
- supabase
- tailwind
- typescript
- vercel
- xgboost
Log in or sign up for Devpost to join the conversation.