DEV Community

shivam kumar
shivam kumar

Posted on

Earth, Not as a line chart. Not as a dashboard. As a living, breathing 120,000-cell map where every pixel is a differential equation

DEV Weekend Challenge: Earth Day

This is a submission for Weekend Challenge: Earth Day Edition

What I Built

I built TERRA-STATE: VOX ATLAS, a real-time ecological simulation that runs on a 200×600 world grid with 120,000 active cells.

The project turns ecological and economic feedback into a live, playable planet. Forests generate water, agriculture drains soil, cities expand, and a DESERTIFICATION CASCADE can collapse the world if the balance breaks.

Demo

Run the app locally:

git clone https://github.com/shivamKumarG11/Dev-to-Weekend-challenge-Earthday-edition-submission.git
cd Dev-to-Weekend-challenge-Earthday-edition-submission
python run.py
Enter fullscreen mode Exit fullscreen mode

Then open:

http://localhost:8000
Enter fullscreen mode Exit fullscreen mode

Video demo: https://youtu.be/wpWgt12ABmo

Code


The codebase is structured with a clean separation between simulation, external services, and frontend rendering.

  • terra-state/app.py — FastAPI entrypoint, routes, and integration wiring
  • terra-state/core/engine.py — world state machine, tick loop, and grid operations
  • terra-state/core/simulation.py — pure differential-equation physics for biomes
  • terra-state/core/models.py — Pydantic v2 schemas for state and API contracts
  • terra-state/services/auth0_guard.py — JWT validation for authenticated agent actions
  • terra-state/services/gemini_oracle.py — Google Gemini advisory prompt builder
  • terra-state/services/snowflake_log.py — async telemetry sink for every tick
  • terra-state/services/backboard.py — live climate multiplier fetcher
  • terra-state/static/ — frontend shell, Canvas renderer, app controller, styles

How I Built It

I built the app with a focus on making the system feel immediate and scientifically grounded.

  • Isolated the physics engine in terra-state/core/simulation.py so the world logic is testable and independent from HTTP or UI
  • Used FastAPI to expose a tick endpoint, world state hydration, Oracle sector reports, authenticated agent actions, and integration endpoints
  • Added a POST /tick route that advances the simulation and fires an async Snowflake logger without blocking the response
  • Implemented Auth0 JWT verification in terra-state/services/auth0_guard.py, with a local dev-token bypass for development
  • Wired Google Gemini to generate a concise advisory bulletin from the live world state
  • Added Backboard remote config to influence drought severity and market demand every tick
  • Built the frontend as a zero-framework HTML5 Canvas SPA with pan/zoom controls and a live metrics strip

Prize Categories

  • Best Use of Backboard — live climate overrides influence drought and market demand in real time
  • Best Use of Auth0 for Agents — authenticated spatial agent actions with audit logging
  • Best Use of Google Gemini — AI bulletins from the current planetary state
  • Best Use of Snowflake — non-blocking telemetry logging for every simulation tick

Top comments (0)