# nandininema07/credit-intelligence-platform architecture

> Architecture diagram of the GitHub repository nandininema07/credit-intelligence-platform, 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/nandininema07/credit-intelligence-platform
- Repository: https://github.com/nandininema07/credit-intelligence-platform

## Overview

This is a real-time credit-risk intelligence platform: it collects financial and unstructured events, derives features, scores companies, explains score changes, and routes alerts to analysts. The documented pipeline is the principal data-to-result workflow; the FastAPI backend and dashboard expose company, score, explanation, chat, and alert capabilities. The graph also shows key model, feature-store, and notification integrations. Some subsystem links rely on README descriptions or SOURCE INDEX references; unsampled implementation details are not inferred.

Main entry points: [`backend/main.py`](https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/main.py) (FastAPI Application), [`backend/app/services/score_service.py`](https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/services/score_service.py) (Score Service), [`stage5_alerting_workflows/alerting/alert_engine.py`](https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage5_alerting_workflows/alerting/alert_engine.py) (Alert Engine), [`stage2_feature_engineering/main_processor.py`](https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage2_feature_engineering/main_processor.py) (Feature Engineering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["Analysis Pipeline"]
  node_ingestion["Data Ingestion<br/>[main_pipeline.py]"]
  node_raw_store[("Raw Data Store")]
  node_features["Feature Engineering<br/>[main_processor.py]"]
  node_feature_store[("Feature Store<br/>[feature_store.py]")]
  node_model_training["Model Training<br/>[main_trainer.py]"]
  node_scoring["Model Scoring"]
end

subgraph group_explain_alert["Insights and Alerts"]
  node_explain["XAI Explanations<br/>[main_explainer.py]"]
  node_chat["AI Chat<br/>[chat_engine.py]"]
  node_alert_engine["Alert Engine<br/>[alert_engine.py]"]
  node_notifications["Notifications<br/>[email_notifier.py]"]
  node_workflows["Alert Workflows<br/>[workflow_engine.py]"]
end

subgraph group_backend["API Backend"]
  node_api_app["FastAPI Application<br/>[main.py]"]
  node_company_api["Company API<br/>[companies.py]"]
  node_company_service["Company Service<br/>[company_service.py]"]
  node_score_api["Score API<br/>[scores.py]"]
  node_score_service["Score Service<br/>[score_service.py]"]
  node_alert_api["Alert API<br/>[alerts.py]"]
  node_alert_service["Alert Service<br/>[alert_service.py]"]
  node_chat_api["Chat API<br/>[chat.py]"]
  node_websocket_api["WebSocket API<br/>[websocket.py]"]
  node_db[("API Database<br/>[database.py]")]
end

subgraph group_frontend["Analyst Dashboard"]
  node_dashboard["Analyst Dashboard<br/>[page.tsx]"]
  node_dashboard_views["Dashboard Views"]
end

node_analyst(("Analyst"))

node_ingestion -->|"writes records"| node_raw_store
node_ingestion -->|"feeds features"| node_features
node_features -->|"stores features"| node_feature_store
node_features -->|"provides features"| node_model_training
node_model_training -.->|"trains models"| node_scoring
node_scoring -->|"provides score impact"| node_explain
node_explain -->|"provides context"| node_alert_engine
node_alert_engine -->|"dispatches alerts"| node_notifications
node_alert_engine -->|"routes workflows"| node_workflows
node_api_app -->|"registers routes"| node_company_api
node_api_app -->|"registers routes"| node_score_api
node_api_app -->|"registers routes"| node_alert_api
node_api_app -->|"registers routes"| node_chat_api
node_api_app -->|"registers routes"| node_websocket_api
node_company_api -->|"calls"| node_company_service
node_score_api -->|"calls"| node_score_service
node_alert_api -->|"calls"| node_alert_service
node_chat_api -.->|"uses assistant"| node_chat
node_score_service -->|"reads features"| node_feature_store
node_score_service -->|"requests prediction"| node_scoring
node_score_service -->|"requests explanation"| node_explain
node_alert_service -->|"integrates engine"| node_alert_engine
node_alert_service -->|"sends notifications"| node_notifications
node_company_api -->|"uses sessions"| node_db
node_score_api -->|"uses sessions"| node_db
node_alert_api -->|"uses sessions"| node_db
node_analyst -->|"uses"| node_dashboard
node_dashboard -->|"renders"| node_dashboard_views
node_dashboard -->|"queries API"| node_api_app
node_analyst -->|"asks questions"| node_chat_api
node_analyst -->|"receives live updates"| node_websocket_api

click node_ingestion "https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage1_data_ingestion/main_pipeline.py"
click node_raw_store "https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage1_data_ingestion/storage/postgres_manager.py"
click node_features "https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage2_feature_engineering/main_processor.py"
click node_feature_store "https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage2_feature_engineering/feature_store/feature_store.py"
click node_model_training "https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage3_model_training/main_trainer.py"
click node_scoring "https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage3_model_training/scoring/real_time_scorer.py"
click node_explain "https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage4_explainability/main_explainer.py"
click node_chat "https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage4_explainability/chatbot/chat_engine.py"
click node_alert_engine "https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage5_alerting_workflows/alerting/alert_engine.py"
click node_notifications "https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage5_alerting_workflows/notifications/email_notifier.py"
click node_workflows "https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage5_alerting_workflows/workflows/workflow_engine.py"
click node_api_app "https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/main.py"
click node_company_api "https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/api/companies.py"
click node_company_service "https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/services/company_service.py"
click node_score_api "https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/api/scores.py"
click node_score_service "https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/services/score_service.py"
click node_alert_api "https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/api/alerts.py"
click node_alert_service "https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/services/alert_service.py"
click node_chat_api "https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/api/chat.py"
click node_websocket_api "https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/api/websocket.py"
click node_db "https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/database.py"
click node_dashboard "https://github.com/nandininema07/credit-intelligence-platform/blob/main/frontend/app/page.tsx"
click node_dashboard_views "https://github.com/nandininema07/credit-intelligence-platform/tree/main/frontend/components"

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_ingestion,node_raw_store,node_features,node_feature_store,node_model_training,node_scoring toneBlue
class node_explain,node_chat,node_alert_engine,node_notifications,node_workflows toneAmber
class node_api_app,node_company_api,node_company_service,node_score_api,node_score_service,node_alert_api,node_alert_service,node_chat_api,node_websocket_api,node_db toneMint
class node_dashboard,node_dashboard_views toneRose
class node_analyst toneIndigo
```

## Components

### Analysis Pipeline

- [Data Ingestion](https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage1_data_ingestion/main_pipeline.py): `stage1_data_ingestion/main_pipeline.py`
- [Raw Data Store](https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage1_data_ingestion/storage/postgres_manager.py): `stage1_data_ingestion/storage/postgres_manager.py`
- [Feature Engineering](https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage2_feature_engineering/main_processor.py): `stage2_feature_engineering/main_processor.py`
- [Feature Store](https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage2_feature_engineering/feature_store/feature_store.py): `stage2_feature_engineering/feature_store/feature_store.py`
- [Model Training](https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage3_model_training/main_trainer.py): `stage3_model_training/main_trainer.py`
- [Model Scoring](https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage3_model_training/scoring/real_time_scorer.py): `stage3_model_training/scoring/real_time_scorer.py`

### Insights and Alerts

- [XAI Explanations](https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage4_explainability/main_explainer.py): `stage4_explainability/main_explainer.py`
- [AI Chat](https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage4_explainability/chatbot/chat_engine.py): `stage4_explainability/chatbot/chat_engine.py`
- [Alert Engine](https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage5_alerting_workflows/alerting/alert_engine.py): `stage5_alerting_workflows/alerting/alert_engine.py`
- [Notifications](https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage5_alerting_workflows/notifications/email_notifier.py): `stage5_alerting_workflows/notifications/email_notifier.py`
- [Alert Workflows](https://github.com/nandininema07/credit-intelligence-platform/blob/main/stage5_alerting_workflows/workflows/workflow_engine.py): `stage5_alerting_workflows/workflows/workflow_engine.py`

### API Backend

- [FastAPI Application](https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/main.py): `backend/main.py`
- [Company API](https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/api/companies.py): `backend/app/api/companies.py`
- [Company Service](https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/services/company_service.py): `backend/app/services/company_service.py`
- [Score API](https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/api/scores.py): `backend/app/api/scores.py`
- [Score Service](https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/services/score_service.py): `backend/app/services/score_service.py`
- [Alert API](https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/api/alerts.py): `backend/app/api/alerts.py`
- [Alert Service](https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/services/alert_service.py): `backend/app/services/alert_service.py`
- [Chat API](https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/api/chat.py): `backend/app/api/chat.py`
- [WebSocket API](https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/api/websocket.py): `backend/app/api/websocket.py`
- [API Database](https://github.com/nandininema07/credit-intelligence-platform/blob/main/backend/app/database.py): `backend/app/database.py`

### Analyst Dashboard

- [Analyst Dashboard](https://github.com/nandininema07/credit-intelligence-platform/blob/main/frontend/app/page.tsx): `frontend/app/page.tsx`
- [Dashboard Views](https://github.com/nandininema07/credit-intelligence-platform/tree/main/frontend/components): `frontend/components`

### Other components

- **Analyst**

## Connections

- Data Ingestion → Raw Data Store: writes records (evidence: `stage1_data_ingestion/main_pipeline.py`)
- Data Ingestion → Feature Engineering: feeds features (evidence: `README.md`)
- Feature Engineering → Feature Store: stores features (evidence: `stage2_feature_engineering/main_processor.py`)
- Feature Engineering → Model Training: provides features (evidence: `README.md`)
- Model Training → Model Scoring: trains models
- Model Scoring → XAI Explanations: provides score impact (evidence: `README.md`)
- XAI Explanations → Alert Engine: provides context (evidence: `README.md`)
- Alert Engine → Notifications: dispatches alerts (evidence: `stage5_alerting_workflows/main_alerting.py`)
- Alert Engine → Alert Workflows: routes workflows
- FastAPI Application → Company API: registers routes (evidence: `backend/main.py`)
- FastAPI Application → Score API: registers routes (evidence: `backend/main.py`)
- FastAPI Application → Alert API: registers routes (evidence: `backend/main.py`)
- FastAPI Application → Chat API: registers routes (evidence: `backend/main.py`)
- FastAPI Application → WebSocket API: registers routes (evidence: `backend/main.py`)
- Company API → Company Service: calls (evidence: `backend/app/api/companies.py`)
- Score API → Score Service: calls (evidence: `backend/app/api/scores.py`)
- Alert API → Alert Service: calls (evidence: `backend/app/api/alerts.py`)
- Chat API → AI Chat: uses assistant
- Score Service → Feature Store: reads features (evidence: `backend/app/services/score_service.py`)
- Score Service → Model Scoring: requests prediction (evidence: `backend/app/services/score_service.py`)
- Score Service → XAI Explanations: requests explanation (evidence: `backend/app/services/score_service.py`)
- Alert Service → Alert Engine: integrates engine (evidence: `backend/app/services/alert_service.py`)
- Alert Service → Notifications: sends notifications (evidence: `backend/app/services/alert_service.py`)
- Company API → API Database: uses sessions (evidence: `backend/app/api/companies.py`)
- Score API → API Database: uses sessions (evidence: `backend/app/api/scores.py`)
- Alert API → API Database: uses sessions (evidence: `backend/app/api/alerts.py`)
- Analyst → Analyst Dashboard: uses (evidence: `README.md`)
- Analyst Dashboard → Dashboard Views: renders (evidence: `frontend/app/page.tsx`)
- Analyst Dashboard → FastAPI Application: queries API (evidence: `README.md`)
- Analyst → Chat API: asks questions (evidence: `README.md`)
- Analyst → WebSocket API: receives live updates (evidence: `README.md`)
