Inspiration

The idea for Freshr grew out of conversations about real public health incidents and how preventable many of them feel in hindsight. Around Thanksgiving in Seattle, we discussed past foodborne illness outbreaks and restaurant-related incidents, where a single lapse in temperature control or hygiene can ripple into a serious public health issue. These moments highlighted a common theme: problems are often discovered after people get sick.

We asked ourselves a simple question: what if kitchens had real-time visibility into food safety risks, the same way modern systems monitor uptime or fraud? Food safety shouldn’t rely solely on periodic checks or paper logs. With continuous monitoring and streaming data, risks could be detected early before contamination spreads. This led us to the idea of real-time food safety monitoring, powered by event streaming, where platforms like Confluent make it possible to react instantly rather than retroactively.


Learnings

Building Freshr pushed us to think in a real-time, streaming-first mindset. Instead of batch processing or static dashboards, we learned how to design systems that continuously ingest, process, and react to data as it happens.

Key learnings included:

  • How to model operational and physical events (temperature, humidity, handwashing, deliveries) as streams of facts, not static records.
  • Designing anomaly detection that blends statistical reasoning with optional AI-based inference, balancing interpretability and power.
  • Using modern cloud tooling to stitch together streaming (Kafka), processing (Cloud Run), storage (Firestore), and visualization (Angular UI).
  • Thinking about AI not as a black box, but as an assistive layer that enhances signal detection while still allowing deterministic fallbacks.

Overall, we learned how to reason about systems where time matters, and where insights lose value if they arrive too late.


Project Overview

Freshr is a real-time food safety monitoring demo designed to help kitchen teams detect and respond to risks early.

At a high level, the system works as follows:

  • Sensor Simulation & Ingestion
    Physical and operational sensors,such as cold storage temperature, ambient kitchen temperature, humidity, time-out-of-range duration, handwashing usage, deliveries, and shift changes, are simulated and published as events into Kafka topics.

  • Streaming & Processing (Confluent-centric design)
    Kafka serves as the backbone of the system, enabling high-throughput, ordered, and replayable streams of sensor data. Cloud Run–based processors consume these streams, validate events, enrich them with context, and perform anomaly detection in near real time.

  • Anomaly Detection
    Each measurement is evaluated using a statistical baseline. When configured, an AI layer (Vertex AI and Gemini) augments this logic with a developed report.

  • Persistence & APIs
    Measurements and detected anomalies are stored in Firestore. REST APIs expose recent readings, anomaly feeds, aggregates, and time-series data for the frontend.

  • Visualization & Scenarios
    An Angular-based UI maps sensors to kitchen zones, visualizes risk levels, and surfaces actionable incidents. Predefined scenarios—such as an “E. coli outbreak”—demonstrate how teams can replay events, understand root causes, and take corrective actions like holding produce, verifying temperatures, or retraining staff.

Together, these pieces form a cohesive system that correlates streaming telemetry with anomaly detection and turns raw data into actionable food safety insights.


Challenges

We faced several challenges while building Freshr:

  1. Laying the real-time foundation
    Designing a reliable streaming pipeline required careful thought around schemas, ordering, replayability, and failure handling. Getting the Kafka → processor → storage flow correct was critical before anything else could work.

  2. Using AI responsibly for anomaly detection
    We wanted AI to add value without obscuring understanding. The challenge was ensuring that anomaly detection remained explainable and robust, with sensible fallbacks when AI was unavailable or uncertain.

  3. Building a user-friendly experience on top of streaming data
    Translating raw sensor events and anomalies into a clear, intuitive UI was non-trivial. The frontend needed to feel actionable, not overwhelming, while still reflecting the complexity of real-time operations.

Despite these challenges, the process reinforced how powerful event-driven architectures can be when paired with thoughtful design. Freshr demonstrates how real-time streaming and AI can work together to improve food safety outcomes before incidents turn into headlines.

Built With

Share this project:

Updates