Appearance
The Bridge Finance — Platform Documentation
The Bridge Finance (The Bridge International Enterprises (Pvt) Ltd.) operates an isolated multi-worker fintech platform built on React, Vite, Hono, and Cloudflare Workers. This docs/ suite serves as the canonical manual for operations teams, clients, developers, and NotebookLM Q&A workspaces.
Production Domains
| Surface | Production URL | Worker Name | Scope |
|---|---|---|---|
| Public Website | https://thebridgefinance.lk | the-bridge-web | Multilingual marketing site, calculators, and static CMS consumers |
| Website CMS | https://thebridgefinance.lk/admin | the-bridge-web | Announcements, blog articles, download center, and CMS team roles |
| CRM Portal | https://crm.thebridgefinance.lk | the-bridge-crm | Authenticated Borrower, Investor, Staff, and Master Admin portals |
| Email Sender | The Bridge Finance <noreply@thebridgefinance.lk> | Resend API | 6-digit OTP login codes and welcome onboarding emails |
Architecture Overview (Pattern B Isolation)
The platform physically isolates public marketing traffic from borrower and investor Personally Identifiable Information (PII):
mermaid
flowchart LR
Visitor["Public Visitor / Borrower / Investor"]
Web["Public Website + CMS Worker<br/>(thebridgefinance.lk)"]
CRM["Isolated CRM Portal Worker<br/>(crm.thebridgefinance.lk)"]
CmsDB[("CMS D1 + R2<br/>the-bridge-cms-db / the-bridge-cms")]
CrmDB[("Core CRM D1 + R2<br/>the-bridge-db / bridge-crm-doc")]
Resend["Resend Email API<br/>(noreply@thebridgefinance.lk)"]
Visitor -->|"Marketing, Tools, Blog, Login/Apply Link"| Web
Web -->|"Reads/Writes Public CMS Content"| CmsDB
Web -.->|"Zero-Data-Handoff Link (/crm/register)<br/>Blocks /api/applications/* & /api/admin/crm/* (HTTP 403)"| CRM
Visitor -->|"OTP Auth, Applications, KYC Vault, Payouts, Admin"| CRM
CRM -->|"HMAC Auth, Dossiers, EMI & Mandates, Documents"| CrmDB
CRM -->|"OTP & Welcome Emails"| ResendSecurity & Isolation Boundaries
- Public Web Worker (
apps/web) binds only toCMS_DB(the-bridge-cms-db) andCMS_ASSETS(the-bridge-cms). Requests to/api/applications/*or/api/admin/crm/*on the public worker return HTTP403and direct callers tocrm.thebridgefinance.lk. - Zero-Data-Handoff Links: Buttons on the public website link to
https://crm.thebridgefinance.lk/crm/registerwith no user PII in query strings. - CRM Authentication: Uses 6-digit email OTP verification (
POST /api/crm/auth/send-otp,POST /api/crm/auth/verify-otp) and issues HMAC-SHA256 signedcrm_sig_bearer tokens. - Website CMS Authentication: Uses dedicated email-and-password authentication at
/admin/loginseparated from CRM OTP sessions. - Cross-Surface Access Telemetry (
POST /api/analytics/collect): Both Public Website (surface="web") and CRM Portal (surface="crm") emit zero-PII telemetry events intothe-bridge-dbwhile preserving strictapps/webbundle isolation. IP addresses are SHA-256 hashed and masked (ip_masked) for Sri Lanka PDPA compliance, and analytics read/admin endpoints are strictly restricted tomaster_admin.
Role Access Matrix
| Role | Entry Route | Primary Workspace | Allowed Operations |
|---|---|---|---|
| Public Visitor | https://thebridgefinance.lk/en | Marketing pages & tools | Browse loan programs, run EMI & eligibility tools, download public resources |
Borrower (applicant) | /crm/applicant | Borrower Portal | Profile setup, 4-step loan application, unlocked Document Vault uploads, EMI schedule & receipts, officer chat, bookings, PWA reminders |
Investor (investor) | /crm/investor | Investor Portal | Profile setup, capital mandate application (up to LKR 20M), monthly WHT yields & PDF statements, reduction/exit requests, officer chat, bookings |
Underwriting Staff (staff) | /crm/staff | Staff Operations Desk | Assign leads, review Borrower 360° & Investor 360° dossiers, verify documents, approve loans with custom First EMI Due Date, mark payments, reset/delete EMI schedules, manage bookings & chat |
Master Admin (master_admin) | /crm/admin | Master Admin Cockpit | Full Staff Operations parity plus KPI Summary, Access Analytics (/crm/admin#analytics: Marketing Intelligence, Security & Threat Center, UI/UX & Performance Lab, Live Access Logs, and Watch Rules CRUD), Staff Management (RBAC CRUD + MASTER_ADMIN_EMAILS anti-lockout guards), Loan Policies & Limits, and Security & Audit Trail |
CMS Main Admin (main_admin) | /admin | Website CMS | Full editorial CRUD (Announcements, Blog & Articles, Download Center) plus Team & Access user management |
CMS Writer (writer) | /admin | Website CMS | Create and edit Announcements, Blog & Articles, and Download Center items (no access to /admin/users) |
Manual Index
- 01 — Public Marketing Website Guide
- 02 — Borrower / Applicant Portal Manual
- 03 — Investor / Capital Partner Portal Manual
- 04 — Staff Operations & 360° Underwriting Manual
- 05 — Master Admin & Website CMS Manual
(Internal engineering operations runbooks and handover checklists remain stored locally in the repository for owners and npm run docs:dev, and are automatically excluded from public static web builds.)
Using This Documentation
- VitePress Web Documentation Portal: Launch locally with
npm run docs:dev(port5175), build the static searchable HTML site withnpm run docs:build, and preview withnpm run docs:preview. - Automated Screenshot Refresh: Run
npm run docs:screenshotsto launch clean mock Web/CRM dev servers, capture all 26 role-specific desktop and mobile screenshots intodocs/images/, and update the embedded visuals. - Printable PDF & NotebookLM: Print or export pages directly from the VitePress portal (
@media printhides navigation chrome automatically) to produce illustrated client PDFs, and upload bothdocs/*.mdor exported PDFs into NotebookLM for interactive Q&A and slide generation.
