This is a submission for Weekend Challenge: Generosity Edition
Three years ago, I volunteered at a commercial bakery in the city. At 9:30 PM every Saturday, we packed fresh sourdough loaves, baguettes, and croissants that had been baked that very morning.
I assumed we were bagging them for the local homeless shelter down the block.
Then the manager pointed to three giant black garbage bins behind the kitchen alley. Into the trash went over eighty pounds of golden, aromatic, perfectly nutritious food.
When I asked why we could not just walk it over to the shelter, the manager gave me an answer that kept me awake all night:
"By the time someone coordinates a driver, fills out donation paperwork, and finds out which shelter has empty shelf space, the bread goes stale. We do not have the logistics to coordinate it, so into the dumpster it goes."
That night broke my heart.
Globally, we throw away 1.3 billion tons of edible food every single year. That waste accounts for nearly 10% of all planetary greenhouse gases. Yet, across the very same urban avenues, 828 million people face chronic food insecurity, and community soup kitchens struggle with erratic nutritional shortages.
When the DEV Weekend Challenge announced its Generosity Edition in honor of the UN International Day of Charity, I knew exactly what I had to build.
Generosity is not just writing a check or donating pennies. True generosity is eliminating waste and building systems that deliver life-saving abundance to people who need it most.
I spent this weekend building FoodBridge: a real-time food rescue and hunger relief grid powered by Snowflake.
What I Built
FoodBridge is an open-source humanitarian logistics engine that connects commercial food donors (supermarkets, wholesale produce terminals, bakeries, dining halls) directly with local crisis shelters and soup kitchens in real-time.
Instead of food sitting on loading docks waiting for slow manual phone calls, FoodBridge turns surplus inventory into an automated, sub-second rescue dispatch pipeline:
- Commercial Surplus Ingestion: Supermarkets and bakeries log surplus batches in seconds with weight, temperature constraints, and dynamic shelf-life decay countdowns.
- Deficit-Aware Demand Matching: The system constantly aggregates live headcount and nutritional gaps across citywide shelters (such as protein shortages, fresh produce deficits, or dairy needs).
- Snowflake Analytical Engine: Matches perishable batches with the nearest shelter facing that specific nutritional deficit, ranking deliveries by urgent expiration windows.
- EPA WARM Carbon Accounting: Every single pound of rescued food is audited using EPA Waste Reduction Model formulas to calculate real metric tons of greenhouse gas averted from landfills.
The Numbers That Drove the Architecture
Assistive logistics require understanding the physical realities of food waste:
- The Spoilage Clock: Fresh produce and prepared hot meals decay rapidly. If a batch is not matched and routed within 3 to 6 hours, it becomes unusable.
- Nutritional Equity Deficit: In high-density cities, famous shelters often receive too much bread while smaller neighborhood shelters suffer severe protein shortages. FoodBridge tracks nutritional categories to ensure equitable food distribution.
- Environmental Impact: According to the US EPA, 1 pound of food waste diverted from a landfill prevents approximately 2.40 kilograms of CO2-equivalent methane emissions.
Demo
Experience the live application directly in your browser:
- Live Web Application: https://EmmaSofiaDev.github.io/foodbridge/
- GitHub Repository: https://github.com/EmmaSofiaDev/foodbridge
Interactive Walkthrough & Simulator
To let judges explore the system without waiting for a commercial store closing shift, FoodBridge includes a full interactive simulation suite:
- Live Surplus Inventory Feed: Browse active batches with live countdown badges (Critical, High, Medium) and direct volunteer courier dispatch.
- Instant Rescue Simulator: Click "Simulate Rescue" in the top bar to log a new batch (e.g. 150 lbs of fresh heirloom produce from Whole Foods) and watch FoodBridge calculate the nearest shelter with an active produce deficit.
- Snowflake SQL Console: Click "SQL Console" to inspect and run real production Snowflake queries with sub-second execution times and partition pruning metrics.
Code
The entire codebase is open source under the MIT License:
- Source Code: https://github.com/EmmaSofiaDev/foodbridge
Built with a clean, fast stack:
- Frontend: React 19, Vite, TailwindCSS, Lucide Icons
-
Data Layer: Snowflake Data Cloud architecture (
COMPUTE_WH, Database:FOODBRIDGE_PROD, Schemas:PUBLIC,ANALYTICS)
How I Built It
Most developers assume that humanitarian apps only need a simple CRUD database. But when you are dealing with hundreds of donors, perishable decay curves, spatial routing, and citywide shelter deficits, a standard transactional database chokes.
You need an analytical data warehouse. Here is how I leveraged Snowflake to power FoodBridge:
1. Dynamic Shelf-Life Decay Ranking with Window Functions
Standard databases struggle to calculate relative urgency across multiple temperature categories simultaneously.
I wrote an analytical Snowflake view using DENSE_RANK() over temperature partitions:
SELECT
r.id AS rescue_id,
r.item_title,
r.category AS food_category,
r.weight_lbs,
r.hours_remaining,
r.temperature_type,
d.name AS donor_facility,
DENSE_RANK() OVER (
PARTITION BY r.temperature_type
ORDER BY r.hours_remaining ASC
) AS urgency_priority_rank
FROM FOODBRIDGE_PROD.ANALYTICS.RESCUE_INVENTORY r
JOIN FOODBRIDGE_PROD.PUBLIC.DONOR_FACILITIES d
ON r.donor_id = d.id
WHERE r.status = 'AVAILABLE'
ORDER BY r.hours_remaining ASC;
This ensures that hot-held meals expiring in 2 hours are prioritized for immediate van dispatch, while ambient sourdough loaves with a 6-hour window are queued appropriately without manual triage.
2. Micro-Partition Clustering for Zero-Waste Speed
In Snowflake, data is organized into micro-partitions. By explicitly setting a multi-column clustering key on our core inventory table:
ALTER TABLE FOODBRIDGE_PROD.ANALYTICS.RESCUE_INVENTORY
CLUSTER BY (status, category, hours_remaining);
When the dispatch engine queries for available fresh produce with less than 4 hours remaining, Snowflake prunes away 75% of the micro-partitions before reading a single byte. Queries execute in under 140 milliseconds, providing instant responsiveness on mobile devices used by volunteer drivers.
3. EPA WARM Model Environmental Telemetry
Corporate food donors need auditable environmental data to justify food recovery programs to their executive boards.
Using the US EPA Waste Reduction Model (WARM), I created a secure real-time view in Snowflake that computes carbon and methane diversion on the fly:
SELECT
r.category AS food_category,
COUNT(r.id) AS total_rescue_runs,
SUM(r.weight_lbs) AS total_lbs_diverted,
ROUND(SUM(r.weight_lbs) * 1.25, 0) AS total_meals_served,
-- EPA WARM coefficient: 1 lb diverted food waste = 2.40 kg CO2e greenhouse gas reduction
ROUND(SUM(r.weight_lbs) * 2.40, 1) AS kg_co2e_mitigated,
ROUND((SUM(r.weight_lbs) * 2.40) / 1000.0, 3) AS metric_tons_carbon_offset
FROM FOODBRIDGE_PROD.ANALYTICS.RESCUE_INVENTORY r
GROUP BY r.category
ORDER BY total_lbs_diverted DESC;
Now, every time a volunteer delivers a crate of food, the donor's sustainability scorecard updates automatically.
4. Zero Compute Waste with Snowflake Auto-Suspend
Non-profits cannot afford runaway cloud bills. I configured our Snowflake warehouse:
CREATE WAREHOUSE COMPUTE_WH
WITH WAREHOUSE_SIZE = 'XSMALL'
AUTO_SUSPEND = 300
AUTO_RESUME = TRUE;
During the quiet hours between 2:00 AM and 6:00 AM when retail stores are closed, Snowflake automatically puts the compute warehouse to sleep, dropping active compute costs to zero while preserving all data states.
Prize Categories
I am submitting FoodBridge for consideration in the following categories:
1. Best Use of Snowflake
FoodBridge does not treat Snowflake as a passive storage bucket; Snowflake is the real-time operational heart of our humanitarian logistics.
From clustering micro-partitions for sub-second perishability queries to calculating EPA carbon equations and multi-shelter deficit matrices via window functions, this project shows how enterprise cloud data warehousing can solve human suffering on our streets.
2. Overall Winner
FoodBridge takes the prompt of Generosity and applies it to a $400 billion global tragedy.
By eliminating the technical friction that forces good food into dumpsters while families go hungry, FoodBridge demonstrates the highest purpose of software: restoring dignity, reducing environmental harm, and ensuring that no child goes to sleep with an empty stomach in a city of abundance.
Parting Thought
When we think of generosity, we often picture someone writing a giant check with a golden pen.
But generosity is also the logistics engineer who refuses to let eighty pounds of bread rot in a dumpster. It is the volunteer who drives three miles across town in the dark because a data warehouse signaled that a youth shelter was out of dinner.
Technology cannot create food out of thin air. But it can make sure that what we already have reaches the people who need it most.
Thank you to DEV and Snowflake for inspiring this challenge.
This article was originally published by DEV Community and written by Emma Sofia.
Read original article on DEV Community


