How chiragkv-juspay/finternet-web works
Project type and purpose
• This is a single‐page, mobile‐first web application built in ReScript (ReasonReact) that compiles to JavaScript, bundled by Vite, styled with Tailwind.
• Its purpose is to deliver various financial flows (user onboarding, banking transfers, loan applications, property tokenization) via a unified mobile UI.
Main components of the system
a. Build & Deployment
• Source Code (src/**/*.res)
• ReScript Compiler (rescript.json + npm scripts)
• Vite (vite.config.mjs) for bundling, HMR, asset handling
• Tailwind/PostCSS (tailwind.config.js, postcss.config.js) for styling
• Output: static files (index.html, JS/CSS bundles in “public” or “dist”)
• Hosting: CDN or static‐site host (e.g., Netlify, Vercel)
b. Client Runtime (in the user’s browser)
• index.html loads the ReScript‐generated bundle
• App Context (src/Context/AppContext) provides global state via React Context
• UI Components (src/Components) present reusable elements (Accordion, Cards, Headers, Modals, etc.)
• Screen Modules (src/MobileScreens, src/Screens) implement complete flows (Login, Onboarding, Money Transfer, Loan Against Property, Property User Onboarding, Dashboard)
• Types (src/Types) define domain models and API contracts (WebApiTypes, SimpleWebAuthnTypes)
c. External Services
• Backend APIs (REST/GraphQL endpoints for banking, identity, loan underwriting, property tokenization)
• Authentication Provider (WebAuthn via SimpleWebAuthnTypes)
• Third‐party services for QR codes, credentials attestations, etc.
Relationships and data flows
• Build & Deployment → produces a static asset bundle → served to Client Runtime
• Client Runtime ↔ Backend APIs: data fetch, submit transactions, authentication flows
• Context manages state transitions triggered by UI Components
• UI Components consume Types and Utilities to render data and handle interactions
Architectural patterns and design principles
• Component‐Based UI: each .res file is a self‐contained React component
• Unidirectional Data Flow: React Context + props drilling for state propagation
• Layered structure:
• Presentation Layer (Components & Screens)
• State Management Layer (Context)
• Domain Layer (Types & Utilities)
• Integration Layer (API calls in Utilities or custom hooks)
• Separation of Concerns: styling, logic, types, assets all in dedicated directories