# prathamesh3245/venturepulse architecture

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

- Interactive diagram: https://gitdiagram.com/prathamesh3245/venturepulse
- Repository: https://github.com/prathamesh3245/venturepulse

## Overview

1. **Repo shape: a hybrid monorepo**
   This repository combines three distinct layers: a React frontend, a Node/Express backend for authentication and API handling, and a Python/modeling layer for financial prediction and analysis. The persistent store is MongoDB, and the runtime boundaries are clearly split between browser UI, API server, and ML code.

2. **Primary user interface: `frontend/`**
   The main product UI is a Vite-based React SPA. `frontend/src` contains the app shell, auth flows, landing page, dashboards, startup detail views, due diligence screens, financial upload, predictive insights, and investment tracking components. `AuthContext.jsx` is the main client-side state boundary for authenticated user session data.

3. **Frontend data flow**
   The React app is the entry point for users. It collects credentials, sends them to backend auth endpoints, stores/uses the JWT session, and then routes users into role-specific dashboards. Feature screens such as `PredictiveInsights`, `FinancialUpload`, and `DueDiligencePipeline` act as UI clients to backend APIs rather than holding business logic themselves.

4. **Authentication and authorization subsystem**
   The README describes a role-based auth model with two user types: `investment_banker` and `startup`. Registration is split into separate endpoints, login is shared, and `GET /api/auth/me` exposes the current user. Authorization is enforced through JWTs and by checking role-specific verification fields such as SEBI registration or startup platform IDs.

5. **Core backend API**
   The backend is a Node/Express service at the repository root, backed by MongoDB via Mongoose and secured with bcrypt and JWT. The API exposes auth routes, protected dashboard routes, and the `/getPredict` prediction endpoint. Environment variables define the MongoDB URI, JWT secret, and server port, so the backend is the main trust and access-control boundary.

6. **Domain-specific verification rules**
   Investment bankers must provide a SEBI registration number, while startups must provide a government startup ID. The README shows placeholder verification endpoints for SEBI and startup registry checks; in the current repo these appear to be validation and status-tracking hooks, with real external verification still planned.

7. **Python / ML subsystem**
   The Python files and notebooks form the model-development and experimentation layer. `simple_xgb_regressor.py`, `banker_app.py`, and notebooks like `XGBoost.ipynb`, `venture_pulse_preprocessing.ipynb`, and `financial_metrics.ipynb` suggest a workflow for preprocessing financial data, training an XGBoost-style model, and evaluating metrics. This layer is separate from the frontend and auth stack and likely feeds the prediction API.

8. **Prediction pipeline boundary**
   The `/getPredict` endpoint is the main integration point between the web backend and ML logic. Requests carry numeric feature vectors, the backend authenticates the caller, and the model layer produces a prediction response. In architecture terms, this is the key synchronous business workflow after login.

9. **Legacy Express app under `app/`**
   There is also an older Express-generator-style application in `app/` with Jade views, public JS/CSS, and route files. It looks like a server-rendered scaffold that may be legacy, auxiliary, or an earlier iteration of the product. For diagramming, treat it as a secondary UI/backend shell unless you confirm it is still mounted in production.

10. **Data assets and offline analysis**
    The Excel files in the repo root and the startup datasets under `frontend/src/data` are inputs for analysis, UI listing, and model experimentation. These are not runtime services; they support preprocessing, feature engineering, and sample data presentation. The notebooks and dataset files are part of the offline analytics pipeline rather than the live application path.

Main entry points: [`frontend/src/main.jsx`](https://github.com/prathamesh3245/venturepulse/blob/main/frontend/src/main.jsx) (React app), [`app/routes/index.js`](https://github.com/prathamesh3245/venturepulse/blob/main/app/routes/index.js) (Auth routes), [`app/routes/users.js`](https://github.com/prathamesh3245/venturepulse/blob/main/app/routes/users.js) (Protected APIs), [`index.js`](https://github.com/prathamesh3245/venturepulse/blob/main/index.js) (API server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend SPA"]
  node_frontend_app["React app<br/>Vite React SPA<br/>[main.jsx]"]
  node_frontend_auth(("Auth context<br/>client state<br/>[AuthContext.jsx]"))
  node_frontend_login["Login & register<br/>auth UI<br/>[Login.jsx]"]
  node_frontend_dashboards["Dashboards<br/>role views"]
  node_frontend_features["Feature screens<br/>ui clients"]
  node_frontend_startups["Startup views<br/>listing/detail UI"]
end

subgraph group_backend["API Backend"]
  node_backend_server["API server<br/>Express backend<br/>[index.js]"]
  node_backend_auth["Auth routes<br/>JWT auth<br/>[index.js]"]
  node_backend_protected["Protected APIs<br/>dashboard API<br/>[users.js]"]
  node_backend_predict{{"Predict endpoint<br/>model API<br/>[index.js]"}}
  node_backend_db[("Mongo layer<br/>mongoose data<br/>[database.js]")]
end

subgraph group_legacy["Legacy App"]
  node_legacy_app["Legacy app<br/>server-rendered app"]
  node_legacy_routes["Legacy routes<br/>Express routes<br/>[index.js]"]
end

subgraph group_ml["ML Layer"]
  node_ml_model{{"XGBoost model<br/>python model"}}
  node_ml_preprocess["Preprocessing<br/>data prep"]
  node_ml_apps["ML apps<br/>python tools<br/>[banker_app.py]"]
end

subgraph group_data["Data Assets"]
  node_offline_data[("Datasets<br/>spreadsheets")]
end

node_frontend_app -->|"session"| node_frontend_auth
node_frontend_app -->|"auth UI"| node_frontend_login
node_frontend_app -->|"role views"| node_frontend_dashboards
node_frontend_app -->|"feature routes"| node_frontend_features
node_frontend_app -->|"browse"| node_frontend_startups
node_frontend_login -->|"credentials"| node_backend_auth
node_frontend_auth -->|"JWT"| node_backend_auth
node_frontend_features -->|"api calls"| node_backend_protected
node_frontend_features -->|"predict"| node_backend_predict
node_frontend_dashboards -->|"dashboard data"| node_backend_protected
node_backend_server -->|"mounts"| node_backend_auth
node_backend_server -->|"mounts"| node_backend_protected
node_backend_server -->|"serves"| node_backend_predict
node_backend_auth -->|"persist"| node_backend_db
node_backend_protected -->|"read/write"| node_backend_db
node_backend_predict -->|"inference"| node_ml_model
node_ml_model -.->|"trained from"| node_ml_preprocess
node_ml_preprocess -->|"inputs"| node_offline_data
node_ml_apps -.->|"experiments"| node_ml_model
node_legacy_app -->|"routes"| node_legacy_routes
node_legacy_routes -.->|"shared store"| node_backend_db

click node_frontend_app "https://github.com/prathamesh3245/venturepulse/blob/main/frontend/src/main.jsx"
click node_frontend_auth "https://github.com/prathamesh3245/venturepulse/blob/main/frontend/src/context/AuthContext.jsx"
click node_frontend_login "https://github.com/prathamesh3245/venturepulse/blob/main/frontend/src/Components/Auth/Login.jsx"
click node_frontend_dashboards "https://github.com/prathamesh3245/venturepulse/blob/main/frontend/src/Components/dashboards/BankerDashboard.jsx"
click node_frontend_features "https://github.com/prathamesh3245/venturepulse/blob/main/frontend/src/Components/PredictiveInsights.jsx"
click node_frontend_startups "https://github.com/prathamesh3245/venturepulse/blob/main/frontend/src/Components/Startupdetailpage.jsx"
click node_backend_server "https://github.com/prathamesh3245/venturepulse/blob/main/index.js"
click node_backend_auth "https://github.com/prathamesh3245/venturepulse/blob/main/app/routes/index.js"
click node_backend_protected "https://github.com/prathamesh3245/venturepulse/blob/main/app/routes/users.js"
click node_backend_predict "https://github.com/prathamesh3245/venturepulse/blob/main/index.js"
click node_backend_db "https://github.com/prathamesh3245/venturepulse/blob/main/config/database.js"
click node_legacy_app "https://github.com/prathamesh3245/venturepulse/tree/main/app/bin/www"
click node_legacy_routes "https://github.com/prathamesh3245/venturepulse/blob/main/app/routes/index.js"
click node_ml_model "https://github.com/prathamesh3245/venturepulse/blob/main/simple_xgb_regressor.py"
click node_ml_preprocess "https://github.com/prathamesh3245/venturepulse/blob/main/venture_pulse_preprocessing.ipynb"
click node_ml_apps "https://github.com/prathamesh3245/venturepulse/blob/main/banker_app.py"
click node_offline_data "https://github.com/prathamesh3245/venturepulse/blob/main/Final_Financial_Dataset_Practical.xlsx"

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_frontend_app,node_frontend_auth,node_frontend_login,node_frontend_dashboards,node_frontend_features,node_frontend_startups toneBlue
class node_backend_server,node_backend_auth,node_backend_protected,node_backend_predict,node_backend_db toneAmber
class node_legacy_app,node_legacy_routes toneMint
class node_ml_model,node_ml_preprocess,node_ml_apps toneRose
class node_offline_data toneIndigo
```

## Components

### Frontend SPA

React/Vite client application and UI state

- [React app](https://github.com/prathamesh3245/venturepulse/blob/main/frontend/src/main.jsx): Vite React SPA · Main browser application shell and route entrypoint. · `frontend/src/main.jsx`
- [Auth context](https://github.com/prathamesh3245/venturepulse/blob/main/frontend/src/context/AuthContext.jsx): client state · Holds authenticated session state and user identity in the browser. · `frontend/src/context/AuthContext.jsx`
- [Login & register](https://github.com/prathamesh3245/venturepulse/blob/main/frontend/src/Components/Auth/Login.jsx): auth UI · Client-side screens for registration and sign-in. · `frontend/src/Components/Auth/Login.jsx`
- [Dashboards](https://github.com/prathamesh3245/venturepulse/blob/main/frontend/src/Components/dashboards/BankerDashboard.jsx): role views · Role-specific banker and startup dashboard screens. · `frontend/src/Components/dashboards/BankerDashboard.jsx`
- [Feature screens](https://github.com/prathamesh3245/venturepulse/blob/main/frontend/src/Components/PredictiveInsights.jsx): ui clients · Due diligence, financial upload, predictive insights, and investment tracking UI surfaces. · `frontend/src/Components/PredictiveInsights.jsx`
- [Startup views](https://github.com/prathamesh3245/venturepulse/blob/main/frontend/src/Components/Startupdetailpage.jsx): listing/detail UI · Startup listing and detail pages used for browsing and inspection. · `frontend/src/Components/Startupdetailpage.jsx`

### API Backend

Node/Express trust boundary for auth, dashboards, and prediction access

- [API server](https://github.com/prathamesh3245/venturepulse/blob/main/index.js): Express backend · Main Node/Express service coordinating auth, protected routes, and prediction requests. · `index.js`
- [Auth routes](https://github.com/prathamesh3245/venturepulse/blob/main/app/routes/index.js): JWT auth · Registration, login, me, and role-based verification endpoints. · `app/routes/index.js`
- [Protected APIs](https://github.com/prathamesh3245/venturepulse/blob/main/app/routes/users.js): dashboard API · Authenticated backend endpoints for dashboard and user-specific data access. · `app/routes/users.js`
- [Predict endpoint](https://github.com/prathamesh3245/venturepulse/blob/main/index.js): model API · Synchronous prediction entrypoint for feature vectors from the UI. · `index.js`
- [Mongo layer](https://github.com/prathamesh3245/venturepulse/blob/main/config/database.js): mongoose data · Database connection and persistence boundary for users and app data. · `config/database.js`

### Legacy App

Older Express-generator style server-rendered app

- [Legacy app](https://github.com/prathamesh3245/venturepulse/tree/main/app/bin/www): server-rendered app · Older Express-generator style application with Jade views and public assets. · `app/bin/www`
- [Legacy routes](https://github.com/prathamesh3245/venturepulse/blob/main/app/routes/index.js): Express routes · Older server-side route handlers and scaffolded page responses. · `app/routes/index.js`

### ML Layer

Python modeling, preprocessing, and experimentation

- [XGBoost model](https://github.com/prathamesh3245/venturepulse/blob/main/simple_xgb_regressor.py): python model · Training and inference code for financial prediction experiments. · `simple_xgb_regressor.py`
- [Preprocessing](https://github.com/prathamesh3245/venturepulse/blob/main/venture_pulse_preprocessing.ipynb): data prep · Notebook-based cleaning, feature engineering, and metric exploration. · `venture_pulse_preprocessing.ipynb`
- [ML apps](https://github.com/prathamesh3245/venturepulse/blob/main/banker_app.py): python tools · Auxiliary Python application and experimentation scripts. · `banker_app.py`

### Data Assets

Offline spreadsheets and startup datasets used for analysis and modeling

- [Datasets](https://github.com/prathamesh3245/venturepulse/blob/main/Final_Financial_Dataset_Practical.xlsx): spreadsheets · Financial workbook inputs and sample startup data used offline for analysis and modeling. · `Final_Financial_Dataset_Practical.xlsx`

## Connections

- React app → Auth context: session · App shell reads and updates authenticated user state.
- React app → Login & register: auth UI · Routes users into registration and login flows.
- React app → Dashboards: role views · Opens banker or startup dashboard after authentication.
- React app → Feature screens: feature routes · Navigates to due diligence, uploads, predictions, and tracking screens.
- React app → Startup views: browse · Shows startup lists and detail pages.
- Login & register → Auth routes: credentials · Submits registration and login requests to auth endpoints.
- Auth context → Auth routes: JWT · Uses token-backed session to call current-user and verification APIs.
- Feature screens → Protected APIs: api calls · Feature screens consume protected backend data and workflow endpoints.
- Feature screens → Predict endpoint: predict · Uploads numeric inputs for prediction requests.
- Dashboards → Protected APIs: dashboard data · Loads role-specific data behind authentication.
- API server → Auth routes: mounts · Hosts authentication and registration route handlers.
- API server → Protected APIs: mounts · Hosts protected dashboard and user endpoints.
- API server → Predict endpoint: serves · Exposes the prediction API as part of the main backend.
- Auth routes → Mongo layer: persist · Stores users, roles, and verification state in MongoDB.
- Protected APIs → Mongo layer: read/write · Reads authenticated application data from the database layer.
- Predict endpoint → XGBoost model: inference · Delegates prediction work to the modeling layer.
- XGBoost model → Preprocessing: trained from · Model development depends on preprocessing and metric notebooks.
- Preprocessing → Datasets: inputs · Notebook workflows consume workbook and startup dataset files.
- ML apps → XGBoost model: experiments · Auxiliary Python app code and scripts support model experimentation.
- Legacy app → Legacy routes: routes · Legacy server renders pages through older route handlers.
- Legacy routes → Mongo layer: shared store · Legacy scaffold can also persist through the common database boundary.
