# rohitvegesna/prosper-finance architecture

> Architecture diagram of the GitHub repository rohitvegesna/prosper-finance, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rohitvegesna/prosper-finance
- Repository: https://github.com/rohitvegesna/prosper-finance
- Video tour (about a minute): https://gitdiagram.com/rohitvegesna/prosper-finance/video

## Overview

This is a multi-tenant finance management web app for tracking insurance policies and investments, viewing portfolio and renewal analytics, and managing tenant users. Users enter through the web client, authenticate, and use protected pages; the server exposes API routes that operate on tenant-scoped records. The excerpts establish the route-to-storage and storage-to-database layers, but do not show the page hooks’ API calls or the internals of the large api/index.ts module, so those connections are not asserted.

Main entry points: [`client/src/App.tsx`](https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/App.tsx) (Client router), [`server/routes.ts`](https://github.com/rohitvegesna/prosper-finance/blob/main/server/routes.ts) (Express API routes), [`server/index.ts`](https://github.com/rohitvegesna/prosper-finance/blob/main/server/index.ts) (HTTP server startup), [`server/storage.ts`](https://github.com/rohitvegesna/prosper-finance/blob/main/server/storage.ts) (Tenant data access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Client router<br/>[App.tsx]"]
  node_authpage["Sign-in and registration<br/>[Login.tsx]"]
  node_dashboard["Dashboard analytics<br/>[Dashboard.tsx]"]
  node_policies["Policy management<br/>[Policies.tsx]"]
  node_investments["Investment management<br/>[Investments.tsx]"]
  node_access["Access management"]
  node_settings["Account settings<br/>[Settings.tsx]"]
  node_layout["Application layout<br/>[Layout.tsx]"]
  node_charts["Dashboard charts"]
  node_query["HTTP query client<br/>[queryClient.ts]"]
end

subgraph group_server["API and services"]
  node_api_entry["API entry module<br/>[index.ts]"]
  node_routes["Express API routes<br/>[routes.ts]"]
  node_server["HTTP server startup<br/>[index.ts]"]
  node_static["Production client serving<br/>[static.ts]"]
  node_vite["Development client serving<br/>[vite.ts]"]
end

subgraph group_domain["Domain and persistence"]
  node_storage["Tenant data access<br/>[storage.ts]"]
  node_db["Database connection<br/>[db.ts]"]
  node_schema["Domain data schema<br/>[schema.ts]"]
  node_authmodel["Session and user model<br/>[auth.ts]"]
  node_contract["API contracts<br/>[routes.ts]"]
end

subgraph group_uploads["Documents"]
  node_uploader["Document uploader<br/>[ObjectUploader.tsx]"]
end

node_user(("Finance user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_authpage
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_policies
node_app -->|"routes to"| node_investments
node_app -->|"routes to"| node_access
node_app -->|"routes to"| node_settings
node_app -->|"provides client"| node_query
node_routes -->|"calls"| node_storage
node_routes -->|"uses route definitions"| node_contract
node_storage -->|"queries"| node_db
node_storage -->|"uses data models"| node_schema
node_schema -->|"re-exports auth"| node_authmodel
node_server -->|"registers routes"| node_routes
node_server -->|"serves production"| node_static
node_server -->|"starts development"| node_vite
node_query -.->|"sends API requests"| node_routes

click node_app "https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/App.tsx"
click node_authpage "https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/pages/Login.tsx"
click node_dashboard "https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/pages/Dashboard.tsx"
click node_policies "https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/pages/Policies.tsx"
click node_investments "https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/pages/Investments.tsx"
click node_access "https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/pages/AccessManagement.tsx"
click node_settings "https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/pages/Settings.tsx"
click node_layout "https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/components/Layout.tsx"
click node_charts "https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/components/analytics/DashboardCharts.tsx"
click node_uploader "https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/components/ObjectUploader.tsx"
click node_query "https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/lib/queryClient.ts"
click node_api_entry "https://github.com/rohitvegesna/prosper-finance/blob/main/api/index.ts"
click node_routes "https://github.com/rohitvegesna/prosper-finance/blob/main/server/routes.ts"
click node_storage "https://github.com/rohitvegesna/prosper-finance/blob/main/server/storage.ts"
click node_db "https://github.com/rohitvegesna/prosper-finance/blob/main/server/db.ts"
click node_schema "https://github.com/rohitvegesna/prosper-finance/blob/main/shared/schema.ts"
click node_authmodel "https://github.com/rohitvegesna/prosper-finance/blob/main/shared/models/auth.ts"
click node_contract "https://github.com/rohitvegesna/prosper-finance/blob/main/shared/routes.ts"
click node_server "https://github.com/rohitvegesna/prosper-finance/blob/main/server/index.ts"
click node_static "https://github.com/rohitvegesna/prosper-finance/blob/main/server/static.ts"
click node_vite "https://github.com/rohitvegesna/prosper-finance/blob/main/server/vite.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_authpage,node_dashboard,node_policies,node_investments,node_access,node_settings,node_layout,node_charts,node_query,node_user toneBlue
class node_api_entry,node_routes,node_server,node_static,node_vite toneAmber
class node_storage,node_db,node_schema,node_authmodel,node_contract toneMint
class node_uploader toneRose
```

## Components

### Web client

- [Client router](https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Sign-in and registration](https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/pages/Login.tsx): `client/src/pages/Login.tsx`
- [Dashboard analytics](https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/pages/Dashboard.tsx): `client/src/pages/Dashboard.tsx`
- [Policy management](https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/pages/Policies.tsx): `client/src/pages/Policies.tsx`
- [Investment management](https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/pages/Investments.tsx): `client/src/pages/Investments.tsx`
- [Access management](https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/pages/AccessManagement.tsx): `client/src/pages/AccessManagement.tsx`
- [Account settings](https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/pages/Settings.tsx): `client/src/pages/Settings.tsx`
- [Application layout](https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/components/Layout.tsx): `client/src/components/Layout.tsx`
- [Dashboard charts](https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/components/analytics/DashboardCharts.tsx): `client/src/components/analytics/DashboardCharts.tsx`
- [HTTP query client](https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/lib/queryClient.ts): `client/src/lib/queryClient.ts`

### API and services

- [API entry module](https://github.com/rohitvegesna/prosper-finance/blob/main/api/index.ts): `api/index.ts`
- [Express API routes](https://github.com/rohitvegesna/prosper-finance/blob/main/server/routes.ts): `server/routes.ts`
- [HTTP server startup](https://github.com/rohitvegesna/prosper-finance/blob/main/server/index.ts): `server/index.ts`
- [Production client serving](https://github.com/rohitvegesna/prosper-finance/blob/main/server/static.ts): `server/static.ts`
- [Development client serving](https://github.com/rohitvegesna/prosper-finance/blob/main/server/vite.ts): `server/vite.ts`

### Domain and persistence

- [Tenant data access](https://github.com/rohitvegesna/prosper-finance/blob/main/server/storage.ts): `server/storage.ts`
- [Database connection](https://github.com/rohitvegesna/prosper-finance/blob/main/server/db.ts): `server/db.ts`
- [Domain data schema](https://github.com/rohitvegesna/prosper-finance/blob/main/shared/schema.ts): `shared/schema.ts`
- [Session and user model](https://github.com/rohitvegesna/prosper-finance/blob/main/shared/models/auth.ts): `shared/models/auth.ts`
- [API contracts](https://github.com/rohitvegesna/prosper-finance/blob/main/shared/routes.ts): `shared/routes.ts`

### Documents

- [Document uploader](https://github.com/rohitvegesna/prosper-finance/blob/main/client/src/components/ObjectUploader.tsx): `client/src/components/ObjectUploader.tsx`

### Other components

- **Finance user**

## Connections

- Finance user → Client router: uses
- Client router → Sign-in and registration: routes to (evidence: `client/src/App.tsx`)
- Client router → Dashboard analytics: routes to (evidence: `client/src/App.tsx`)
- Client router → Policy management: routes to (evidence: `client/src/App.tsx`)
- Client router → Investment management: routes to (evidence: `client/src/App.tsx`)
- Client router → Access management: routes to (evidence: `client/src/App.tsx`)
- Client router → Account settings: routes to (evidence: `client/src/App.tsx`)
- Client router → HTTP query client: provides client (evidence: `client/src/App.tsx`)
- Express API routes → Tenant data access: calls (evidence: `server/routes.ts`)
- Express API routes → API contracts: uses route definitions (evidence: `server/routes.ts`)
- Tenant data access → Database connection: queries (evidence: `server/storage.ts`)
- Tenant data access → Domain data schema: uses data models (evidence: `server/storage.ts`)
- Domain data schema → Session and user model: re-exports auth (evidence: `shared/schema.ts`)
- HTTP server startup → Express API routes: registers routes (evidence: `server/index.ts`)
- HTTP server startup → Production client serving: serves production (evidence: `server/index.ts`)
- HTTP server startup → Development client serving: starts development (evidence: `server/index.ts`)
- HTTP query client → Express API routes: sends API requests
