Projects/GovPass
Government / Compliance✓ Shipped2024

GovPass

Government Visa Application Management System

Replaced paper workflow — 30% error rate → < 2%
Immutable event-sourced audit log (7-year retention)
15+ officer role tiers with RBAC middleware
Fault-tolerant Stripe + Square payment flows
G
800+
Applications/Day
< 2%
Error Rate
15+
Officer Roles
7 years
Audit Retention
01

Problem

Processing visa applications for a government agency with strict regulatory constraints: mandatory document retention, audit trails for every state transition, role-based access across 15+ officer tiers, and zero tolerance for data loss. The existing paper-based workflow processed ~200 applications/day with a 30% error rate from manual data entry.

02

Architecture

State machine driven: each application progresses through a directed acyclic graph of states (submitted → document_review → background_check → approved/rejected). Every transition is an immutable event appended to an audit log — no updates, only inserts. Document processing uses a pipeline: upload → virus scan → OCR extraction → validation → storage with checksums. Role-based access uses a permission matrix evaluated at the middleware layer before any controller logic runs.

03

Trade-offs

Event-sourced audit log means storage grows monotonically and queries against "current state" require projecting from the event stream or maintaining a materialized view. We chose dual-write: event log for compliance + materialized status table for queries. The consistency risk (view vs log divergence) is mitigated by a nightly reconciliation job that flags mismatches.

04

Tech Stack

ReactNode.jsExpressMySQLAWS S3StripeSquareRedis QueuesRBAC MiddlewareSwagger/OpenAPIKnex.js