Skip to content

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 ​

SurfaceProduction URLWorker NameScope
Public Websitehttps://thebridgefinance.lkthe-bridge-webMultilingual marketing site, calculators, and static CMS consumers
Website CMShttps://thebridgefinance.lk/adminthe-bridge-webAnnouncements, blog articles, download center, and CMS team roles
CRM Portalhttps://crm.thebridgefinance.lkthe-bridge-crmAuthenticated Borrower, Investor, Staff, and Master Admin portals
Email SenderThe Bridge Finance <noreply@thebridgefinance.lk>Resend API6-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"| Resend

Security & Isolation Boundaries ​

  • Public Web Worker (apps/web) binds only to CMS_DB (the-bridge-cms-db) and CMS_ASSETS (the-bridge-cms). Requests to /api/applications/* or /api/admin/crm/* on the public worker return HTTP 403 and direct callers to crm.thebridgefinance.lk.
  • Zero-Data-Handoff Links: Buttons on the public website link to https://crm.thebridgefinance.lk/crm/register with 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 signed crm_sig_ bearer tokens.
  • Website CMS Authentication: Uses dedicated email-and-password authentication at /admin/login separated 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 into the-bridge-db while preserving strict apps/web bundle isolation. IP addresses are SHA-256 hashed and masked (ip_masked) for Sri Lanka PDPA compliance, and analytics read/admin endpoints are strictly restricted to master_admin.

Role Access Matrix ​

RoleEntry RoutePrimary WorkspaceAllowed Operations
Public Visitorhttps://thebridgefinance.lk/enMarketing pages & toolsBrowse loan programs, run EMI & eligibility tools, download public resources
Borrower (applicant)/crm/applicantBorrower PortalProfile setup, 4-step loan application, unlocked Document Vault uploads, EMI schedule & receipts, officer chat, bookings, PWA reminders
Investor (investor)/crm/investorInvestor PortalProfile setup, capital mandate application (up to LKR 20M), monthly WHT yields & PDF statements, reduction/exit requests, officer chat, bookings
Underwriting Staff (staff)/crm/staffStaff Operations DeskAssign 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/adminMaster Admin CockpitFull 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)/adminWebsite CMSFull editorial CRUD (Announcements, Blog & Articles, Download Center) plus Team & Access user management
CMS Writer (writer)/adminWebsite CMSCreate and edit Announcements, Blog & Articles, and Download Center items (no access to /admin/users)

Manual Index ​

  1. 01 — Public Marketing Website Guide
  2. 02 — Borrower / Applicant Portal Manual
  3. 03 — Investor / Capital Partner Portal Manual
  4. 04 — Staff Operations & 360° Underwriting Manual
  5. 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 (port 5175), build the static searchable HTML site with npm run docs:build, and preview with npm run docs:preview.
  • Automated Screenshot Refresh: Run npm run docs:screenshots to launch clean mock Web/CRM dev servers, capture all 26 role-specific desktop and mobile screenshots into docs/images/, and update the embedded visuals.
  • Printable PDF & NotebookLM: Print or export pages directly from the VitePress portal (@media print hides navigation chrome automatically) to produce illustrated client PDFs, and upload both docs/*.md or exported PDFs into NotebookLM for interactive Q&A and slide generation.

The Bridge International Enterprises (Pvt) Ltd.