# anveshna25/centflow architecture

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

- Interactive diagram: https://gitdiagram.com/anveshna25/centflow
- Repository: https://github.com/anveshna25/centflow

## Overview

CentFlow is a market-intelligence web application. Users authenticate, navigate market, watchlist, and portfolio views, inspect assets, and request market data and analytics through the frontend API client and FastAPI backend. Market-data requests can discover instruments and persist quote or historical-price observations; analytics and portfolio features are distinct product branches. The README describes the product at a high level; several route and service implementations were not sampled, so links for those branches are omitted or marked unverified rather than inferred as concrete calls.

Main entry points: [`frontend/src/api/client.js`](https://github.com/anveshna25/centflow/blob/main/frontend/src/api/client.js) (API client), [`backend/app/api/router.py`](https://github.com/anveshna25/centflow/blob/main/backend/app/api/router.py) (API router), [`frontend/src/App.jsx`](https://github.com/anveshna25/centflow/blob/main/frontend/src/App.jsx) (App and page routing), [`backend/app/services/ingestion.py`](https://github.com/anveshna25/centflow/blob/main/backend/app/services/ingestion.py) (Market ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["App and page routing<br/>[App.jsx]"]
  node_authui["Authentication UI<br/>[AuthContext.jsx]"]
  node_api_client["API client<br/>[client.js]"]
  node_market_pages["Markets and asset views<br/>[MarketsPage.jsx]"]
  node_portfolio_page["Portfolio view<br/>[PortfoliosPage.jsx]"]
  node_watchlist_page["Watchlist view<br/>[WatchlistsPage.jsx]"]
  node_asset_detail["Asset detail"]
  node_price_chart["Price chart<br/>[PriceChart.jsx]"]
end

subgraph group_api["API surface"]
  node_api_router["API router<br/>[router.py]"]
  node_market_routes["Market data routes<br/>[market_data.py]"]
  node_analytics_routes["Analytics routes<br/>[analytics.py]"]
  node_portfolio_routes["Portfolio routes<br/>[portfolios.py]"]
  node_watchlist_routes["Watchlist routes<br/>[watchlist.py]"]
  node_auth_routes["Authentication routes<br/>[auth.py]"]
end

subgraph group_market["Market data"]
  node_ingestion["Market ingestion<br/>[ingestion.py]"]
  node_market_service["Market data service<br/>[market_data.py]"]
  node_provider["Provider integration<br/>[base.py]"]
  node_instrument_repo["Instrument repository<br/>[instrument.py]"]
  node_price_repo["Price repository<br/>[price.py]"]
end

subgraph group_insights["Analytics and investing"]
  node_analytics_service["Analytics service<br/>[analytics.py]"]
  node_analytics_calc["Analytics calculations<br/>[calculations.py]"]
  node_indicators["Technical indicators<br/>[indicators.py]"]
end

subgraph group_identity["Identity and persistence"]
  node_auth_service["Authentication service<br/>[auth.py]"]
  node_google_auth["Google authentication<br/>[google_auth.py]"]
  node_user_store[("User and session records<br/>[user.py]")]
  node_db_session["Database session<br/>[session.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_market_pages
node_app -->|"routes to"| node_portfolio_page
node_app -->|"routes to"| node_watchlist_page
node_app -->|"opens"| node_asset_detail
node_market_pages -.->|"requests data"| node_api_client
node_portfolio_page -->|"requests data"| node_api_client
node_watchlist_page -->|"requests data"| node_api_client
node_asset_detail -->|"requests data"| node_api_client
node_asset_detail -->|"renders"| node_price_chart
node_api_client -.->|"HTTP requests"| node_market_routes
node_api_client -.->|"HTTP requests"| node_analytics_routes
node_api_client -.->|"HTTP requests"| node_portfolio_routes
node_api_client -.->|"HTTP requests"| node_watchlist_routes
node_api_router -->|"registers"| node_market_routes
node_api_router -->|"registers"| node_analytics_routes
node_api_router -->|"registers"| node_portfolio_routes
node_api_router -->|"registers"| node_watchlist_routes
node_api_router -->|"registers"| node_auth_routes
node_market_routes -->|"calls"| node_ingestion
node_market_routes -->|"calls"| node_market_service
node_ingestion -->|"queries"| node_market_service
node_ingestion -->|"persists instruments"| node_instrument_repo
node_ingestion -->|"persists prices"| node_price_repo
node_market_service -.->|"uses provider"| node_provider
node_analytics_routes -.->|"calls"| node_analytics_service
node_analytics_service -.->|"calculates"| node_analytics_calc
node_analytics_calc -.->|"uses"| node_indicators
node_auth_routes -->|"calls"| node_auth_service
node_auth_routes -.->|"calls"| node_google_auth
node_auth_service -->|"manages sessions"| node_user_store
node_auth_service -.->|"uses database"| node_db_session
node_authui -->|"uses"| node_api_client

click node_app "https://github.com/anveshna25/centflow/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/anveshna25/centflow/blob/main/frontend/src/auth/AuthContext.jsx"
click node_api_client "https://github.com/anveshna25/centflow/blob/main/frontend/src/api/client.js"
click node_market_pages "https://github.com/anveshna25/centflow/blob/main/frontend/src/pages/MarketsPage.jsx"
click node_portfolio_page "https://github.com/anveshna25/centflow/blob/main/frontend/src/pages/PortfoliosPage.jsx"
click node_watchlist_page "https://github.com/anveshna25/centflow/blob/main/frontend/src/pages/WatchlistsPage.jsx"
click node_asset_detail "https://github.com/anveshna25/centflow/blob/main/frontend/src/components/market/AssetDetailModal.jsx"
click node_price_chart "https://github.com/anveshna25/centflow/blob/main/frontend/src/components/market/PriceChart.jsx"
click node_api_router "https://github.com/anveshna25/centflow/blob/main/backend/app/api/router.py"
click node_market_routes "https://github.com/anveshna25/centflow/blob/main/backend/app/api/routes/market_data.py"
click node_analytics_routes "https://github.com/anveshna25/centflow/blob/main/backend/app/api/routes/analytics.py"
click node_portfolio_routes "https://github.com/anveshna25/centflow/blob/main/backend/app/api/routes/portfolios.py"
click node_watchlist_routes "https://github.com/anveshna25/centflow/blob/main/backend/app/api/routes/watchlist.py"
click node_auth_routes "https://github.com/anveshna25/centflow/blob/main/backend/app/api/routes/auth.py"
click node_ingestion "https://github.com/anveshna25/centflow/blob/main/backend/app/services/ingestion.py"
click node_market_service "https://github.com/anveshna25/centflow/blob/main/backend/app/services/market_data.py"
click node_provider "https://github.com/anveshna25/centflow/blob/main/backend/app/providers/base.py"
click node_analytics_service "https://github.com/anveshna25/centflow/blob/main/backend/app/services/analytics.py"
click node_analytics_calc "https://github.com/anveshna25/centflow/blob/main/backend/app/analytics/calculations.py"
click node_indicators "https://github.com/anveshna25/centflow/blob/main/backend/app/analytics/indicators.py"
click node_auth_service "https://github.com/anveshna25/centflow/blob/main/backend/app/services/auth.py"
click node_google_auth "https://github.com/anveshna25/centflow/blob/main/backend/app/services/google_auth.py"
click node_user_store "https://github.com/anveshna25/centflow/blob/main/backend/app/database/models/user.py"
click node_db_session "https://github.com/anveshna25/centflow/blob/main/backend/app/database/session.py"
click node_instrument_repo "https://github.com/anveshna25/centflow/blob/main/backend/app/repositories/instrument.py"
click node_price_repo "https://github.com/anveshna25/centflow/blob/main/backend/app/repositories/price.py"

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_authui,node_api_client,node_market_pages,node_portfolio_page,node_watchlist_page,node_asset_detail,node_price_chart,node_user toneBlue
class node_api_router,node_market_routes,node_analytics_routes,node_portfolio_routes,node_watchlist_routes,node_auth_routes toneAmber
class node_ingestion,node_market_service,node_provider,node_instrument_repo,node_price_repo toneMint
class node_analytics_service,node_analytics_calc,node_indicators toneRose
class node_auth_service,node_google_auth,node_user_store,node_db_session toneIndigo
```

## Components

### Web application

- [App and page routing](https://github.com/anveshna25/centflow/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Authentication UI](https://github.com/anveshna25/centflow/blob/main/frontend/src/auth/AuthContext.jsx): `frontend/src/auth/AuthContext.jsx`
- [API client](https://github.com/anveshna25/centflow/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`
- [Markets and asset views](https://github.com/anveshna25/centflow/blob/main/frontend/src/pages/MarketsPage.jsx): `frontend/src/pages/MarketsPage.jsx`
- [Portfolio view](https://github.com/anveshna25/centflow/blob/main/frontend/src/pages/PortfoliosPage.jsx): `frontend/src/pages/PortfoliosPage.jsx`
- [Watchlist view](https://github.com/anveshna25/centflow/blob/main/frontend/src/pages/WatchlistsPage.jsx): `frontend/src/pages/WatchlistsPage.jsx`
- [Asset detail](https://github.com/anveshna25/centflow/blob/main/frontend/src/components/market/AssetDetailModal.jsx): `frontend/src/components/market/AssetDetailModal.jsx`
- [Price chart](https://github.com/anveshna25/centflow/blob/main/frontend/src/components/market/PriceChart.jsx): `frontend/src/components/market/PriceChart.jsx`

### API surface

- [API router](https://github.com/anveshna25/centflow/blob/main/backend/app/api/router.py): `backend/app/api/router.py`
- [Market data routes](https://github.com/anveshna25/centflow/blob/main/backend/app/api/routes/market_data.py): `backend/app/api/routes/market_data.py`
- [Analytics routes](https://github.com/anveshna25/centflow/blob/main/backend/app/api/routes/analytics.py): `backend/app/api/routes/analytics.py`
- [Portfolio routes](https://github.com/anveshna25/centflow/blob/main/backend/app/api/routes/portfolios.py): `backend/app/api/routes/portfolios.py`
- [Watchlist routes](https://github.com/anveshna25/centflow/blob/main/backend/app/api/routes/watchlist.py): `backend/app/api/routes/watchlist.py`
- [Authentication routes](https://github.com/anveshna25/centflow/blob/main/backend/app/api/routes/auth.py): `backend/app/api/routes/auth.py`

### Market data

- [Market ingestion](https://github.com/anveshna25/centflow/blob/main/backend/app/services/ingestion.py): `backend/app/services/ingestion.py`
- [Market data service](https://github.com/anveshna25/centflow/blob/main/backend/app/services/market_data.py): `backend/app/services/market_data.py`
- [Provider integration](https://github.com/anveshna25/centflow/blob/main/backend/app/providers/base.py): `backend/app/providers/base.py`
- [Instrument repository](https://github.com/anveshna25/centflow/blob/main/backend/app/repositories/instrument.py): `backend/app/repositories/instrument.py`
- [Price repository](https://github.com/anveshna25/centflow/blob/main/backend/app/repositories/price.py): `backend/app/repositories/price.py`

### Analytics and investing

- [Analytics service](https://github.com/anveshna25/centflow/blob/main/backend/app/services/analytics.py): `backend/app/services/analytics.py`
- [Analytics calculations](https://github.com/anveshna25/centflow/blob/main/backend/app/analytics/calculations.py): `backend/app/analytics/calculations.py`
- [Technical indicators](https://github.com/anveshna25/centflow/blob/main/backend/app/analytics/indicators.py): `backend/app/analytics/indicators.py`

### Identity and persistence

- [Authentication service](https://github.com/anveshna25/centflow/blob/main/backend/app/services/auth.py): `backend/app/services/auth.py`
- [Google authentication](https://github.com/anveshna25/centflow/blob/main/backend/app/services/google_auth.py): `backend/app/services/google_auth.py`
- [User and session records](https://github.com/anveshna25/centflow/blob/main/backend/app/database/models/user.py): `backend/app/database/models/user.py`
- [Database session](https://github.com/anveshna25/centflow/blob/main/backend/app/database/session.py): `backend/app/database/session.py`

### Other components

- **User**

## Connections

- User → App and page routing: uses (evidence: `frontend/src/App.jsx`)
- App and page routing → Markets and asset views: routes to (evidence: `frontend/src/App.jsx`)
- App and page routing → Portfolio view: routes to (evidence: `frontend/src/App.jsx`)
- App and page routing → Watchlist view: routes to (evidence: `frontend/src/App.jsx`)
- App and page routing → Asset detail: opens (evidence: `frontend/src/App.jsx`)
- Markets and asset views → API client: requests data
- Portfolio view → API client: requests data (evidence: `frontend/src/pages/PortfoliosPage.jsx`)
- Watchlist view → API client: requests data (evidence: `frontend/src/pages/WatchlistsPage.jsx`)
- Asset detail → API client: requests data (evidence: `frontend/src/components/market/AssetDetailModal.jsx`)
- Asset detail → Price chart: renders (evidence: `frontend/src/components/market/AssetDetailModal.jsx`)
- API client → Market data routes: HTTP requests
- API client → Analytics routes: HTTP requests
- API client → Portfolio routes: HTTP requests
- API client → Watchlist routes: HTTP requests
- API router → Market data routes: registers (evidence: `backend/app/api/router.py`)
- API router → Analytics routes: registers (evidence: `backend/app/api/router.py`)
- API router → Portfolio routes: registers (evidence: `backend/app/api/router.py`)
- API router → Watchlist routes: registers (evidence: `backend/app/api/router.py`)
- API router → Authentication routes: registers (evidence: `backend/app/api/router.py`)
- Market data routes → Market ingestion: calls (evidence: `backend/app/api/routes/market_data.py`)
- Market data routes → Market data service: calls (evidence: `backend/app/api/routes/market_data.py`)
- Market ingestion → Market data service: queries (evidence: `backend/app/services/ingestion.py`)
- Market ingestion → Instrument repository: persists instruments (evidence: `backend/app/services/ingestion.py`)
- Market ingestion → Price repository: persists prices (evidence: `backend/app/services/ingestion.py`)
- Market data service → Provider integration: uses provider
- Analytics routes → Analytics service: calls
- Analytics service → Analytics calculations: calculates
- Analytics calculations → Technical indicators: uses
- Authentication routes → Authentication service: calls (evidence: `backend/app/api/routes/auth.py`)
- Authentication routes → Google authentication: calls (evidence: `backend/app/api/routes/auth.py`)
- Authentication service → User and session records: manages sessions (evidence: `backend/app/services/auth.py`)
- Authentication service → Database session: uses database
- Authentication UI → API client: uses (evidence: `frontend/src/auth/AuthContext.jsx`)
