Next-generation government intake infrastructure built with modern cloud primitivesThe Unify Platform is a monorepo containing experimental and production tools for government benefit program applications. We’re exploring how serverless computing, edge networks, and composable authentication can transform public sector digital services.
What’s Inside
This monorepo contains three applications and three shared packages:Applications
- Terra - Form builder and intake management platform for government programs (experimental)
- Pathfinder - Client-facing portal for application tracking and document management
- Docs - Internal technical documentation (Mintlify)
Packages
- @unify/ui - Shared React component library built with Radix UI and Tailwind CSS
- @unify/database - Shared database types and utilities for Supabase
- @unify/identity - Shared applicant identity, profile, and history modules
Tech Stack
Core Framework
- Next.js 16 - React framework with App Router
- React 19 - UI library
- TypeScript 5 - Type safety
- Tailwind CSS 4 - Styling with @tailwindcss/postcss
Infrastructure
- Supabase - Postgres database with Row Level Security
- WorkOS - Enterprise SSO and authentication
- Vercel - Hosting and edge computing
- Doppler - Secrets management
- Resend - Transactional email
- Twilio - SMS notifications
- Sentry - Error monitoring and performance tracking
- PostHog - Product analytics
Developer Experience
- pnpm - Fast, disk-efficient package manager
- Turbo - High-performance monorepo build system
- Vitest - Unit and integration testing
- Playwright - End-to-end testing
- ESLint 9 - Code linting with flat config
- Prettier - Code formatting
- Husky - Git hooks
Quick Start
Prerequisites
- Node.js 20+ (via fnm or nvm)
- pnpm 9.14+ (
npm install -g pnpm@9.14.4) - Doppler CLI (optional, for secrets management)
Installation
- Terra at
http://localhost:3000 - Pathfinder at
http://localhost:3001
Environment Setup
Option 1: Doppler (Recommended for Teams)
Option 2: Local .env Files
Required environment variables for Terra:apps/terra/.env.example for complete configuration.
Development
Available Commands
| Command | Description |
|---|---|
pnpm dev | Start all development servers |
pnpm build | Build all apps for production |
pnpm lint | Run ESLint across all apps |
pnpm test | Run all tests in watch mode |
pnpm test:terra | Run Terra tests only |
pnpm test:e2e | Run Playwright E2E tests |
pnpm format | Format code with Prettier |
Working with Specific Apps
Code Quality
We enforce code quality through:- ESLint - Linting with React, TypeScript, and Next.js rules
- Prettier - Consistent code formatting
- TypeScript - Strict type checking
- Husky - Pre-commit hooks for formatting and linting
- Vitest - Unit and integration tests
- Playwright - End-to-end tests
Testing
Unit & Integration Tests
E2E Tests
- 310 passing unit/integration tests (~3.8s runtime)
- E2E tests configured (requires authentication setup to enable)
apps/terra/tests/README.md for E2E testing documentation.
Project Structure
Architecture Highlights
Terra (Form Builder)
- Form Engine: Recursive JSON schema with Zod validation
- Drag-and-Drop: @dnd-kit for intuitive form organization
- Multi-language: I18nString objects for unlimited translations
- Conditional Logic: Dynamic field visibility based on user input
- File Security: Supabase private buckets or Google Drive integration
- RBAC: Row Level Security in Postgres + WorkOS organizations
- White-label: Custom branding per agency (logos, colors, emails)
- Data Access Layer: Repository pattern with soft delete and audit hooks
- Notification Hub: Multi-channel notifications (email + SMS) with templates
Pathfinder (Client Portal)
- Application Tracking: Applicants can view submission status
- Document Management: Upload and manage supporting documents
- Multi-program Support: Browse and apply to multiple programs
- Profile Management: Shared identity across applications
Integrations
- Airtable: Two-way sync with automatic field mapping
- Google Drive: Direct file uploads with permanent URLs
- Plaid: Bank account verification for financial programs
- Webhooks: Outbound webhooks for downstream systems
Security Features
- Auth Guards: Centralized authorization checks for all server actions
- Path Traversal Protection: Sanitized file paths
- Open Redirect Prevention: Safe redirect validation
- XSS Prevention: React escaping + Content Security Policy + DOMPurify
- CSRF Protection: Server actions with token validation
- Rate Limiting: Upstash Redis-based API throttling (required in production)
- Audit Logging: All sensitive operations tracked
- PII Redaction: Automatic PII filtering in logs
CI/CD
GitHub Actions
Our CI pipeline runs on every push and pull request:Deployment
- Production: Automatically deployed via Vercel on merge to
main - Preview: Every PR gets a unique preview URL
- Environment Variables: Managed through Vercel + Doppler
Contributing
Commit Convention
We follow Conventional Commits:Pull Request Process
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes with clear, atomic commits
- Run tests:
pnpm test - Run linter:
pnpm lint - Format code:
pnpm format - Push and create a PR
- Address review feedback
- Merge after approval (squash and merge)
Code Style
- Use TypeScript for all new code
- Follow React best practices (hooks, composition, etc.)
- Write tests for new features
- Add JSDoc comments for complex functions
- Keep components small and focused
- Use semantic HTML and ARIA labels
Technical Debt
We maintain a backlog of technical improvements. Runpnpm --filter terra lint to see current warnings.
Common patterns to address:
- Replace
anywith proper types (@typescript-eslint/no-explicit-any) - Remove unused imports (
@typescript-eslint/no-unused-vars) - Use Next.js
<Image />for image optimization
Resources
Internal Documentation
- Technical Docs - Architecture, decisions, and guides
- Core Concepts - Mental models and system overview
- Local Development - Setup and workflow
- Testing Guide - E2E testing documentation
- Changelog - Release notes
External References
- Supabase Docs - Database and auth
- WorkOS Docs - SSO and SCIM
- Next.js Docs - Framework reference
- Sentry Docs - Error monitoring
License
Proprietary - All rights reservedSupport
For questions or issues:- Internal: Post in #engineering Slack channel
- External: Create a GitHub issue
Built for better government services