# tech-meet-10-iitb-solutions/suryadrishti architecture

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

- Interactive diagram: https://gitdiagram.com/tech-meet-10-iitb-solutions/suryadrishti
- Repository: https://github.com/tech-meet-10-iitb-solutions/suryadrishti

## Overview

SuryaDrishti is a browser-based X-ray light-curve analysis application. A user uploads one supported light-curve file; the backend stores it for processing, then analyzes it to identify and characterize bursts and score them with the neural model. The report presents the light curve and burst results, supports review, and can submit labels for model training. The graph includes the documented statistical and visualization capabilities. Some frontend-to-backend wiring and chart composition are not shown in excerpts, so those relationships are marked unverified rather than asserted.

Main entry points: [`frontend/src/app/report/report.component.ts`](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/frontend/src/app/report/report.component.ts) (Burst report), [`models/stat/lc.py`](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/models/stat/lc.py) (Light-curve analysis), [`backend/server.py`](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/backend/server.py) (FastAPI endpoints), [`frontend/src/app/upload/upload.component.ts`](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/frontend/src/app/upload/upload.component.ts) (File upload)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Browser interface"]
  node_upload["File upload"]
  node_report["Burst report"]
  node_table["Burst table"]
  node_linechart["Light-curve chart"]
  node_scatter["Burst scatter"]
  node_service["Server service<br/>[server.service.ts]"]
end

subgraph group_api["Analysis API"]
  node_server["FastAPI endpoints<br/>[server.py]"]
end

subgraph group_stat["Statistical analysis"]
  node_lc["Light-curve analysis<br/>[lc.py]"]
  node_n_sigma["N-sigma detection<br/>[ns.py]"]
  node_local_maxima["Local-maxima detection<br/>[lm.py]"]
  node_flux["Energy-flux fitting<br/>[efp.py]"]
  node_properties["Burst properties<br/>[prop.py]"]
end

subgraph group_ml["Machine learning"]
  node_snn["Neural burst scoring<br/>[snn.py]"]
end

node_user(("Researcher"))

node_user -->|"selects file"| node_upload
node_upload -->|"sends upload"| node_service
node_upload -->|"opens report"| node_report
node_report -->|"requests bursts"| node_service
node_report -->|"uses table"| node_table
node_report -.->|"renders chart"| node_linechart
node_report -.->|"renders scatter"| node_scatter
node_service -.->|"calls API"| node_server
node_server -->|"analyzes curve"| node_lc
node_server -->|"scores bursts"| node_snn
node_server -->|"trains model"| node_snn
node_lc -->|"detects bursts"| node_n_sigma
node_lc -->|"detects bursts"| node_local_maxima
node_lc -->|"fits flux"| node_flux
node_lc -->|"derives properties"| node_properties

click node_upload "https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/frontend/src/app/upload/upload.component.ts"
click node_report "https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/frontend/src/app/report/report.component.ts"
click node_table "https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/frontend/src/app/components/burst-table/burst-table.component.ts"
click node_linechart "https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/frontend/src/app/components/linechart/linechart.component.ts"
click node_scatter "https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/frontend/src/app/components/linescatter/linescatter.component.ts"
click node_service "https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/frontend/src/app/server.service.ts"
click node_server "https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/backend/server.py"
click node_lc "https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/models/stat/lc.py"
click node_n_sigma "https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/models/stat/ns.py"
click node_local_maxima "https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/models/stat/lm.py"
click node_flux "https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/models/stat/efp.py"
click node_properties "https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/models/stat/prop.py"
click node_snn "https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/models/ml/snn.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_upload,node_report,node_table,node_linechart,node_scatter,node_service toneBlue
class node_server toneAmber
class node_lc,node_n_sigma,node_local_maxima,node_flux,node_properties toneMint
class node_snn toneRose
class node_user toneIndigo
```

## Components

### Browser interface

- [File upload](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/frontend/src/app/upload/upload.component.ts): `frontend/src/app/upload/upload.component.ts`
- [Burst report](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/frontend/src/app/report/report.component.ts): `frontend/src/app/report/report.component.ts`
- [Burst table](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/frontend/src/app/components/burst-table/burst-table.component.ts): `frontend/src/app/components/burst-table/burst-table.component.ts`
- [Light-curve chart](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/frontend/src/app/components/linechart/linechart.component.ts): `frontend/src/app/components/linechart/linechart.component.ts`
- [Burst scatter](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/frontend/src/app/components/linescatter/linescatter.component.ts): `frontend/src/app/components/linescatter/linescatter.component.ts`
- [Server service](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/frontend/src/app/server.service.ts): `frontend/src/app/server.service.ts`

### Analysis API

- [FastAPI endpoints](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/backend/server.py): `backend/server.py`

### Statistical analysis

- [Light-curve analysis](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/models/stat/lc.py): `models/stat/lc.py`
- [N-sigma detection](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/models/stat/ns.py): `models/stat/ns.py`
- [Local-maxima detection](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/models/stat/lm.py): `models/stat/lm.py`
- [Energy-flux fitting](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/models/stat/efp.py): `models/stat/efp.py`
- [Burst properties](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/models/stat/prop.py): `models/stat/prop.py`

### Machine learning

- [Neural burst scoring](https://github.com/tech-meet-10-iitb-solutions/suryadrishti/blob/master/models/ml/snn.py): `models/ml/snn.py`

### Other components

- **Researcher**

## Connections

- Researcher → File upload: selects file (evidence: `frontend/src/app/upload/upload.component.ts`)
- File upload → Server service: sends upload (evidence: `frontend/src/app/upload/upload.component.ts`)
- File upload → Burst report: opens report (evidence: `frontend/src/app/upload/upload.component.ts`)
- Burst report → Server service: requests bursts (evidence: `frontend/src/app/report/report.component.ts`)
- Burst report → Burst table: uses table (evidence: `frontend/src/app/report/report.component.ts`)
- Burst report → Light-curve chart: renders chart
- Burst report → Burst scatter: renders scatter
- Server service → FastAPI endpoints: calls API
- FastAPI endpoints → Light-curve analysis: analyzes curve (evidence: `backend/server.py`)
- FastAPI endpoints → Neural burst scoring: scores bursts (evidence: `backend/server.py`)
- FastAPI endpoints → Neural burst scoring: trains model (evidence: `backend/server.py`)
- Light-curve analysis → N-sigma detection: detects bursts (evidence: `models/stat/lc.py`)
- Light-curve analysis → Local-maxima detection: detects bursts (evidence: `models/stat/lc.py`)
- Light-curve analysis → Energy-flux fitting: fits flux (evidence: `models/stat/lc.py`)
- Light-curve analysis → Burst properties: derives properties (evidence: `models/stat/lc.py`)
