# zhouhuawei2025/rws_web architecture

> Architecture diagram of the GitHub repository zhouhuawei2025/rws_web, 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/zhouhuawei2025/rws_web
- Repository: https://github.com/zhouhuawei2025/rws_web

## Overview

RWS_Web is a clinical-trial data console: users authenticate to Medidata Rave, select studies, subjects, forms, and dataset type, then preview or export data; a separate workflow uploads query spreadsheets, sends row-by-row queries, and exports failures. The graph follows documented capabilities and sampled endpoint/service calls. Some routing and form-configuration details are documented but their implementation was not sampled, so uncertain internal links are omitted.

Main entry points: [`RWSBackhend/Program.cs`](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Program.cs) (HTTP API routes), [`RWSBackhend/Services/RaveRwsService.cs`](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/RaveRwsService.cs) (RWS service), [`RWSFrontend/src/App.tsx`](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSFrontend/src/App.tsx) (React console), [`RWSBackhend/Services/FormOidProvider.cs`](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/FormOidProvider.cs) (Form OID provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web console"]
  node_app["React console<br/>[App.tsx]"]
end

subgraph group_api["API orchestration"]
  node_api_routes["HTTP API routes<br/>[Program.cs]"]
  node_models["API data models<br/>[ApiModels.cs]"]
  node_dataset_preview["Dataset preview<br/>[Program.cs]"]
  node_query_upload["Query upload route<br/>[Program.cs]"]
  node_query_send["Query send route<br/>[Program.cs]"]
  node_query_failures["Failed query export route<br/>[Program.cs]"]
end

subgraph group_rws["Rave integration"]
  node_rws_service["RWS service<br/>[RaveRwsService.cs]"]
end

subgraph group_data["Data workflows"]
  node_dataset_parser["ODM dataset parser"]
  node_excel_exporter["Dataset Excel export<br/>[ExcelExporter.cs]"]
  node_query_excel["Query spreadsheet handling"]
  node_query_builder["Query ODM builder"]
end

subgraph group_state["Session and forms"]
  node_session_store[("Session store<br/>[RwsSessionStore.cs]")]
  node_form_provider["Form OID provider<br/>[FormOidProvider.cs]"]
  node_form_config["Form OID config<br/>[form-oids.json]"]
end

node_user(("Console user"))
node_rws_external{{"Medidata Rave RWS"}}
node_rave_data[("Rave clinical data")]

node_user -->|"uses"| node_app
node_app -->|"calls API"| node_api_routes
node_api_routes -->|"creates / checks"| node_session_store
node_api_routes -->|"requests Rave data"| node_rws_service
node_rws_service -->|"sends requests"| node_rws_external
node_rws_external -->|"returns responses"| node_rws_service
node_rws_service -->|"parses ODM"| node_dataset_parser
node_rws_service -->|"builds query XML"| node_query_builder
node_rws_external -->|"serves trial data"| node_rave_data
node_rave_data -->|"accepts queries"| node_rws_external
node_api_routes -->|"gets / imports forms"| node_form_provider
node_form_provider -->|"reads config"| node_form_config
node_api_routes -->|"exports download"| node_excel_exporter
node_api_routes -->|"builds preview response"| node_dataset_preview
node_dataset_preview -->|"returns preview"| node_app
node_api_routes -->|"handles upload"| node_query_upload
node_query_upload -->|"reads rows"| node_query_excel
node_api_routes -->|"handles send"| node_query_send
node_query_send -->|"sends rows"| node_rws_service
node_api_routes -->|"handles export"| node_query_failures
node_query_failures -->|"exports failures"| node_query_excel

click node_app "https://github.com/zhouhuawei2025/rws_web/blob/main/RWSFrontend/src/App.tsx"
click node_api_routes "https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Program.cs"
click node_models "https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Models/ApiModels.cs"
click node_rws_service "https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/RaveRwsService.cs"
click node_session_store "https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/RwsSessionStore.cs"
click node_form_provider "https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/FormOidProvider.cs"
click node_form_config "https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/form-oids.json"
click node_dataset_parser "https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/OdmDatasetParser.cs"
click node_excel_exporter "https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/ExcelExporter.cs"
click node_query_excel "https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/QueryExcelService.cs"
click node_query_builder "https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/RaveQueryBuilder.cs"
click node_dataset_preview "https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Program.cs"
click node_query_upload "https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Program.cs"
click node_query_send "https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Program.cs"
click node_query_failures "https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Program.cs"

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_user toneBlue
class node_api_routes,node_models,node_dataset_preview,node_query_upload,node_query_send,node_query_failures,node_rave_data toneAmber
class node_rws_service toneMint
class node_dataset_parser,node_excel_exporter,node_query_excel,node_query_builder toneRose
class node_session_store,node_form_provider,node_form_config,node_rws_external toneIndigo
```

## Components

### Web console

- [React console](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSFrontend/src/App.tsx): `RWSFrontend/src/App.tsx`

### API orchestration

- [HTTP API routes](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Program.cs): `RWSBackhend/Program.cs`
- [API data models](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Models/ApiModels.cs): `RWSBackhend/Models/ApiModels.cs`
- [Dataset preview](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Program.cs): `RWSBackhend/Program.cs`
- [Query upload route](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Program.cs): `RWSBackhend/Program.cs`
- [Query send route](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Program.cs): `RWSBackhend/Program.cs`
- [Failed query export route](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Program.cs): `RWSBackhend/Program.cs`

### Rave integration

- [RWS service](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/RaveRwsService.cs): `RWSBackhend/Services/RaveRwsService.cs`

### Data workflows

- [ODM dataset parser](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/OdmDatasetParser.cs): `RWSBackhend/Services/OdmDatasetParser.cs`
- [Dataset Excel export](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/ExcelExporter.cs): `RWSBackhend/Services/ExcelExporter.cs`
- [Query spreadsheet handling](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/QueryExcelService.cs): `RWSBackhend/Services/QueryExcelService.cs`
- [Query ODM builder](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/RaveQueryBuilder.cs): `RWSBackhend/Services/RaveQueryBuilder.cs`

### Session and forms

- [Session store](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/RwsSessionStore.cs): `RWSBackhend/Services/RwsSessionStore.cs`
- [Form OID provider](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/Services/FormOidProvider.cs): `RWSBackhend/Services/FormOidProvider.cs`
- [Form OID config](https://github.com/zhouhuawei2025/rws_web/blob/main/RWSBackhend/form-oids.json): `RWSBackhend/form-oids.json`

### Other components

- **Console user**
- **Medidata Rave RWS**
- **Rave clinical data**

## Connections

- Console user → React console: uses
- React console → HTTP API routes: calls API
- HTTP API routes → Session store: creates / checks
- HTTP API routes → RWS service: requests Rave data
- RWS service → Medidata Rave RWS: sends requests
- Medidata Rave RWS → RWS service: returns responses
- RWS service → ODM dataset parser: parses ODM
- RWS service → Query ODM builder: builds query XML
- Medidata Rave RWS → Rave clinical data: serves trial data
- Rave clinical data → Medidata Rave RWS: accepts queries
- HTTP API routes → Form OID provider: gets / imports forms
- Form OID provider → Form OID config: reads config
- HTTP API routes → Dataset Excel export: exports download
- HTTP API routes → Dataset preview: builds preview response
- Dataset preview → React console: returns preview
- HTTP API routes → Query upload route: handles upload
- Query upload route → Query spreadsheet handling: reads rows
- HTTP API routes → Query send route: handles send
- Query send route → RWS service: sends rows
- HTTP API routes → Failed query export route: handles export
- Failed query export route → Query spreadsheet handling: exports failures
