# avniproject/avni-webapp architecture

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

- Interactive diagram: https://gitdiagram.com/avniproject/avni-webapp
- Repository: https://github.com/avniproject/avni-webapp

## Overview

Avni Webapp is a multi-role application for configuring Avni deployments and supporting field data work. The documented user journey starts with a signed-in user reaching a role-appropriate route: administrators manage organisations and app metadata, while field users enter data; other routes provide assignment, reporting, exports, translations, and documentation. Within administration, deployment management is a distinct stage from organisation-level app design. The graph follows README capability descriptions and visible route registrations; unsampled feature internals are represented only at their known directory paths, without inferred calls.

Main entry points: [`src/rootApp/Routes.jsx`](https://github.com/avniproject/avni-webapp/blob/master/src/rootApp/Routes.jsx) (Route selection), [`src/rootApp/App.jsx`](https://github.com/avniproject/avni-webapp/blob/master/src/rootApp/App.jsx) (Application), [`src/rootApp/ducks.js`](https://github.com/avniproject/avni-webapp/blob/master/src/rootApp/ducks.js) (Auth and app state), [`src/adminApp/OrgManager.jsx`](https://github.com/avniproject/avni-webapp/blob/master/src/adminApp/OrgManager.jsx) (Organisation manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application shell"]
  node_app["Application<br/>[App.jsx]"]
  node_routes["Route selection<br/>[Routes.jsx]"]
  node_auth["Auth and app state<br/>[ducks.js]"]
  node_http["HTTP client<br/>[httpClient.js]"]
end

subgraph group_admin["Administration"]
  node_orgmanager["Organisation manager<br/>[OrgManager.jsx]"]
  node_deployment["Deployment manager"]
  node_designer["App designer"]
  node_metadata["Metadata editing"]
  node_adminstate["Admin state<br/>[Reducers.js]"]
  node_adminstyles["Admin styles<br/>[Styles.js]"]
  node_formmapping["Form mapping<br/>[formMapping.js]"]
end

subgraph group_field["Field operations"]
  node_dataentry["Data entry<br/>[DataEntry.jsx]"]
  node_assignment["Task assignment<br/>[TaskAssignment.jsx]"]
  node_subjectassignment["Subject assignment"]
end

subgraph group_insight["Reporting and support"]
  node_reports["Self-service reports"]
  node_export["Report export<br/>[Export.jsx]"]
  node_translations["Translations<br/>[TranslationSaga.js]"]
  node_docs["Documentation"]
end

node_user(("Web user"))

node_user -->|"opens"| node_app
node_app -->|"renders"| node_routes
node_app -->|"loads user"| node_auth
node_auth -->|"uses"| node_http
node_orgmanager -->|"renders for admins"| node_deployment
node_routes -->|"routes admin"| node_orgmanager
node_routes -->|"routes fieldwork"| node_dataentry
node_routes -->|"routes tasks"| node_assignment
node_routes -->|"routes subjects"| node_subjectassignment
node_routes -->|"routes reports"| node_reports
node_routes -->|"routes export"| node_export
node_routes -->|"routes translations"| node_translations
node_routes -->|"routes documentation"| node_docs
node_designer -->|"edits metadata"| node_metadata

click node_app "https://github.com/avniproject/avni-webapp/blob/master/src/rootApp/App.jsx"
click node_routes "https://github.com/avniproject/avni-webapp/blob/master/src/rootApp/Routes.jsx"
click node_auth "https://github.com/avniproject/avni-webapp/blob/master/src/rootApp/ducks.js"
click node_http "https://github.com/avniproject/avni-webapp/blob/master/src/common/utils/httpClient.js"
click node_orgmanager "https://github.com/avniproject/avni-webapp/blob/master/src/adminApp/OrgManager.jsx"
click node_deployment "https://github.com/avniproject/avni-webapp/blob/master/src/adminApp/DeploymentManager.jsx"
click node_designer "https://github.com/avniproject/avni-webapp/blob/master/src/adminApp/OrgManagerAppDesigner.jsx"
click node_metadata "https://github.com/avniproject/avni-webapp/blob/master/src/adminApp/EncounterType/EditEncounterTypeFields.jsx"
click node_adminstate "https://github.com/avniproject/avni-webapp/blob/master/src/adminApp/Reducers.js"
click node_adminstyles "https://github.com/avniproject/avni-webapp/blob/master/src/adminApp/Util/Styles.js"
click node_formmapping "https://github.com/avniproject/avni-webapp/blob/master/src/adminApp/domain/formMapping.js"
click node_dataentry "https://github.com/avniproject/avni-webapp/blob/master/src/dataEntryApp/DataEntry.jsx"
click node_assignment "https://github.com/avniproject/avni-webapp/blob/master/src/assignment/taskAssignment/TaskAssignment.jsx"
click node_subjectassignment "https://github.com/avniproject/avni-webapp/blob/master/src/assignment/subjectAssignment/SubjectAssignment.jsx"
click node_reports "https://github.com/avniproject/avni-webapp/blob/master/src/reports/SelfServiceReports.jsx"
click node_export "https://github.com/avniproject/avni-webapp/blob/master/src/reports/export/Export.jsx"
click node_translations "https://github.com/avniproject/avni-webapp/blob/master/src/i18nTranslations/TranslationSaga.js"
click node_docs "https://github.com/avniproject/avni-webapp/blob/master/src/common/components/DocumentationContainer.jsx"

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_routes,node_auth,node_http,node_user toneBlue
class node_orgmanager,node_deployment,node_designer,node_metadata,node_adminstate,node_adminstyles,node_formmapping toneAmber
class node_dataentry,node_assignment,node_subjectassignment toneMint
class node_reports,node_export,node_translations,node_docs toneRose
```

## Components

### Application shell

- [Application](https://github.com/avniproject/avni-webapp/blob/master/src/rootApp/App.jsx): `src/rootApp/App.jsx`
- [Route selection](https://github.com/avniproject/avni-webapp/blob/master/src/rootApp/Routes.jsx): `src/rootApp/Routes.jsx`
- [Auth and app state](https://github.com/avniproject/avni-webapp/blob/master/src/rootApp/ducks.js): `src/rootApp/ducks.js`
- [HTTP client](https://github.com/avniproject/avni-webapp/blob/master/src/common/utils/httpClient.js): `src/common/utils/httpClient.js`

### Administration

- [Organisation manager](https://github.com/avniproject/avni-webapp/blob/master/src/adminApp/OrgManager.jsx): `src/adminApp/OrgManager.jsx`
- [Deployment manager](https://github.com/avniproject/avni-webapp/blob/master/src/adminApp/DeploymentManager.jsx): `src/adminApp/DeploymentManager.jsx`
- [App designer](https://github.com/avniproject/avni-webapp/blob/master/src/adminApp/OrgManagerAppDesigner.jsx): `src/adminApp/OrgManagerAppDesigner.jsx`
- [Metadata editing](https://github.com/avniproject/avni-webapp/blob/master/src/adminApp/EncounterType/EditEncounterTypeFields.jsx): `src/adminApp/EncounterType/EditEncounterTypeFields.jsx`
- [Admin state](https://github.com/avniproject/avni-webapp/blob/master/src/adminApp/Reducers.js): `src/adminApp/Reducers.js`
- [Admin styles](https://github.com/avniproject/avni-webapp/blob/master/src/adminApp/Util/Styles.js): `src/adminApp/Util/Styles.js`
- [Form mapping](https://github.com/avniproject/avni-webapp/blob/master/src/adminApp/domain/formMapping.js): `src/adminApp/domain/formMapping.js`

### Field operations

- [Data entry](https://github.com/avniproject/avni-webapp/blob/master/src/dataEntryApp/DataEntry.jsx): `src/dataEntryApp/DataEntry.jsx`
- [Task assignment](https://github.com/avniproject/avni-webapp/blob/master/src/assignment/taskAssignment/TaskAssignment.jsx): `src/assignment/taskAssignment/TaskAssignment.jsx`
- [Subject assignment](https://github.com/avniproject/avni-webapp/blob/master/src/assignment/subjectAssignment/SubjectAssignment.jsx): `src/assignment/subjectAssignment/SubjectAssignment.jsx`

### Reporting and support

- [Self-service reports](https://github.com/avniproject/avni-webapp/blob/master/src/reports/SelfServiceReports.jsx): `src/reports/SelfServiceReports.jsx`
- [Report export](https://github.com/avniproject/avni-webapp/blob/master/src/reports/export/Export.jsx): `src/reports/export/Export.jsx`
- [Translations](https://github.com/avniproject/avni-webapp/blob/master/src/i18nTranslations/TranslationSaga.js): `src/i18nTranslations/TranslationSaga.js`
- [Documentation](https://github.com/avniproject/avni-webapp/blob/master/src/common/components/DocumentationContainer.jsx): `src/common/components/DocumentationContainer.jsx`

### Other components

- **Web user**

## Connections

- Web user → Application: opens
- Application → Route selection: renders (evidence: `src/rootApp/App.jsx`)
- Application → Auth and app state: loads user (evidence: `src/rootApp/App.jsx`)
- Auth and app state → HTTP client: uses (evidence: `src/rootApp/ducks.js`)
- Organisation manager → Deployment manager: renders for admins (evidence: `src/adminApp/OrgManager.jsx`)
- Route selection → Organisation manager: routes admin (evidence: `src/rootApp/Routes.jsx`)
- Route selection → Data entry: routes fieldwork (evidence: `src/rootApp/Routes.jsx`)
- Route selection → Task assignment: routes tasks (evidence: `src/rootApp/Routes.jsx`)
- Route selection → Subject assignment: routes subjects (evidence: `src/rootApp/Routes.jsx`)
- Route selection → Self-service reports: routes reports (evidence: `src/rootApp/Routes.jsx`)
- Route selection → Report export: routes export (evidence: `src/rootApp/Routes.jsx`)
- Route selection → Translations: routes translations (evidence: `src/rootApp/Routes.jsx`)
- Route selection → Documentation: routes documentation (evidence: `src/rootApp/Routes.jsx`)
- App designer → Metadata editing: edits metadata (evidence: `src/adminApp/OrgManagerAppDesigner.jsx`)
