Right now, "who is this driver, and what do we know about them" has three different answers depending which product you ask: Upahar's Supabase project, Express's separate Postgres, and whatever's cached in GPS Dashboard's browser session. Fintech mobility needs a single honest answer to that question more than any product so far. This page is the current-state audit, the debt inventory, and the investment plan, not a rewrite of everything, but a deliberate sequence of fixes plus one piece of new shared infrastructure.
It does not mean one shared database. The opposite lesson is already sitting in the codebase: Upahar and GPS Dashboard sharing one Supabase project is the single worst-behaved part of the whole stack (debt inventory below). It means:
Today a driver is a phone number, independently a row in Upahar's
drivers table and Express's drivers_table, with no link between them. A
driver who rides for Yango and couriers for Express is, as far as either system knows, two
different people. Item 3 is the specific fix for how GPS Dashboard currently works: reading and
writing Upahar's production tables with a client-side key is the pattern to retire, not extend to
Express or Financing.
postgres_fdw for live cross-service reads,
comfortably covers a data volume in the hundreds of thousands of rows. A full warehouse product
(BigQuery, Snowflake, ClickHouse) and event-driven architecture are both genuinely premature here.
Revisit only if batch latency becomes an actually-felt problem, not preemptively.
Gray: the identity layer and reporting database don't exist yet. This is the target state, not what's running today (see below).
| Product | Repo / org | Database | Status |
|---|---|---|---|
| Upahar | husig-ai/yapigo | Supabase Postgres (Mumbai), shared with GPS Dashboard | Good |
| Express | husig-ai/drivra_express_backend | Self-hosted Postgres 16, own Docker container | Rethink |
| GPS Dashboard | Drivra-Mobility/gps | Upahar's Supabase project, no database of its own | Rethink |
| GPS ETL | trakzee-supabase-etl (not in this workspace) | Writes into Upahar's Supabase project | Good, out of scope |
| Analytics tool | husig-ai/drivra | None, manual CSV upload | Ad hoc |
| Marketing site | Drivra-Mobility/drivra-web | None | Static |
Governance note: repos are split across two GitHub
organizations (husig-ai and Drivra-Mobility) with no single infra-as-code
source of truth visible anywhere. Worth deciding whether that's intentional (agency vs. client
separation) or an artifact of how this got built, before adding a fifth product.
Express's CORS policy is wide open: allow_origins=["*"] combined
with allow_credentials=True. This is a real vulnerability today, independent of the
partner-API work. Any website can make authenticated requests against Express's API from a user's
browser. Fix before building the partner API layer on top of it, not after.
GPS Dashboard has unrestricted, direct, client-side access to Upahar's production tables: a public anon key plus row-level security is the entire access-control boundary. This already caused one incident (below) and is the architectural reason a shared-Supabase pattern is unsafe to extend to a fintech product. Not new: Upahar's own tables had this exact gap, zero RLS, fully open, until a recent migration fixed it. GPS Dashboard is the one place the underlying pattern is still live.
A real production incident: the shared free-tier Supabase project exceeded its 5GB/month egress quota, traced to GPS Dashboard over-polling. Documented in GPS Dashboard's own code comments. This is what "will Supabase scale the way we're using it" concretely means: it already didn't, once.
PostgREST's default 1,000-row response cap silently truncates GPS Dashboard's queries on wide date ranges: a correctness bug, not just a performance one. Wide date-range reports may already be wrong without anyone knowing.
Its Postgres runs in a container with a persistent volume directly on the EC2
instance, the opposite of Upahar's deliberately stateless pattern. No confirmed automated
backup/PITR. If that instance is lost, order/merchant/wallet history goes with it. Urgent enough
to not wait for an RDS migration: a scheduled pg_dump to durable storage closes most
of this risk in an afternoon.
Zero test files anywhere in the repo, versus Upahar's real suite. Combined with the CORS gap and the schema-management issue below, this is the least production-hardened of the three live products. Worth knowing before it's the foundation for point-to-point delivery and partner APIs.
Base.metadata.create_all() and alembic upgrade head, which can silently
diverge from what its own migration history says the schema is.drivers tables, no link, no shared ID.Sorted so the cheap, high-value fixes aren't waiting on the big structural ones. Most of the left column can happen this month without touching the right column at all.
create_all() from startup)tests/ patternpg_dump backup of Express's database today, then schedule it: the single cheapest, most urgent item here, well ahead of any RDS migration timelinepg_dump/restore during a maintenance window is right-sized here (AWS's DMS/logical-replication path is built for 250GB+ databases, well beyond an early-stage delivery app), roughly $15/month for a small Single-AZ instance, likely covered by AWS's 12-month free tier if the account is eligiblepostgres_fdw for live cross-service reads where useful, not a full warehouse productExplicitly not needed yet: Kafka or any event bus, Debezium/CDC, a dedicated warehouse product, or PgBouncer/connection pooling, all genuinely premature at Drivra's current scale. Revisit pooling specifically via AWS RDS Proxy (managed, no new service to run) if and when it's ever needed, not before.
This is the journey the "one source of truth" investment is actually in service of. Every step before financing already exists in some form; financing is the first product that needs all of them working together to underwrite a real decision.
Green: exists today, in some form. Gray: new, part of the Financing build.
Full design for the step this document was actually asked to produce: the rent-to-own financing system.