Offline-first fintech wallet & bookkeeping platform for African market traders π¬π
# π¦ CashBridge Sandbox Portal
> **Production-Ready Offline-First Wallet & Bookkeeping App for African Informal Markets**
>
> CashBridge bridges Ghanaian market women, informal traders, and mobile money agents with stable payment rails (MTN MoMo, Paystack) and local-first data indexing, surviving any internet disruption gracefully.
---
## ποΈ Core Architecture Overview
CashBridge is structured intentionally into two completely independent projects to preserve separation of concerns, allow clean horizontal autoscaling, and target distinct deployment runtimes:
```
ββββββββββββββββββββββββββββββββββββββββββββββββ
β CASHBRIDGE CLIENT DESKTOP / PWA β
β (React 19 + Zustand state + IndexedDB local)β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
[Pushes Queued Local Transactions]
[Retrieves Real-time Mobile Balance]
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββ
β EXPRESS.JS BACKEND RUNTIME β
β (Secured by Helmet, Rate-Limit & JWT) β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
ββββββββββββββββββββββββ΄βββββββββββββββββββββββ
βΌ βΌ
ββββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββ
β SUPABASE POSTGRES DB β β THIRD-PARTY PAYMENT INGRESS β
β (RLS protection, triggers) β β (MTN MoMo Sandbox, Paystack) β
ββββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββ
```
---
## π Separated Directory Layouts
### π’ 1. CashBridge Frontend (`cashbridge-frontend`)
A lightweight, mobile-first PWA serving interface components instantly.
```
cashbridge-frontend/
βββ public/
β βββ sw.js # PWA Service Worker caching core assets & shell
β βββ manifest.json # Webapp installation parameters for mobile screens
βββ src/
β βββ db/
β β βββ localDb.ts # IndexedDB wrapper for local transaction queues
β βββ hooks/
β β βββ useOfflineSync.ts # Network stat β¦