# srujana728/price-pulse architecture

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

- Interactive diagram: https://gitdiagram.com/srujana728/price-pulse
- Repository: https://github.com/srujana728/price-pulse

## Overview

Price Pulse is a React and Flask dynamic-pricing product. A seller opens the dashboard, enters product pricing factors, requests an AI recommendation, and can apply the resulting price to the dashboard. The backend normalizes inputs and uses a pretrained Random Forest model; product state is kept in browser localStorage rather than a database. The README also describes product catalog management and pricing history. Dashboard implementation was not sampled, so its internal behavior and links are shown only where the README documents them.

Main entry points: [`src/pages/Dashboard.jsx`](https://github.com/srujana728/price-pulse/blob/main/src/pages/Dashboard.jsx) (Product dashboard), [`src/pages/Pricing.jsx`](https://github.com/srujana728/price-pulse/blob/main/src/pages/Pricing.jsx) (Pricing inputs), [`src/App.js`](https://github.com/srujana728/price-pulse/blob/main/src/App.js) (Route dispatch), [`backend/app.py`](https://github.com/srujana728/price-pulse/blob/main/backend/app.py) (Flask prediction API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Seller experience"]
  node_home["Landing page<br/>[Home.jsx]"]
  node_router["Route dispatch<br/>[App.js]"]
  node_login["Demo login<br/>[Login.jsx]"]
  node_dashboard["Product dashboard<br/>[Dashboard.jsx]"]
  node_product_catalog["Product catalog<br/>[Dashboard.jsx]"]
  node_product_table["Product table view<br/>[ProductTable.jsx]"]
  node_dashboard_cards["Dashboard metrics<br/>[DashboardCards.jsx]"]
end

subgraph group_pricing["Pricing workflow"]
  node_pricing_page["Pricing inputs<br/>[Pricing.jsx]"]
  node_prediction_client["Prediction client<br/>[api.js]"]
  node_recommendation["Price recommendation<br/>[Pricing.jsx]"]
  node_price_result["Price result view<br/>[PriceResult.jsx]"]
  node_price_form["Pricing form component<br/>[PriceForm.jsx]"]
end

subgraph group_backend["Prediction backend"]
  node_flask_api["Flask prediction API<br/>[app.py]"]
  node_feature_prep["Feature normalization<br/>[app.py]"]
  node_random_forest["Price model<br/>[price_model.pkl]"]
end

subgraph group_state["Product state"]
  node_browser_storage[("Browser localStorage")]
end

node_seller(("Seller"))

node_seller -->|"opens"| node_home
node_home -->|"navigates"| node_router
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_login
node_router -->|"routes to"| node_dashboard
node_router -->|"routes to"| node_pricing_page
node_seller -->|"signs in"| node_login
node_login -->|"writes demo user"| node_browser_storage
node_seller -->|"manages products"| node_dashboard
node_dashboard -->|"shows products"| node_product_catalog
node_product_catalog -->|"stores product state"| node_browser_storage
node_dashboard -->|"opens pricing"| node_pricing_page
node_pricing_page -->|"requests prediction"| node_prediction_client
node_prediction_client -->|"POSTs prediction"| node_flask_api
node_flask_api -->|"normalizes inputs"| node_feature_prep
node_flask_api -->|"predicts with"| node_random_forest
node_flask_api -->|"returns price"| node_recommendation
node_pricing_page -->|"displays result"| node_recommendation
node_recommendation -->|"applies price"| node_dashboard
node_dashboard -->|"updates product price"| node_browser_storage
node_dashboard -.->|"renders"| node_product_table
node_dashboard -.->|"renders"| node_dashboard_cards
node_pricing_page -.->|"uses inputs"| node_price_form
node_pricing_page -.->|"shows recommendation"| node_price_result

click node_home "https://github.com/srujana728/price-pulse/blob/main/src/pages/Home.jsx"
click node_router "https://github.com/srujana728/price-pulse/blob/main/src/App.js"
click node_login "https://github.com/srujana728/price-pulse/blob/main/src/pages/Login.jsx"
click node_dashboard "https://github.com/srujana728/price-pulse/blob/main/src/pages/Dashboard.jsx"
click node_product_catalog "https://github.com/srujana728/price-pulse/blob/main/src/pages/Dashboard.jsx"
click node_pricing_page "https://github.com/srujana728/price-pulse/blob/main/src/pages/Pricing.jsx"
click node_prediction_client "https://github.com/srujana728/price-pulse/blob/main/src/services/api.js"
click node_flask_api "https://github.com/srujana728/price-pulse/blob/main/backend/app.py"
click node_feature_prep "https://github.com/srujana728/price-pulse/blob/main/backend/app.py"
click node_random_forest "https://github.com/srujana728/price-pulse/blob/main/backend/price_model.pkl"
click node_recommendation "https://github.com/srujana728/price-pulse/blob/main/src/pages/Pricing.jsx"
click node_product_table "https://github.com/srujana728/price-pulse/blob/main/src/components/ProductTable.jsx"
click node_dashboard_cards "https://github.com/srujana728/price-pulse/blob/main/src/components/DashboardCards.jsx"
click node_price_result "https://github.com/srujana728/price-pulse/blob/main/src/components/PriceResult.jsx"
click node_price_form "https://github.com/srujana728/price-pulse/blob/main/src/components/PriceForm.jsx"

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_home,node_router,node_login,node_dashboard,node_product_catalog,node_product_table,node_dashboard_cards toneBlue
class node_pricing_page,node_prediction_client,node_recommendation,node_price_result,node_price_form toneAmber
class node_flask_api,node_feature_prep,node_random_forest toneMint
class node_browser_storage toneRose
class node_seller toneIndigo
```

## Components

### Seller experience

- [Landing page](https://github.com/srujana728/price-pulse/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Route dispatch](https://github.com/srujana728/price-pulse/blob/main/src/App.js): `src/App.js`
- [Demo login](https://github.com/srujana728/price-pulse/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Product dashboard](https://github.com/srujana728/price-pulse/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Product catalog](https://github.com/srujana728/price-pulse/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Product table view](https://github.com/srujana728/price-pulse/blob/main/src/components/ProductTable.jsx): `src/components/ProductTable.jsx`
- [Dashboard metrics](https://github.com/srujana728/price-pulse/blob/main/src/components/DashboardCards.jsx): `src/components/DashboardCards.jsx`

### Pricing workflow

- [Pricing inputs](https://github.com/srujana728/price-pulse/blob/main/src/pages/Pricing.jsx): `src/pages/Pricing.jsx`
- [Prediction client](https://github.com/srujana728/price-pulse/blob/main/src/services/api.js): `src/services/api.js`
- [Price recommendation](https://github.com/srujana728/price-pulse/blob/main/src/pages/Pricing.jsx): `src/pages/Pricing.jsx`
- [Price result view](https://github.com/srujana728/price-pulse/blob/main/src/components/PriceResult.jsx): `src/components/PriceResult.jsx`
- [Pricing form component](https://github.com/srujana728/price-pulse/blob/main/src/components/PriceForm.jsx): `src/components/PriceForm.jsx`

### Prediction backend

- [Flask prediction API](https://github.com/srujana728/price-pulse/blob/main/backend/app.py): `backend/app.py`
- [Feature normalization](https://github.com/srujana728/price-pulse/blob/main/backend/app.py): `backend/app.py`
- [Price model](https://github.com/srujana728/price-pulse/blob/main/backend/price_model.pkl): `backend/price_model.pkl`

### Product state

- **Browser localStorage**

### Other components

- **Seller**

## Connections

- Seller → Landing page: opens (evidence: `src/pages/Home.jsx`)
- Landing page → Route dispatch: navigates (evidence: `src/pages/Home.jsx`)
- Route dispatch → Landing page: routes to (evidence: `src/App.js`)
- Route dispatch → Demo login: routes to (evidence: `src/App.js`)
- Route dispatch → Product dashboard: routes to (evidence: `src/App.js`)
- Route dispatch → Pricing inputs: routes to (evidence: `src/App.js`)
- Seller → Demo login: signs in (evidence: `src/pages/Login.jsx`)
- Demo login → Browser localStorage: writes demo user (evidence: `src/pages/Login.jsx`)
- Seller → Product dashboard: manages products (evidence: `README.md`)
- Product dashboard → Product catalog: shows products (evidence: `README.md`)
- Product catalog → Browser localStorage: stores product state (evidence: `README.md`)
- Product dashboard → Pricing inputs: opens pricing (evidence: `README.md`)
- Pricing inputs → Prediction client: requests prediction (evidence: `src/pages/Pricing.jsx`)
- Prediction client → Flask prediction API: POSTs prediction (evidence: `src/services/api.js`)
- Flask prediction API → Feature normalization: normalizes inputs (evidence: `backend/app.py`)
- Flask prediction API → Price model: predicts with (evidence: `backend/app.py`)
- Flask prediction API → Price recommendation: returns price (evidence: `backend/app.py`)
- Pricing inputs → Price recommendation: displays result (evidence: `src/pages/Pricing.jsx`)
- Price recommendation → Product dashboard: applies price (evidence: `README.md`)
- Product dashboard → Browser localStorage: updates product price (evidence: `README.md`)
- Product dashboard → Product table view: renders
- Product dashboard → Dashboard metrics: renders
- Pricing inputs → Pricing form component: uses inputs
- Pricing inputs → Price result view: shows recommendation
