# cos301-se-2026/full-sms architecture

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

- Interactive diagram: https://gitdiagram.com/cos301-se-2026/full-sms
- Repository: https://github.com/cos301-se-2026/full-sms

## Overview

Full SMS is a web platform for single-molecule spectroscopy data analysis and collaborative research. The main user journey is to upload and identify measurement files, organize them in workspaces, analyze data, and save or export results. The graph also preserves documented capabilities for sessions, plugins and their marketplace, comments, notifications, cloud integration, and IRF mapping. Source excerpts show selected route, controller, service, and storage calls; unsampled capability links are dashed where the README or tree supports the feature but not its wiring.

Main entry points: [`api/main.py`](https://github.com/cos301-se-2026/full-sms/blob/main/api/main.py) (FastAPI application), [`api/controllers/analysis_controller.py`](https://github.com/cos301-se-2026/full-sms/blob/main/api/controllers/analysis_controller.py) (Analysis endpoints), [`api/utils/supabase_client.py`](https://github.com/cos301-se-2026/full-sms/blob/main/api/utils/supabase_client.py) (Supabase services), [`api/routes/format_routes.py`](https://github.com/cos301-se-2026/full-sms/blob/main/api/routes/format_routes.py) (Format detection and reading)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web application"]
  node_web["Next.js interface<br/>[page.tsx]"]
  node_dashboard["Workspace dashboard<br/>[page.tsx]"]
  node_uploadui["File upload<br/>[page.tsx]"]
end

subgraph group_api["API and orchestration"]
  node_api["FastAPI application<br/>[main.py]"]
  node_formats["Format detection and reading<br/>[format_routes.py]"]
  node_storage[("Object storage<br/>[storage_service.py]")]
  node_supabase[("Supabase services<br/>[supabase_client.py]")]
  node_auth["Authentication<br/>[auth_service.py]"]
end

subgraph group_science["Scientific data"]
  node_measurements["Measurement data"]
  node_analysis["Analysis endpoints"]
  node_clustering["Clustering analysis<br/>[clustering.py]"]
  node_lifetime["Lifetime fitting<br/>[lifetime.py]"]
  node_correlation["Correlation analysis<br/>[correlation.py]"]
  node_levels["Intensity levels<br/>[level.py]"]
  node_sessions["Analysis sessions<br/>[session.py]"]
  node_exports["Result export<br/>[export_service.py]"]
  node_irf["IRF mapping"]
end

subgraph group_collaboration["Research collaboration"]
  node_workspace["Workspace management"]
  node_comments["Workspace comments<br/>[comment_service.py]"]
  node_notifications["Notifications"]
end

subgraph group_extensions["Plugins and integrations"]
  node_plugins["Plugin execution"]
  node_pluginmarket["Plugin marketplace"]
end

node_researcher(("Researcher"))
node_onedrive["OneDrive"]

node_researcher -->|"uses"| node_web
node_web -.->|"requests"| node_api
node_researcher -.->|"organizes work"| node_dashboard
node_dashboard -->|"manages"| node_workspace
node_researcher -.->|"selects files"| node_uploadui
node_uploadui -.->|"uploads"| node_api
node_api -->|"routes requests"| node_formats
node_formats -->|"stores uploads"| node_storage
node_storage -->|"reads and writes"| node_supabase
node_api -->|"routes requests"| node_workspace
node_workspace -.->|"persists workspace data"| node_supabase
node_api -->|"routes requests"| node_analysis
node_analysis -.->|"runs analysis"| node_clustering
node_analysis -.->|"runs analysis"| node_lifetime
node_analysis -.->|"runs analysis"| node_correlation
node_clustering -->|"uses"| node_levels
node_formats -.->|"prepares data"| node_measurements
node_analysis -.->|"analyzes"| node_measurements
node_researcher -.->|"saves analyses"| node_sessions
node_sessions -.->|"exports results"| node_exports
node_api -->|"routes authentication"| node_auth
node_auth -->|"links integration"| node_supabase
node_researcher -.->|"runs plugins"| node_plugins
node_plugins -.->|"obtains extensions"| node_pluginmarket
node_researcher -.->|"collaborates"| node_comments
node_researcher -.->|"receives updates"| node_notifications
node_auth -->|"exchanges tokens"| node_onedrive
node_researcher -.->|"maps IRFs"| node_irf
node_irf -->|"queries mappings"| node_supabase
node_irf -->|"downloads IRF"| node_storage

click node_web "https://github.com/cos301-se-2026/full-sms/blob/main/frontend/app/analysisHub/page.tsx"
click node_dashboard "https://github.com/cos301-se-2026/full-sms/blob/main/frontend/app/dashboard/page.tsx"
click node_uploadui "https://github.com/cos301-se-2026/full-sms/blob/main/frontend/app/upload/page.tsx"
click node_api "https://github.com/cos301-se-2026/full-sms/blob/main/api/main.py"
click node_formats "https://github.com/cos301-se-2026/full-sms/blob/main/api/routes/format_routes.py"
click node_workspace "https://github.com/cos301-se-2026/full-sms/blob/main/api/controllers/workspace_controller.py"
click node_storage "https://github.com/cos301-se-2026/full-sms/blob/main/api/services/storage_service.py"
click node_supabase "https://github.com/cos301-se-2026/full-sms/blob/main/api/utils/supabase_client.py"
click node_measurements "https://github.com/cos301-se-2026/full-sms/blob/main/api/services/measurement_service.py"
click node_analysis "https://github.com/cos301-se-2026/full-sms/blob/main/api/controllers/analysis_controller.py"
click node_clustering "https://github.com/cos301-se-2026/full-sms/blob/main/api/legacy/analysis/clustering.py"
click node_lifetime "https://github.com/cos301-se-2026/full-sms/blob/main/api/legacy/analysis/lifetime.py"
click node_correlation "https://github.com/cos301-se-2026/full-sms/blob/main/api/legacy/analysis/correlation.py"
click node_levels "https://github.com/cos301-se-2026/full-sms/blob/main/api/legacy/models/level.py"
click node_sessions "https://github.com/cos301-se-2026/full-sms/blob/main/api/legacy/io/session.py"
click node_exports "https://github.com/cos301-se-2026/full-sms/blob/main/api/services/export_service.py"
click node_auth "https://github.com/cos301-se-2026/full-sms/blob/main/api/services/auth_service.py"
click node_plugins "https://github.com/cos301-se-2026/full-sms/blob/main/api/services/plugin_execution_service.py"
click node_pluginmarket "https://github.com/cos301-se-2026/full-sms/blob/main/api/controllers/plugin_marketplace_controller.py"
click node_comments "https://github.com/cos301-se-2026/full-sms/blob/main/api/services/comment_service.py"
click node_notifications "https://github.com/cos301-se-2026/full-sms/blob/main/api/services/notification_service.py"
click node_irf "https://github.com/cos301-se-2026/full-sms/blob/main/api/controllers/irf_mapping_controller.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_web,node_dashboard,node_uploadui toneBlue
class node_api,node_formats,node_storage,node_supabase,node_auth toneAmber
class node_measurements,node_analysis,node_clustering,node_lifetime,node_correlation,node_levels,node_sessions,node_exports,node_irf toneMint
class node_workspace,node_comments,node_notifications toneRose
class node_plugins,node_pluginmarket,node_researcher,node_onedrive toneIndigo
```

## Components

### Web application

- [Next.js interface](https://github.com/cos301-se-2026/full-sms/blob/main/frontend/app/analysisHub/page.tsx): `frontend/app/analysisHub/page.tsx`
- [Workspace dashboard](https://github.com/cos301-se-2026/full-sms/blob/main/frontend/app/dashboard/page.tsx): `frontend/app/dashboard/page.tsx`
- [File upload](https://github.com/cos301-se-2026/full-sms/blob/main/frontend/app/upload/page.tsx): `frontend/app/upload/page.tsx`

### API and orchestration

- [FastAPI application](https://github.com/cos301-se-2026/full-sms/blob/main/api/main.py): `api/main.py`
- [Format detection and reading](https://github.com/cos301-se-2026/full-sms/blob/main/api/routes/format_routes.py): `api/routes/format_routes.py`
- [Object storage](https://github.com/cos301-se-2026/full-sms/blob/main/api/services/storage_service.py): `api/services/storage_service.py`
- [Supabase services](https://github.com/cos301-se-2026/full-sms/blob/main/api/utils/supabase_client.py): `api/utils/supabase_client.py`
- [Authentication](https://github.com/cos301-se-2026/full-sms/blob/main/api/services/auth_service.py): `api/services/auth_service.py`

### Scientific data

- [Measurement data](https://github.com/cos301-se-2026/full-sms/blob/main/api/services/measurement_service.py): `api/services/measurement_service.py`
- [Analysis endpoints](https://github.com/cos301-se-2026/full-sms/blob/main/api/controllers/analysis_controller.py): `api/controllers/analysis_controller.py`
- [Clustering analysis](https://github.com/cos301-se-2026/full-sms/blob/main/api/legacy/analysis/clustering.py): `api/legacy/analysis/clustering.py`
- [Lifetime fitting](https://github.com/cos301-se-2026/full-sms/blob/main/api/legacy/analysis/lifetime.py): `api/legacy/analysis/lifetime.py`
- [Correlation analysis](https://github.com/cos301-se-2026/full-sms/blob/main/api/legacy/analysis/correlation.py): `api/legacy/analysis/correlation.py`
- [Intensity levels](https://github.com/cos301-se-2026/full-sms/blob/main/api/legacy/models/level.py): `api/legacy/models/level.py`
- [Analysis sessions](https://github.com/cos301-se-2026/full-sms/blob/main/api/legacy/io/session.py): `api/legacy/io/session.py`
- [Result export](https://github.com/cos301-se-2026/full-sms/blob/main/api/services/export_service.py): `api/services/export_service.py`
- [IRF mapping](https://github.com/cos301-se-2026/full-sms/blob/main/api/controllers/irf_mapping_controller.py): `api/controllers/irf_mapping_controller.py`

### Research collaboration

- [Workspace management](https://github.com/cos301-se-2026/full-sms/blob/main/api/controllers/workspace_controller.py): `api/controllers/workspace_controller.py`
- [Workspace comments](https://github.com/cos301-se-2026/full-sms/blob/main/api/services/comment_service.py): `api/services/comment_service.py`
- [Notifications](https://github.com/cos301-se-2026/full-sms/blob/main/api/services/notification_service.py): `api/services/notification_service.py`

### Plugins and integrations

- [Plugin execution](https://github.com/cos301-se-2026/full-sms/blob/main/api/services/plugin_execution_service.py): `api/services/plugin_execution_service.py`
- [Plugin marketplace](https://github.com/cos301-se-2026/full-sms/blob/main/api/controllers/plugin_marketplace_controller.py): `api/controllers/plugin_marketplace_controller.py`

### Other components

- **Researcher**
- **OneDrive**

## Connections

- Researcher → Next.js interface: uses (evidence: `README.md`)
- Next.js interface → FastAPI application: requests
- Researcher → Workspace dashboard: organizes work
- Workspace dashboard → Workspace management: manages
- Researcher → File upload: selects files
- File upload → FastAPI application: uploads
- FastAPI application → Format detection and reading: routes requests (evidence: `api/main.py`)
- Format detection and reading → Object storage: stores uploads (evidence: `api/routes/format_routes.py`)
- Object storage → Supabase services: reads and writes (evidence: `api/services/storage_service.py`)
- FastAPI application → Workspace management: routes requests (evidence: `api/main.py`)
- Workspace management → Supabase services: persists workspace data
- FastAPI application → Analysis endpoints: routes requests (evidence: `api/main.py`)
- Analysis endpoints → Clustering analysis: runs analysis
- Analysis endpoints → Lifetime fitting: runs analysis
- Analysis endpoints → Correlation analysis: runs analysis
- Clustering analysis → Intensity levels: uses (evidence: `api/legacy/analysis/clustering.py`)
- Format detection and reading → Measurement data: prepares data
- Analysis endpoints → Measurement data: analyzes
- Researcher → Analysis sessions: saves analyses
- Analysis sessions → Result export: exports results
- FastAPI application → Authentication: routes authentication (evidence: `api/main.py`)
- Authentication → Supabase services: links integration (evidence: `api/services/auth_service.py`)
- Researcher → Plugin execution: runs plugins
- Plugin execution → Plugin marketplace: obtains extensions
- Researcher → Workspace comments: collaborates
- Researcher → Notifications: receives updates
- Authentication → OneDrive: exchanges tokens (evidence: `api/services/auth_service.py`)
- Researcher → IRF mapping: maps IRFs
- IRF mapping → Supabase services: queries mappings (evidence: `api/controllers/irf_mapping_controller.py`)
- IRF mapping → Object storage: downloads IRF (evidence: `api/controllers/irf_mapping_controller.py`)
