# subodh-kumar007/data-analyst-infotact architecture

> Architecture diagram of the GitHub repository subodh-kumar007/data-analyst-infotact, 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/subodh-kumar007/data-analyst-infotact
- Repository: https://github.com/subodh-kumar007/data-analyst-infotact

## Overview

The tree contains two separate projects. CogniStream’s main workflow collects developer-source events, cleans and loads them into ClickHouse, serves analytics through an API, and presents a dashboard. The sampled API and loader code support the storage and analytics links; the frontend’s API-fetch implementation and the DAG’s runtime wiring were not shown, so those links are marked unverified or omitted. AtmoSync has a simulator and consumer, but the available evidence does not establish how they connect.

Main entry points: [`cognistream-developer-flow-analytics/api/main.py`](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/api/main.py) (Analytics API), [`cognistream-developer-flow-analytics/event_ingestion.py`](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/event_ingestion.py) (Event Collector), [`cognistream-developer-flow-analytics/ingestion/load_to_clickhouse.py`](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/ingestion/load_to_clickhouse.py) (ClickHouse Loader), [`cognistream-developer-flow-analytics/ingestion/clickhouse_client.py`](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/ingestion/clickhouse_client.py) (ClickHouse Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cogni["CogniStream Analytics"]
  node_dashboard["Analytics Dashboard<br/>[App.jsx]"]
  node_api["Analytics API<br/>[main.py]"]
end

subgraph group_sources["Event Sources"]
  node_github["GitHub Event Extractor<br/>[github_api.py]"]
  node_ide["IDE Event Extractor<br/>[ide_activity.py]"]
  node_slack["Slack Event Extractor<br/>[slack_api.py]"]
  node_jira["Jira Event Extractor<br/>[jira_api.py]"]
end

subgraph group_ingestion["Event Ingestion"]
  node_collector["Event Collector<br/>[event_ingestion.py]"]
  node_normalizer["Event Normalizer"]
  node_cleaner["Polars Cleaner<br/>[polars_cleaner.py]"]
  node_loader["ClickHouse Loader"]
  node_clickhouse_client["ClickHouse Client"]
  node_clickhouse[("ClickHouse Events")]
  node_dag["Ingestion DAG"]
end

subgraph group_analysis["Analytics"]
  node_summary["Metrics Summary<br/>[main.py]"]
  node_switch_endpoint["Context Switch Analytics<br/>[main.py]"]
  node_switch_logic["Context Switch Logic"]
  node_flow_endpoint["Flow Blocks Endpoint<br/>[main.py]"]
  node_flow_logic["Uninterrupted Flow Blocks<br/>[flow_blocks.py]"]
end

subgraph group_atmo["AtmoSync"]
  node_atmo_sim["Sensor Simulator"]
  node_atmo_consumer["Data Consumer<br/>[consumer.py]"]
end

node_developer(("Developer"))

node_developer -->|"views analytics"| node_dashboard
node_dashboard -.->|"requests data"| node_api
node_collector -->|"extracts events"| node_github
node_collector -->|"extracts events"| node_ide
node_collector -->|"extracts events"| node_slack
node_collector -->|"extracts events"| node_jira
node_normalizer -.->|"normalizes events"| node_collector
node_loader -->|"cleans events"| node_cleaner
node_loader -->|"creates and inserts"| node_clickhouse_client
node_clickhouse_client -->|"reads and writes"| node_clickhouse
node_api -->|"fetches events"| node_clickhouse_client
node_api -->|"computes metrics"| node_summary
node_api -->|"computes switches"| node_switch_endpoint
node_switch_endpoint -.->|"uses logic"| node_switch_logic
node_api -->|"serves flow blocks"| node_flow_endpoint
node_flow_endpoint -->|"finds blocks"| node_flow_logic
node_dag -.->|"orchestrates loading"| node_loader

click node_dashboard "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/frontend/src/App.jsx"
click node_api "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/api/main.py"
click node_github "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/github_api.py"
click node_ide "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/ide_activity.py"
click node_slack "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/slack_api.py"
click node_jira "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/jira_api.py"
click node_collector "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/event_ingestion.py"
click node_normalizer "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/normalize_events.py"
click node_cleaner "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/ingestion/polars_cleaner.py"
click node_loader "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/ingestion/load_to_clickhouse.py"
click node_clickhouse_client "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/ingestion/clickhouse_client.py"
click node_summary "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/api/main.py"
click node_switch_endpoint "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/api/main.py"
click node_switch_logic "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/analytics/context_switches.py"
click node_flow_endpoint "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/api/main.py"
click node_flow_logic "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/analytics/flow_blocks.py"
click node_dag "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/dags/cognistream_ingestion_dag.py"
click node_atmo_sim "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/AtmoSync-MicroClimate-Analytics-main/sensor_simulator.py"
click node_atmo_consumer "https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/AtmoSync-MicroClimate-Analytics-main/consumer.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_dashboard,node_api toneBlue
class node_github,node_ide,node_slack,node_jira toneAmber
class node_collector,node_normalizer,node_cleaner,node_loader,node_clickhouse_client,node_clickhouse,node_dag toneMint
class node_summary,node_switch_endpoint,node_switch_logic,node_flow_endpoint,node_flow_logic toneRose
class node_atmo_sim,node_atmo_consumer,node_developer toneIndigo
```

## Components

### CogniStream Analytics

- [Analytics Dashboard](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/frontend/src/App.jsx): `cognistream-developer-flow-analytics/frontend/src/App.jsx`
- [Analytics API](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/api/main.py): `cognistream-developer-flow-analytics/api/main.py`

### Event Sources

- [GitHub Event Extractor](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/github_api.py): `cognistream-developer-flow-analytics/github_api.py`
- [IDE Event Extractor](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/ide_activity.py): `cognistream-developer-flow-analytics/ide_activity.py`
- [Slack Event Extractor](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/slack_api.py): `cognistream-developer-flow-analytics/slack_api.py`
- [Jira Event Extractor](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/jira_api.py): `cognistream-developer-flow-analytics/jira_api.py`

### Event Ingestion

- [Event Collector](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/event_ingestion.py): `cognistream-developer-flow-analytics/event_ingestion.py`
- [Event Normalizer](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/normalize_events.py): `cognistream-developer-flow-analytics/normalize_events.py`
- [Polars Cleaner](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/ingestion/polars_cleaner.py): `cognistream-developer-flow-analytics/ingestion/polars_cleaner.py`
- [ClickHouse Loader](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/ingestion/load_to_clickhouse.py): `cognistream-developer-flow-analytics/ingestion/load_to_clickhouse.py`
- [ClickHouse Client](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/ingestion/clickhouse_client.py): `cognistream-developer-flow-analytics/ingestion/clickhouse_client.py`
- **ClickHouse Events**
- [Ingestion DAG](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/dags/cognistream_ingestion_dag.py): `cognistream-developer-flow-analytics/dags/cognistream_ingestion_dag.py`

### Analytics

- [Metrics Summary](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/api/main.py): `cognistream-developer-flow-analytics/api/main.py`
- [Context Switch Analytics](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/api/main.py): `cognistream-developer-flow-analytics/api/main.py`
- [Context Switch Logic](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/analytics/context_switches.py): `cognistream-developer-flow-analytics/analytics/context_switches.py`
- [Flow Blocks Endpoint](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/api/main.py): `cognistream-developer-flow-analytics/api/main.py`
- [Uninterrupted Flow Blocks](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/cognistream-developer-flow-analytics/analytics/flow_blocks.py): `cognistream-developer-flow-analytics/analytics/flow_blocks.py`

### AtmoSync

- [Sensor Simulator](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/AtmoSync-MicroClimate-Analytics-main/sensor_simulator.py): `AtmoSync-MicroClimate-Analytics-main/sensor_simulator.py`
- [Data Consumer](https://github.com/subodh-kumar007/data-analyst-infotact/blob/main/AtmoSync-MicroClimate-Analytics-main/consumer.py): `AtmoSync-MicroClimate-Analytics-main/consumer.py`

### Other components

- **Developer**

## Connections

- Developer → Analytics Dashboard: views analytics (evidence: `cognistream-developer-flow-analytics/frontend/src/App.jsx`)
- Analytics Dashboard → Analytics API: requests data
- Event Collector → GitHub Event Extractor: extracts events (evidence: `cognistream-developer-flow-analytics/event_ingestion.py`)
- Event Collector → IDE Event Extractor: extracts events (evidence: `cognistream-developer-flow-analytics/event_ingestion.py`)
- Event Collector → Slack Event Extractor: extracts events (evidence: `cognistream-developer-flow-analytics/event_ingestion.py`)
- Event Collector → Jira Event Extractor: extracts events (evidence: `cognistream-developer-flow-analytics/event_ingestion.py`)
- Event Normalizer → Event Collector: normalizes events
- ClickHouse Loader → Polars Cleaner: cleans events (evidence: `cognistream-developer-flow-analytics/ingestion/load_to_clickhouse.py`)
- ClickHouse Loader → ClickHouse Client: creates and inserts (evidence: `cognistream-developer-flow-analytics/ingestion/load_to_clickhouse.py`)
- ClickHouse Client → ClickHouse Events: reads and writes (evidence: `cognistream-developer-flow-analytics/ingestion/clickhouse_client.py`)
- Analytics API → ClickHouse Client: fetches events (evidence: `cognistream-developer-flow-analytics/api/main.py`)
- Analytics API → Metrics Summary: computes metrics (evidence: `cognistream-developer-flow-analytics/api/main.py`)
- Analytics API → Context Switch Analytics: computes switches (evidence: `cognistream-developer-flow-analytics/api/main.py`)
- Context Switch Analytics → Context Switch Logic: uses logic
- Analytics API → Flow Blocks Endpoint: serves flow blocks (evidence: `cognistream-developer-flow-analytics/api/main.py`)
- Flow Blocks Endpoint → Uninterrupted Flow Blocks: finds blocks (evidence: `cognistream-developer-flow-analytics/api/main.py`)
- Ingestion DAG → ClickHouse Loader: orchestrates loading
