Case study · Frontend

FRED

Spatial agents for bioenergy optimization that show their work.

Role
Founder. Designed and shipped the first release end to end
Frontend
React, TypeScript, Tailwind CSS, Leaflet
Year
2026. Live at biofred.us, in beta
Recognition
NSF I-Corps, 2026 cohort
biofred.us
FRED landing page hero: the headline Ask a question about a place, get an answer you can check, beside the map, the run log, a supply curve and the answer card

Summary

FRED turns a question about a place into a siting report with numbers you can check. The frontend's job was to make an AI agent's work visible: each tool call streams onto the screen as it runs, and every figure in the answer points back to the step that made it.

  • 107KB

    JavaScript on the landing page, compressed

  • 0

    layout shift on first load

  • 2

    themes from one set of color tokens

  • 7.2s

    example run, streamed step by step

My part

What I shipped

The first release was mine end to end, from the first sketch to the deploy pipeline. The team has grown since.

Design
Brand, layouts and the color-token system behind the dark and light themes.
Landing and blog
Scroll-driven sections that replay a real run, and the research blog on a Sanity CMS.
App frontend
Dashboard, Leaflet map workspace, the streaming run log and saved runs with export.
Agent backend
FastAPI agent loop, Redis caching and the PostGIS and H3 data layer.
Infrastructure
Deployment and continuous delivery on Google Cloud.
Research
The Compositional Spatial retrieval architecture and the write-ups behind it.

01 · Landing page

A landing page that shows the product working

No stock art. Every section replays a real run, so a visitor sees what the agent does before they sign in.

biofred.us · light theme
The same landing hero in the light theme, with dark cards on warm paper and a darker gold call to action
Light theme. One toggle sets data-landing-theme="light" and the color variables do the rest.
Example run section: a replay of each tool step with its inputs, outputs and timing, and an answer typing in
Run replay. Steps tick in with their timings and the answer types out the way it streams in the app.
Platform section: six cards with small animated diagrams for models as tools, reading the map, trade-offs, projections, streaming steps and new domains
Platform grid. Each card's diagram is drawn in code and animates on scroll.

02 · Product

From a question to a report you can export

biofred.us/chat
The FRED workspace: a terrain map of Northern California with a location panel on the left and the agent panel on the right showing a procurement plan and cost breakdown
Workspace. A Leaflet map on terrain tiles, a location panel with an auto-sized radius, and the agent panel where results stream in as formatted tables.
Dashboard: an Ask about a place input with suggested prompts, saved runs with chips for coordinates, capacity, tools and cost, and an overview panel
Dashboard. Saved runs show their key numbers as chips, so a planner can scan results without opening each one.
Saved run page: title, a Continue this run button, summary cards, a summary and a transcript with Markdown and JSON export
Saved run. Summary cards up top, the full transcript below, export to Markdown or JSON, and one button to pick the run back up.

03 · Mobile

The same product at 390 pixels

The hero trims down to the question, the map and the answer. Navigation folds into a full-width menu, the app sidebar becomes a menu button, and run summaries reflow into a two-column grid.

Mobile landing hero: headline, two call to action buttons and the start of the map card
Hero
Mobile menu open: full-width links for How it works, Platform, Research, Docs and Blog
Menu
Mobile platform section: heading and platform cards in one column
Platform
Mobile dashboard: menu button, Ask about a place input, suggested prompts and saved runs
Dashboard
Mobile saved run: title, Continue this run button and summary cards in a two-column grid
Saved run

04 · Design system

Forest night, warm paper and one gold accent

  • Canvas#0A1410
  • Surface#0E1814
  • Brand#395442
  • Gold#C8A96E
  • Signal#4ADE80
  • Primary#F5F0E6
  • Ink#16211B

Outfit

Ask a question about a place.

Interface and headlines

DM Serif Display

check.

Wordmark and one italic word per headline

JetBrains Mono

R* = 84 km · 1.8s

Coordinates, timings, units and button labels

Tokens as color channels

/* :root and :root[data-landing-theme="light"] */
--c-canvas: 10 20 16;
--c-gold:   200 169 110;
--c-accent: 74 222 128;

/* Tailwind reads them by name */
<header class="sticky bg-canvas/85 backdrop-blur-md border-b border-edge-soft">
  • Storing colors as bare RGB channels lets Tailwind add opacity, so bg-canvas/85 works with no extra tokens.
  • Components use names like canvas, edge and gold, never hex values. The light theme only redefines the variables.
  • A skip link and a focus ring token ship with the base layout.

05 · Tech

How the frontend is put together

  1. 1 · Browser

    React single-page app

    TypeScript, Tailwind on shared tokens, Leaflet for the map. Routes load their own code.

  2. 2 · Stream

    Server-sent events

    Tool steps and answer text stream to the browser as they happen.

  3. 3 · Agent

    FastAPI and Redis

    Runs the agent loop on Google Cloud and caches result sets between turns.

  4. 4 · Data

    PostGIS and models

    Spatial queries, H3 hexagon grids and machine learning surrogates of cost and fire models.

Code split by route

The landing page ships one script. The map and chat, about 134 KB more, load only when someone opens the app.

Streaming states

Steps appear as they finish, each with its inputs, output and time, so a multi-second run never looks frozen.

Runs you can resume

Every run is saved as a transcript that reopens in the workspace and exports to Markdown or JSON.

  • React
  • TypeScript
  • Tailwind CSS
  • Leaflet
  • Server-sent events
  • Sanity
  • FastAPI
  • Redis
  • PostGIS
  • H3
  • Google Cloud

06 · Performance

Measured, not guessed

First load of biofred.us in desktop Chrome on October 30, 2026, read from the browser's Performance API.

Landing page

biofred.us · HTTP/2
JavaScript, compressed (352 KB uncompressed)

107KB

CSS, one file

13KB

requests on first load

13

cumulative layout shift

0

until the load event

1.1s

map and chat code, loaded only in the app

+134KB

08 · Applied AI

Retrieve numbers, compute, then write

Standard retrieval-augmented generation pulls passages of text. Siting questions need numbers that don't exist until something computes them.

FRED's Compositional Spatial retrieval pulls from three model prediction surfaces over 11.9 million spatial records, computes the answer, and only then lets the language model write.

That order is what makes the interface possible. Every number in an answer comes from a tool call, so the screen can show where it came from.

  • 166M

    model predictions statewide

  • 3.1M

    forest sites indexed

Blog article Retrieval over prediction surfaces, not documents, with tags, a table of contents and an illustration of three stacked prediction layers
The write-up on biofred.us, with a sticky table of contents that tracks the section you're reading.

09 · Next

What I'd ship next

  1. 01Run Lighthouse in CI with a budget that keeps the landing script near 107 KB.
  2. 02Rework the map workspace for phones, where the agent panel and map controls compete for the same space.
  3. 03Show each tool's latency and cache hits live in the run log.
  4. 04Open a public API once the first endpoints settle.