Inspiration

We've realized that we are too lazy to cook and often buy ingredients that end up rotting in our fridge. Not only is this not economical but it's also not healthy for us to keep eating out or only eating snacks for our meals. We've created this solution to help users easily plan meals and manage expiry dates for food in their fridge with Gemini's API.

What it does

Motto is an intelligent kitchen companion that bridges the gap between your grocery bags and your dinner plate, helping you reduce waste and hit your nutrition goals.

Snap & Scan: Users simply take a picture of their groceries. Our app pipes the image to Gemini 3.0 Flash, which automatically identifies ingredients, categorizes them (e.g., "Dairy", "Produce"), and intelligently estimates their expiration dates based on visual cues.

Smart Pantry: It builds a digital inventory of your kitchen in seconds, tracking what you have and when it needs to be used, so you never forget about that bag of spinach again.

Context-Aware Chef: Instead of generic recipe suggestions, Motto generates meals based strictly on what you currently own. It combines your dietary profile (e.g., "High Protein", "Vegan") with your inventory to create unique recipes that prioritize using up ingredients that are close to expiring.

How we built it

We built a full-stack mobile solution using .NET 10 for the backend and React Native (Expo) for the frontend, with Google Gemini 3.0 Flash acting as the brain of our operation.

  1. The AI Engine (Gemini 3.0 Multimodal) We leveraged Gemini's multimodal capabilities for two distinct agents:

The Vision Agent: We pipe raw image streams from the user's camera directly to gemini-3-flash-preview. We engineered a system prompt that forces Gemini to act as an optical character recognition (OCR) and object detection expert, returning a strict JSON array of ingredients, categories, and estimated expiry dates based on visual cues.

The Chef Agent: We feed the user's digital inventory, combined with their dietary profiles (macros, cuisine preferences, restrictions), into a context-aware prompt. Gemini then synthesizes unique, step-by-step recipes that prioritize using ingredients that are close to expiring.

  1. The Backend (.NET 10) We utilized the latest .NET 10 (Preview) to build a high-performance REST API.

Architecture: We followed a Clean Architecture pattern, separating Services (business logic) from Repositories (data access) to keep the codebase modular.

Security: We implemented JWT Bearer authentication to secure user data and inventory states.

Speed: For the hackathon, we used in-memory ConcurrentDictionary storage to ensure zero-latency reads/writes during demos.

  1. The Frontend (Expo & React Native) We built a cross-platform mobile app using Expo. We focused on a clean, native-feeling UI that abstracts away the complexity of the AI. The app captures photos and handles the "loading state" gracefully while Gemini processes the image in the background.

Challenges we ran into

We faced a major bug where our entire backend refused to start, preventing our seed user ("sharon@waterloo.com") from being created. It turned out that a missing Gemini API Key was crashing the entire ItemsService during startup. This taught us how much even the smallest parts of our project depended on each other.

Accomplishments that we're proud of

We successfully built a pipeline that streams raw image data from a mobile device directly to Gemini 3.0 Flash, forcing it to act as a structured data extractor. Getting the AI to reliably return strict JSON for ingredient inventory—including estimated expiry dates—was a huge win.

We took a risk using .NET 10 (Preview) for our backend. It paid off with a high-performance, clean architecture that handles our "Vision" and "Chef" agents seamlessly.

We didn't just ask for generic recipes. We built a context-aware prompt engine that respects user-specific constraints (allergies, macros, cuisine types) while prioritizing ingredients that are about to expire, effectively closing the loop on food waste.

What we learned

We learned that "programming" Gemini requires a different mindset than writing C#. We had to implement robust "cleaning" logic to strip Markdown fences and handle potential JSON syntax errors from the model's output.

Balancing the state between a React Native frontend and a stateless REST API, especially when dealing with asynchronous AI processing, taught us the importance of optimistic UI updates to keep the app feeling snappy.

For the hackathon, we utilized ConcurrentDictionary for our data persistence. While it's not ready for production yet, it taught us how much latency a traditional database adds and how fast .NET can be when running purely in memory.

What's next for Motto

Implementing push notifications that alert users 24 hours before an ingredient expires, prompting them with a "Use It Up" recipe immediately.

Replacing our hackathon-grade "FakeJWT" implementation with a real identity provider (like Auth0 or Microsoft Entra ID).

Built With

Share this project:

Updates