Angel Campa
Colour theme

WorkThe April wave

GrantPipe

Ran donor management, fund accounting, and federal grant compliance for mid-sized nonprofits in one system, instead of three disconnected tools.

Ran on
Cloudflare
Ran
April 2026 to August 2026
Domain
Nonprofit grant and fund management
Source
nonprofit-grants-saas-grantpipe-snapshot

Built with

  • Astro 6
  • React 19
  • Vite
  • TanStack Router
  • TanStack Query
  • Hono
  • Cloudflare Workers
  • Drizzle
  • PostgreSQL

Hosted services

  • Cloudflare Workers
  • Queues
  • Durable Objects
  • R2
  • D1
  • KV
  • Hyperdrive
  • Browser Rendering
  • Cron Triggers
  • Supabase Postgres
GrantPipe dashboard: an executive snapshot reading "4 overdue grants and no board packet generated", counters for urgent work and deadlines in the next 30 days, and a priority-actions column listing three federal grants with overdue reporting and their due dates
Captured from the local stack against seeded demo data.

The decision

One test failed the build if a retired federal dollar threshold appeared anywhere in the repository. The federal single-audit threshold changed under a 2024 OMB revision. Compliance software’s worst failure mode is a number that used to be right, and a compiler has no opinion about prose.

apps/site/src/audit-threshold-amount.test.ts shelled out to git grep across every tracked file, hunting for the retired figure and failing the build if it reappeared in code, docs, or any of the 1,526 marketing content entries.

The retired figure was never written in the test’s own source; it was reassembled from string fragments at runtime specifically so the test could not match itself, and an allowlist covered the two explainer videos that legitimately taught the before-and-after contrast.

The other half of the same practice was that federal thresholds were stored as data with a citation and an effective date rather than inlined as literals, so a value and its provenance moved together instead of drifting apart.

The same instinct guarded the marketing copy. A test in apps/site reads the product page’s own source and fails the build if strings like “Trusted by,” “customer logo,” or “testimonial” show up anywhere in it, the same build-fails-on-a-false-claim discipline applied to the copy a reader sees first rather than to a compliance figure buried in the product.

Architecture

Three deployables shared one type system: an Astro 6 marketing site, a React 19 SPA, and a Hono API on Cloudflare Workers. The API exported its router type, so the client’s hc<AppType>() call failed to compile the moment a route’s shape changed: no OpenAPI document, no generated SDK, no sync step that could drift. Each of the 37 API domains owned its own routes.ts and service.ts, so a change to how grants worked stayed inside the grants domain.

Beyond request and response, the platform used Cloudflare Queues for async award-letter intake, Durable Objects for coordination, R2 for documents, D1 for marketing data, KV for auth rate limiting, Hyperdrive for Postgres pooling with query caching explicitly disabled, Browser Rendering for server-side PDF generation, and cron triggers for 17 scheduled jobs.

By the numbers

Each figure carries where it came from and when it was measured. Open one to see the command behind it, where the repository recorded a command.

Authored source, excluding generated
250,218 lines across 1,117 files
Provenance

Source portfolio/METRICS.md § Scale

pnpm repo:stats

Measured

Test code
388,074 lines across 905 files (1.55 lines of test per line of source)
Provenance

Source portfolio/METRICS.md § Scale

pnpm repo:stats

Measured

API and data surface
37 API domains, 383 endpoints (142 GET, 139 POST, 53 PATCH, 43 DELETE, 6 PUT), 115 database tables over 95 SQL migrations
Provenance

Source portfolio/METRICS.md § Structure

pnpm repo:stats

Measured

Test cases
18,248 across 905 unit and integration test files, plus 13 Playwright end-to-end specs
Provenance

Source portfolio/METRICS.md § Structure

pnpm repo:stats

Measured

Measured coverage
99.1% to 100% lines across all six workspaces (apps/api, apps/web, apps/site, packages/db, packages/shared, packages/ui)
Provenance

Source portfolio/METRICS.md § Measured coverage

pnpm exec turbo test:coverage --force

Measured

Marketing content
1,526 entries driving the programmatic SEO site
Provenance

Source portfolio/METRICS.md § Structure

Measured

Commit history
4,266 commits, April 7 to August 7, 2026
Provenance

Source portfolio/METRICS.md § Scale

Measured

Agent-committed changes
166 commits carry an explicit "AI Alex" git identity, used when an agent session committed a change on its own rather than during interactive pairing
Provenance

Source portfolio/METRICS.md § Development, by identity

Measured

Screens

Budget Sentinel listing two grants graded "Lapsed Unspent", with the amount at risk and how many days the spend window has been closed
Budget Sentinel classifies every grant and fund at risk of overspending or lapsing unspent, with the amount at stake and how long the window has been closed.
Grant portfolio table: five awards with funder, status badge (Application, Closeout, Active, Reporting), amount, and deadline
Grants and funds are modeled as separate entities joined through grant_fund_allocations, matching how FASB ASC 958 distinguishes an award from the restricted or unrestricted fund it lands in.
Restricted and unrestricted funds with balances and restriction terms
Restriction terms carry allowed-category rules, additions, and releases; releasing restricted money against an ineligible category is a rejected operation, not a footnote in a report three months later.
Double-entry journal: donation entries with sequential reference numbers, dates, memo lines, source tag, and total debits
The double-entry posting engine writes journal entries and lines for donations, expenses, pledge payments, and restriction movements, with sequential journal-entry numbering and fiscal-period awareness.
Read the repositorynonprofit-grants-saas-grantpipe-snapshot

Its portfolio/ directory holds the architecture, metrics and testing documents these figures were taken from.