Inspiration

I've always been fascinated by the idea that satellites are constantly watching our planet, generating terabytes of data that most of us never see. I wanted to build something that didn't just display this data, but actually understood it.

When I read about the "phantom forest" scandals—where carbon credits were being sold for forests that had already been cut down—it clicked. We have the eyes in the sky; we just needed a brain to process what they were seeing. That was the spark for TerraTrace. I wanted to build a tool that could democratize environmental truth, making it accessible to anyone with an internet connection, not just scientists with supercomputers.

What it does

TerraTrace is effectively a "truth machine" for the environment. You can select any patch of land on Earth, and the system pulls historical satellite imagery from the Sentinel-2 constellation. It doesn't just show you a picture; it peels back the layers.

We use spectral analysis to look at vegetation health (NDVI) and moisture levels—things the human eye can't catch. Then, we feed all that raw telemetry into Google's Gemini AI. The AI acts like a seasoned environmental auditor, writing a full report on whether the forest is healthy, if it's been cut down, or if it's actually growing back. It even checks the surrounding 10km for "leakage"—basically seeing if loggers just moved next door to avoid detection.

How we built it

This was a heavy lift on the backend. We used Google Earth Engine (GEE) for the heavy geospatial processing. Getting GEE to talk to a modern Next.js web app was tricky. We had to build a custom API route that acts as a bridge, authenticating with a service account and requesting dynamic map tiles and statistical reductions on the fly.

For the frontend, I wanted it to feel like a piece of sci-fi tech, not a boring dashboard, so I used TailwindCSS and Framer Motion to give it that "boot sequence" and holographic feel. The AI analysis is powered by Gemini 2.5 Flash, which was surprisingly good at interpreting the abstract NDVI numbers into human-readable risk assessments. We used Mapbox GL for the visualization layer because its projection engine is incredibly smooth.

%%Challenges we ran into The biggest headache was definitely the "Cloudy Pixel" problem. Satellites can't see through clouds, and the Amazon is... well, cloudy. Early versions of the app would flag a cloud as "deforestation" because the biomass score dropped to zero. I had to implement a masking algorithm that filters out pixels with high cloud probability and takes the median value over a 4-month peak vegetation window.

Another challenge was the "Leakage" detection. Calculating a 10km buffer zone around a custom polygon in real-time is computationally expensive. Optimizing that query to run in under 3 seconds took a lot of trial and error with the GEE reducers.

Accomplishments that we're proud of

I'm really proud of the "Time Machine" feature. Sliding that bar from 2016 to 2024 and watching a forest disappear (or grow back!) in real-time is a visceral experience that static numbers can't convey. Also, getting the AI to generate a PDF-ready "Audit Certificate" feels like a real product feature that could be used today. It takes something complex and makes it tangible.

What we learned

I learned that "Big Data" is useless without "Smart Interpretation." We have petabytes of satellite imagery, but it's noise until you apply the right filters and AI context. I also learned a ton about the complexities of geospatial coordinate systems (projections are a nightmare!) and how to handle asynchronous state when dealing with massive remote datasets.

What's next for TerraTrace

I want to make this decentralized. Imagine if these audit certificates were minted on-chain, creating an immutable record of a forest's health. I also want to add a "Ground Truth" feature where locals can upload geo-tagged photos to verify what the satellites are seeing, creating a hybrid verification model.

Built With

  • framer-motion
  • google-earth-engine
  • google-gemini-ai
  • mapbox-gl
  • next.js
  • react
  • supabase
  • tailwindcss
  • typescript
Share this project:

Updates