# tamilselvan04200803-max/fed_sentinel architecture

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

- Interactive diagram: https://gitdiagram.com/tamilselvan04200803-max/fed_sentinel
- Repository: https://github.com/tamilselvan04200803-max/fed_sentinel

## Overview

FedSentinel-Health is a federated-learning security and operations application for hospital nodes. Operators inspect node readiness, launch enclave training or federation rounds, and review model updates through security checks, trust scoring, and incident handling. The React console queries the backend and receives live events; backend routes coordinate rounds and training and update operational state. The tree documents additional audit, model, compliance, and simulation capabilities. Backend internals beyond the supplied excerpts are represented only where module paths and route documentation support them.

Main entry points: [`src/services/api/apiClient.ts`](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/services/api/apiClient.ts) (API client), [`src/router.tsx`](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/router.tsx) (Feature router), [`backend/services/state_service.py`](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/services/state_service.py) (Application state), [`backend/api/routes/training_routes.py`](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/api/routes/training_routes.py) (Training routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Operator console"]
  node_app["React app<br/>[App.tsx]"]
  node_router["Feature router<br/>[router.tsx]"]
  node_fed_ui["Federation workspace<br/>[FederationPage.tsx]"]
  node_hospital_ui["Hospital training"]
  node_security_ui["Security center<br/>[SecurityCenter.tsx]"]
  node_incident_ui["Incident investigation"]
  node_audit_ui["Audit workspace<br/>[AuditWorkspace.tsx]"]
end

subgraph group_gateway["API and realtime"]
  node_api_client["API client<br/>[apiClient.ts]"]
  node_ws_client["Realtime client<br/>[wsManager.ts]"]
  node_ws_route["WebSocket gateway<br/>[websocket.py]"]
end

subgraph group_federation["Federated operations"]
  node_fed_routes["Federation routes"]
  node_training_routes["Training routes<br/>[training_routes.py]"]
  node_coordinator["Round coordinator<br/>[coordinator.py]"]
  node_aggregation["Update aggregation<br/>[aggregator.py]"]
end

subgraph group_security["Security and trust"]
  node_security_pipeline["Zero-trust pipeline<br/>[pipeline.py]"]
  node_trust_engine["Trust engine<br/>[trust_engine.py]"]
  node_trust_policy["Trust policy<br/>[policy.py]"]
  node_incident_manager["Incident manager<br/>[manager.py]"]
  node_incident_routes["Incident routes<br/>[incident_routes.py]"]
end

subgraph group_state["Operational state"]
  node_audit_routes["Audit routes<br/>[audit_routes.py]"]
  node_model_routes["Model routes<br/>[model_routes.py]"]
  node_client_routes["Client routes<br/>[client_routes.py]"]
  node_state_service["Application state<br/>[state_service.py]"]
  node_database[("Database<br/>[database.py]")]
end

node_operator(("Operator"))

node_operator -->|"uses"| node_app
node_app -->|"renders"| node_router
node_router -->|"routes to"| node_fed_ui
node_router -->|"routes to"| node_hospital_ui
node_router -->|"routes to"| node_security_ui
node_router -->|"routes to"| node_incident_ui
node_router -->|"routes to"| node_audit_ui
node_fed_ui -->|"requests rounds"| node_api_client
node_hospital_ui -->|"requests training"| node_api_client
node_security_ui -->|"requests security data"| node_api_client
node_incident_ui -->|"requests incidents"| node_api_client
node_audit_ui -->|"requests audit data"| node_api_client
node_api_client -->|"HTTP requests"| node_fed_routes
node_api_client -->|"HTTP requests"| node_training_routes
node_api_client -->|"HTTP requests"| node_incident_routes
node_api_client -->|"HTTP requests"| node_audit_routes
node_api_client -->|"HTTP requests"| node_model_routes
node_api_client -->|"HTTP requests"| node_client_routes
node_fed_routes -->|"executes rounds"| node_coordinator
node_coordinator -->|"aggregates updates"| node_aggregation
node_training_routes -->|"verifies updates"| node_security_pipeline
node_training_routes -->|"updates trust"| node_trust_engine
node_trust_engine -->|"uses policy"| node_trust_policy
node_incident_routes -->|"manages incidents"| node_incident_manager
node_fed_routes -->|"reads and updates state"| node_state_service
node_training_routes -->|"reads and updates state"| node_state_service
node_client_routes -->|"reads and updates state"| node_state_service
node_model_routes -->|"reads model state"| node_state_service
node_audit_routes -->|"reads audit state"| node_state_service
node_state_service -->|"persists state"| node_database
node_ws_client -->|"opens event stream"| node_ws_route
node_training_routes -->|"broadcasts events"| node_ws_route
node_ws_route -->|"streams events"| node_ws_client

click node_app "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/App.tsx"
click node_router "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/router.tsx"
click node_fed_ui "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/features/federation/FederationPage.tsx"
click node_hospital_ui "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/features/hospital/EnclaveTrainingLifecycle.tsx"
click node_security_ui "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/components/security/SecurityCenter.tsx"
click node_incident_ui "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/features/incidents/IncidentInvestigation.tsx"
click node_audit_ui "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/features/audit/AuditWorkspace.tsx"
click node_api_client "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/services/api/apiClient.ts"
click node_ws_client "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/services/realtime/wsManager.ts"
click node_ws_route "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/api/websocket.py"
click node_fed_routes "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/api/routes/federation_routes.py"
click node_training_routes "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/api/routes/training_routes.py"
click node_coordinator "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/federation/coordinator.py"
click node_aggregation "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/aggregation/aggregator.py"
click node_security_pipeline "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/security/pipeline.py"
click node_trust_engine "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/trust/trust_engine.py"
click node_trust_policy "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/trust/policy.py"
click node_incident_manager "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/incidents/manager.py"
click node_incident_routes "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/api/routes/incident_routes.py"
click node_audit_routes "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/api/routes/audit_routes.py"
click node_model_routes "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/api/routes/model_routes.py"
click node_client_routes "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/api/routes/client_routes.py"
click node_state_service "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/services/state_service.py"
click node_database "https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/db/database.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_router,node_fed_ui,node_hospital_ui,node_security_ui,node_incident_ui,node_audit_ui toneBlue
class node_api_client,node_ws_client,node_ws_route toneAmber
class node_fed_routes,node_training_routes,node_coordinator,node_aggregation toneMint
class node_security_pipeline,node_trust_engine,node_trust_policy,node_incident_manager,node_incident_routes toneRose
class node_audit_routes,node_model_routes,node_client_routes,node_state_service,node_database,node_operator toneIndigo
```

## Components

### Operator console

- [React app](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/App.tsx): `src/App.tsx`
- [Feature router](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/router.tsx): `src/router.tsx`
- [Federation workspace](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/features/federation/FederationPage.tsx): `src/features/federation/FederationPage.tsx`
- [Hospital training](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/features/hospital/EnclaveTrainingLifecycle.tsx): `src/features/hospital/EnclaveTrainingLifecycle.tsx`
- [Security center](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/components/security/SecurityCenter.tsx): `src/components/security/SecurityCenter.tsx`
- [Incident investigation](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/features/incidents/IncidentInvestigation.tsx): `src/features/incidents/IncidentInvestigation.tsx`
- [Audit workspace](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/features/audit/AuditWorkspace.tsx): `src/features/audit/AuditWorkspace.tsx`

### API and realtime

- [API client](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/services/api/apiClient.ts): `src/services/api/apiClient.ts`
- [Realtime client](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/src/services/realtime/wsManager.ts): `src/services/realtime/wsManager.ts`
- [WebSocket gateway](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/api/websocket.py): `backend/api/websocket.py`

### Federated operations

- [Federation routes](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/api/routes/federation_routes.py): `backend/api/routes/federation_routes.py`
- [Training routes](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/api/routes/training_routes.py): `backend/api/routes/training_routes.py`
- [Round coordinator](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/federation/coordinator.py): `backend/federation/coordinator.py`
- [Update aggregation](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/aggregation/aggregator.py): `backend/aggregation/aggregator.py`

### Security and trust

- [Zero-trust pipeline](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/security/pipeline.py): `backend/security/pipeline.py`
- [Trust engine](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/trust/trust_engine.py): `backend/trust/trust_engine.py`
- [Trust policy](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/trust/policy.py): `backend/trust/policy.py`
- [Incident manager](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/incidents/manager.py): `backend/incidents/manager.py`
- [Incident routes](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/api/routes/incident_routes.py): `backend/api/routes/incident_routes.py`

### Operational state

- [Audit routes](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/api/routes/audit_routes.py): `backend/api/routes/audit_routes.py`
- [Model routes](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/api/routes/model_routes.py): `backend/api/routes/model_routes.py`
- [Client routes](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/api/routes/client_routes.py): `backend/api/routes/client_routes.py`
- [Application state](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/services/state_service.py): `backend/services/state_service.py`
- [Database](https://github.com/tamilselvan04200803-max/fed_sentinel/blob/main/backend/db/database.py): `backend/db/database.py`

### Other components

- **Operator**

## Connections

- Operator → React app: uses
- React app → Feature router: renders
- Feature router → Federation workspace: routes to
- Feature router → Hospital training: routes to
- Feature router → Security center: routes to
- Feature router → Incident investigation: routes to
- Feature router → Audit workspace: routes to
- Federation workspace → API client: requests rounds
- Hospital training → API client: requests training
- Security center → API client: requests security data
- Incident investigation → API client: requests incidents
- Audit workspace → API client: requests audit data
- API client → Federation routes: HTTP requests
- API client → Training routes: HTTP requests
- API client → Incident routes: HTTP requests
- API client → Audit routes: HTTP requests
- API client → Model routes: HTTP requests
- API client → Client routes: HTTP requests
- Federation routes → Round coordinator: executes rounds
- Round coordinator → Update aggregation: aggregates updates
- Training routes → Zero-trust pipeline: verifies updates
- Training routes → Trust engine: updates trust
- Trust engine → Trust policy: uses policy
- Incident routes → Incident manager: manages incidents
- Federation routes → Application state: reads and updates state
- Training routes → Application state: reads and updates state
- Client routes → Application state: reads and updates state
- Model routes → Application state: reads model state
- Audit routes → Application state: reads audit state
- Application state → Database: persists state
- Realtime client → WebSocket gateway: opens event stream
- Training routes → WebSocket gateway: broadcasts events
- WebSocket gateway → Realtime client: streams events
