Live Site

Inspiration

The idea was born out of a simple, hungry question: "Which menu item would cost the SFU Dining Commons the most money if I ate it?" As students, we pay a fixed price for our meal plans; I wanted to build a tool that flips the script and identifies where the true "wholesale value" lies on the tray. It’s about eating well while understanding the literal cost of the margins.

What it does

Eat The Margins is a real-time "Value Dashboard" for the SFU Dining Hall. It: - Scrapes daily menu data directly from the provider. - Estimates the wholesale ingredient cost of every dish. - Highlights the "Most Valuable Item" (MVI) for the current meal period. - Tracks nutrition, with a specific focus on high-protein density via the Protein+ Badge.

How we built it

The project is a full-stack Python application:

The Backend: Flask serves the data, while a custom Python scraper (using Pandas) runs via a daily Cron job to fetch menu updates.

The Logic: I implemented a custom algorithm to gate the "Protein+" badge ($Protein \ge 10\% \text{ of cals}$ and $\ge 5g$ total) to filter out low-calorie vegetables.

The Infrastructure: Hosted on a Proxmox VE home lab inside an LXC container, using Nginx as a reverse proxy with SSL encryption.

Challenges we ran into

Resource Constraints: Running a full VS Code remote development environment on a lightweight Proxmox container led to frequent "Extension Host" crashes. I had to optimize memory allocation and manage swap space to keep the environment stable.

Data Integrity: Dining Hall data is often messy or incomplete. Handling cases where calories were "0" (preventing division-by-zero errors in my protein logic) required robust error handling in JavaScript.

Rate Limit: Using Gemini API, I got hit with a rate limit of 20 requests per day. I was able to avoid this by switching models.

Deployment: Setting up the Nginx-to-Gunicorn pipeline for the first time involved a steep learning curve with Unix Sockets and permissions.

Accomplishments that we're proud of

The Hero Card: Building a dynamic "Most Valuable" highlight that updates automatically based on the time of day.

Mobile Experience: Creating a UI that feels like a native app on iPhone when added to the home screen.

Full Ownership: Managing every layer of the stack, from the physical Proxmox server hardware to the final CSS pixel.

What we learned

I learned that "simple" data projects are rarely simple. I gained deep experience in Linux server administration, Git workflow, and the importance of Frontend/Backend synchronization—specifically how to keep the state of a shopping cart synced across multiple UI components.

What's next for Eat The Margins

User Accounts: Allowing students on a meal plan log how close they are to paying it off.

More Date: Show analytics day by day on the average cost of items in the dining commons. Graph patterns so people know when the best day / time of day to visit.

Built With

Share this project:

Updates