This is a submission for Weekend Challenge: Earth Day Edition
What I Built
EcoTrace is a personal carbon footprint tracker powered by an AI coach that
remembers your eco-journey across sessions (Backboard + Gemini), secured by
Auth0 for Agents, with live emission factor data from Snowflake, NFT achievement
badges minted on Solana, and anonymous community benchmarking that shows exactly
how your footprint stacks up against other users β all inside a Next.js 14 App
Router project with a bioluminescent dark/light UI.
I had no idea how carbon-heavy my daily choices were until I started tracking.
One beef burger equals driving 30 km. A single short-haul flight equals two weeks
of commuting. The data exists β people just never see it mapped to their own life.
EcoTrace fixes that.
Demo
π Live App β ecotrace.vercel.app
Code
How I Built It
Architecture: Clean, DRY, and SOLID throughout
The biggest technical decision was committing to Clean Architecture from the
start rather than letting a weekend project collapse into a single pages/ mess.
The codebase is split into four strict layers:
-
Domain β pure TypeScript entities, value objects, and repository interfaces.
Zero framework dependencies.
CO2Amountis a branded type so you can never accidentally pass a raw number where a validated COβ value is expected. -
Application β use cases like
LogActivityUseCaseandGetDashboardDataUseCasethat orchestrate domain logic. They depend on interfaces, never on concrete infrastructure classes. - Infrastructure β the real implementations: Supabase, Snowflake, Backboard, Auth0, Solana. Each implements a domain interface and is swappable.
- Presentation β Next.js App Router pages, server components, client components, hooks, and the shared UI kit.
Every API route is wrapped with withAuth and withValidation middleware β
defined once, applied everywhere. userId is always sourced from the Auth0 session
on the server, never from request bodies. Supabase Row Level Security enforces
data ownership at the database level as a second line of defence.
Snowflake: Live emission factors + community benchmarking
Instead of hardcoding emission factors, they live in a Snowflake table seeded
from EPA, BEIS, and IPCC sources. When the grid gets greener, the electricity
factor updates in one place and every calculation reflects it instantly.
The second Snowflake table is more interesting: every time a user logs a day's
total, an anonymised row (no user ID, coarse region only) is written to
COMMUNITY_DAILY_TOTALS. A percentile query against that table powers the
dashboard widget that says "you emitted less than 67% of EcoTrace users today."
Turns out that number is surprisingly motivating.
Backboard: AI that actually remembers you
This was the integration I was most sceptical about and ended up being the most
impressive in practice. Every chat message is sent with memory: "Auto" β
Backboard automatically extracts facts from the conversation and retrieves
relevant ones in future sessions. The AI coach genuinely recalls things like
"you told me last week you're trying to go plant-based on Tuesdays" without
any extra work on my end.
Each user gets a persistent Backboard thread ID stored in their Supabase profile.
The AI also receives the user's actual carbon data as a system prompt context on
every request, so it can say "your Tuesday flight was 3x your entire rest-of-week
footprint" rather than giving generic advice.
Auth0 for Agents: Real auth plus a background scanner
Auth0 handles user authentication via Universal Login (Google social, email/password).
The more interesting part is the Token Vault integration: users can connect their
Google Calendar in Settings, and the EcoTrace agent scans for travel-related events
β flights, hotel stays, train journeys β and suggests logging them as carbon
activities. Every suggested item requires explicit user approval before anything
is written (CIBA human-in-the-loop flow). An audit log in Supabase records every
scan and every approval/rejection for transparency.
Solana: On-chain achievement badges
Five badges (common β epic rarity) are minted as compressed NFTs on Solana
devnet using Metaplex Bubblegum. cNFTs cost a fraction of a cent to mint vs
standard NFTs, which makes them practical for an achievement system. The
mint authority keypair lives server-side only β the user connects their Phantom
or Solflare wallet and the server mints to their address. Each minted badge
links to Solana Explorer so it's verifiably permanent, not just a database flag.
GitHub Copilot: The coding co-pilot
Copilot was running throughout the build. The moments where it saved the most
time: autocompleting Recharts gradient fill configuration (I'd never used that
specific API), the Snowflake parameterised query syntax (unfamiliar SDK),
and generating the Zod schema for nested badge threshold types. I'd estimate
it saved 3β4 hours across the weekend β time that went into the UI polish instead.
The UI: "Bioluminescent Data"
The design system is built around two modes that share the same CSS variable
tokens. Dark mode is "Bioluminescent Depths" β deep forest blacks with glowing
green data points. Light mode is "Sunlit Canopy" β warm parchment backgrounds
with deep forest greens. The fonts are Fraunces (editorial display, used for
headlines and the hero), DM Mono (all COβ numbers in tabular-nums), and Geist
(body). The carbon score ring is an SVG stroke-dashoffset animated with
Framer Motion spring physics β it colour-shifts from green through amber to red
based on how the day's total compares to the global average.
Prize Categories
Best Use of Backboard β Persistent AI memory via memory: "Auto" on every
message. The EcoTrace AI coach remembers your eco-journey across sessions
without any manual state management. Thread IDs persist per user in Supabase.
Best Use of Auth0 for Agents β Universal Login for user auth plus Token Vault
for the Google Calendar agent scanner, with CIBA async approval so the agent
never logs anything without explicit user confirmation.
Best Use of Snowflake β Emission factors live in Snowflake and are queried
at runtime (not hardcoded). Anonymous community daily totals power a percentile
widget showing how each user compares to the EcoTrace community.
Best Use of Solana β Compressed NFT eco-badges minted on devnet via Metaplex
Bubblegum. Five badge tiers, wallet adapter integration (Phantom + Solflare),
and on-chain verification via Solana Explorer.
Best Use of GitHub Copilot β Used throughout the build for Recharts config,
Snowflake SDK syntax, Zod schema generation, and Metaplex boilerplate.
Documented with screenshots in the repo README.
Top comments (0)