Skip to main content

Design Philosophy

Every technical decision encodes a belief. Here’s what we believe.
Terra isn’t just a forms platform—it’s an opinionated take on how government intake infrastructure should work. This page explains the principles that guide our technical decisions.

Principle 1: Applicant Data Is Sacred

Government benefit applications contain the most sensitive information people share: Social Security numbers, income documentation, disability status, immigration records. A data breach doesn’t just expose information—it can result in identity theft, benefit denial, or deportation. This principle shapes everything: When we face a tradeoff between convenience and data protection, data protection wins. Every time.

Principle 2: Fail Secure, Not Fail Open

Security bugs are inevitable. The question is: when something goes wrong, what happens? Fail open means errors grant access. A crashed permission check lets the user through. Fail secure means errors deny access. A crashed permission check redirects to login. We chose fail secure:
This extends to every security decision:
  • Unknown role? Treat as applicant (lowest privilege)
  • Can’t parse redirect URL? Go to home page
  • File path looks suspicious? Reject the upload
  • Session decryption fails? Redirect to login

Principle 3: Explicit Over Magic

Frameworks love magic. Automatic code splitting, implicit data fetching, hidden configuration. Magic is convenient until it breaks—then you’re debugging something you don’t understand. Terra prefers explicit patterns: Server actions, not API routes
Manual permission checks, not middleware magic
Zustand stores, not Context gymnastics
When you read Terra code, you should understand what’s happening without knowing framework internals.

Principle 4: JSON for Flexibility, Zod for Safety

Government forms are weird. Conditional sections, repeatable groups, custom validation rules, translated labels. A normalized database schema would require migrations for every new form feature. We use JSONB for flexibility:
But JSON is stringly-typed. You can put anything in there. So we validate with Zod:
The combination gives us:
  • Flexibility: Add new field types without migrations
  • Safety: Invalid schemas fail fast with clear errors
  • Portability: Export/import forms as JSON files
  • Versioning: Store draft and published schemas side by side

Principle 5: Async by Default

External services fail. Airtable rate limits. Twilio has outages. Webhook endpoints timeout. If form submission depends on external services, applicants suffer for infrastructure problems. Our solution: submissions are synchronous, everything else is async. Benefits:
  • Applicants see success in ~300ms regardless of integration health
  • Failed operations retry automatically with exponential backoff
  • Dead-letter queue captures persistent failures for manual review
  • Integration outages don’t create support tickets

Principle 6: Server-First, Client-Lite

React traditionally runs in the browser. The server sends HTML, then JavaScript hydrates it into an interactive app. This creates security risks: secrets can leak into client bundles, API keys can be extracted, business logic can be reverse-engineered. Terra uses React Server Components (RSC) to keep sensitive logic on the server:
Client components exist for interactivity (form inputs, drag-drop, modals) but they receive pre-fetched data rather than making their own API calls. What stays on the server:
  • Database credentials and queries
  • Permission checks
  • File signed URL generation
  • Integration API keys
  • Encryption/decryption
What runs on the client:
  • Form input handling (react-hook-form)
  • Drag-and-drop (dnd-kit)
  • UI state (modals, tabs, accordions)
  • File uploads (after receiving signed URL)

Principle 7: White-Label as a Feature

Government agencies have strong brand requirements. Their forms should look like “their” forms, not a third-party service. Terra is designed to be invisible. Branding is configurable at every level:
  • Organization: Logo, colors, fonts
  • Folder (workspace): Override logo, custom domain
  • Form: Override any setting, form-specific domain
Custom domains are first-class:
Email templates are brandable:
The applicant never sees “Terra” or “Unify”—just their agency’s brand.

Principle 8: Multi-Language by Design

Government forms serve diverse populations. Language support isn’t a plugin—it’s baked into the data model. Every user-facing string is an I18nString:
Translation workflow:
  1. Create form in English
  2. Add languages to form settings
  3. Auto-translate with DeepL (or translate manually)
  4. Applicants switch languages at runtime
The form builder shows all languages simultaneously—no switching modes to edit translations.

Principle 9: Audit Everything

When something goes wrong (and it will), you need to know what happened. Terra logs every significant action:
Every form edit, status change, permission grant, and file access is recorded. Audit logs are immutable (append-only table) and retained indefinitely. This enables:
  • Debugging: “Who changed this field label?”
  • Compliance: “Show all accesses to this applicant’s data”
  • Security: “What did this user do before we revoked access?”

Principle 10: Boring Technology (Mostly)

Innovation is expensive. Every new technology requires learning, debugging, and maintenance. Terra uses boring, proven technologies wherever possible: We reserve complexity for problems that need it:
  • Form schema (novel problem → custom solution)
  • Async queue (specific requirements → custom table)
  • AI form import (genuinely complex → novel approach)
But auth? We use WorkOS. Storage? Supabase. Email delivery? Resend. These are solved problems—we don’t need to re-solve them.

Summary


Next Steps

Forms Engine

How the form schema works

Local Development

Get Terra running on your machine