# andrewarzola/lossrun architecture

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

## Overview

This repository is a React admin dashboard template customized with a loss-run intake and review workflow. Users navigate routed pages, enter loss-run details, and the backend API translates submissions into CSV records; the API also exposes CSV reads and record edits/deletions. The route definitions, API handlers, and calendar behavior were sampled, but frontend API-call wiring and most page implementations were not, so those connections are not asserted. The README documents broader dashboard, chart, profile, authentication, form, and UI capabilities.

Main entry points: [`src/App.tsx`](https://github.com/andrewarzola/lossrun/blob/main/src/App.tsx) (React routes), [`src/pages/Forms/FormLossRun.tsx`](https://github.com/andrewarzola/lossrun/blob/main/src/pages/Forms/FormLossRun.tsx) (Loss-run intake), [`backend/loss_run_api.py`](https://github.com/andrewarzola/lossrun/blob/main/backend/loss_run_api.py) (Loss-run API), [`src/main.tsx`](https://github.com/andrewarzola/lossrun/blob/main/src/main.tsx) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["App routing"]
  node_app["React routes<br/>[App.tsx]"]
  node_layout["App layout<br/>[AppLayout.tsx]"]
end

subgraph group_lossrun["Loss-run workflow"]
  node_lossform["Loss-run intake<br/>[FormLossRun.tsx]"]
  node_fields["Claim fields<br/>[DefaultInputs.tsx]"]
  node_claim["Claim details<br/>[Claim.tsx]"]
  node_claimant["Claimant details<br/>[Claimant.tsx]"]
  node_policy["Policy details<br/>[Policy.tsx]"]
  node_accrual["Accrual details<br/>[Accrual.tsx]"]
  node_paid["Payment details<br/>[Paid.tsx]"]
  node_suit["Suit details<br/>[Suit.tsx]"]
  node_notes["Claim notes<br/>[Notes.tsx]"]
  node_api["Loss-run API<br/>[loss_run_api.py]"]
  node_csv[("Loss-run CSV<br/>[loss_run_api.py]")]
  node_fullview["Full view<br/>[FullView.tsx]"]
  node_trialview["Trial view<br/>[TrialView.tsx]"]
  node_lossview["Loss-run view<br/>[LossRunView.tsx]"]
  node_edit["Edit loss-run<br/>[EditLossRun.tsx]"]
end

subgraph group_dashboard["Dashboard features"]
  node_dashboard["Dashboard<br/>[Home.tsx]"]
  node_charts["Charts<br/>[LineChart.tsx]"]
  node_calendar["Calendar<br/>[Calendar.tsx]"]
  node_profile["User profile<br/>[UserProfiles.tsx]"]
  node_auth["Sign-in/up<br/>[SignIn.tsx]"]
  node_formpages["General forms<br/>[FormElements.tsx]"]
  node_ui["UI examples<br/>[Alerts.tsx]"]
end

subgraph group_shared["Shared interface"]
  node_sidebar["Navigation sidebar<br/>[AppSidebar.tsx]"]
  node_theme["Theme state<br/>[ThemeContext.tsx]"]
  node_entry["App entry<br/>[main.tsx]"]
end

node_user(("Admin user"))

node_user -->|"opens dashboard"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"routes dashboard"| node_layout
node_app -->|"routes auth"| node_auth
node_app -->|"routes intake"| node_lossform
node_app -->|"routes table"| node_fullview
node_app -->|"routes table"| node_trialview
node_app -->|"routes table"| node_lossview
node_app -->|"routes home"| node_dashboard
node_app -->|"routes charts"| node_charts
node_app -->|"routes calendar"| node_calendar
node_app -->|"routes profile"| node_profile
node_app -->|"routes forms"| node_formpages
node_app -->|"routes examples"| node_ui
node_layout -->|"renders navigation"| node_sidebar
node_entry -->|"provides theme"| node_theme
node_lossform -->|"uses fields"| node_fields
node_lossform -->|"uses section"| node_claim
node_lossform -->|"uses section"| node_claimant
node_lossform -->|"uses section"| node_policy
node_lossform -->|"uses section"| node_accrual
node_lossform -->|"uses section"| node_paid
node_lossform -->|"uses section"| node_suit
node_lossform -->|"uses section"| node_notes
node_api -->|"reads and writes"| node_csv
node_edit -.->|"updates record"| node_api
node_fullview -.->|"loads CSV"| node_api
node_trialview -.->|"loads CSV"| node_api
node_lossview -.->|"loads CSV"| node_api
node_lossform -.->|"submits record"| node_api

click node_app "https://github.com/andrewarzola/lossrun/blob/main/src/App.tsx"
click node_layout "https://github.com/andrewarzola/lossrun/blob/main/src/layout/AppLayout.tsx"
click node_lossform "https://github.com/andrewarzola/lossrun/blob/main/src/pages/Forms/FormLossRun.tsx"
click node_fields "https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/DefaultInputs.tsx"
click node_claim "https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/Claim.tsx"
click node_claimant "https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/Claimant.tsx"
click node_policy "https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/Policy.tsx"
click node_accrual "https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/Accrual.tsx"
click node_paid "https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/Paid.tsx"
click node_suit "https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/Suit.tsx"
click node_notes "https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/Notes.tsx"
click node_api "https://github.com/andrewarzola/lossrun/blob/main/backend/loss_run_api.py"
click node_csv "https://github.com/andrewarzola/lossrun/blob/main/backend/loss_run_api.py"
click node_fullview "https://github.com/andrewarzola/lossrun/blob/main/src/pages/Tables/FullView.tsx"
click node_trialview "https://github.com/andrewarzola/lossrun/blob/main/src/pages/Tables/TrialView.tsx"
click node_lossview "https://github.com/andrewarzola/lossrun/blob/main/src/pages/Tables/LossRunView.tsx"
click node_edit "https://github.com/andrewarzola/lossrun/blob/main/src/components/tables/edit/EditLossRun.tsx"
click node_dashboard "https://github.com/andrewarzola/lossrun/blob/main/src/pages/Dashboard/Home.tsx"
click node_charts "https://github.com/andrewarzola/lossrun/blob/main/src/pages/Charts/LineChart.tsx"
click node_calendar "https://github.com/andrewarzola/lossrun/blob/main/src/pages/Calendar.tsx"
click node_profile "https://github.com/andrewarzola/lossrun/blob/main/src/pages/UserProfiles.tsx"
click node_auth "https://github.com/andrewarzola/lossrun/blob/main/src/pages/AuthPages/SignIn.tsx"
click node_formpages "https://github.com/andrewarzola/lossrun/blob/main/src/pages/Forms/FormElements.tsx"
click node_ui "https://github.com/andrewarzola/lossrun/blob/main/src/pages/UiElements/Alerts.tsx"
click node_sidebar "https://github.com/andrewarzola/lossrun/blob/main/src/layout/AppSidebar.tsx"
click node_theme "https://github.com/andrewarzola/lossrun/blob/main/src/context/ThemeContext.tsx"
click node_entry "https://github.com/andrewarzola/lossrun/blob/main/src/main.tsx"

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_layout,node_user toneBlue
class node_lossform,node_fields,node_claim,node_claimant,node_policy,node_accrual,node_paid,node_suit,node_notes,node_api,node_csv,node_fullview,node_trialview,node_lossview,node_edit toneAmber
class node_dashboard,node_charts,node_calendar,node_profile,node_auth,node_formpages,node_ui toneMint
class node_sidebar,node_theme,node_entry toneRose
```

## Components

### App routing

- [React routes](https://github.com/andrewarzola/lossrun/blob/main/src/App.tsx): `src/App.tsx`
- [App layout](https://github.com/andrewarzola/lossrun/blob/main/src/layout/AppLayout.tsx): `src/layout/AppLayout.tsx`

### Loss-run workflow

- [Loss-run intake](https://github.com/andrewarzola/lossrun/blob/main/src/pages/Forms/FormLossRun.tsx): `src/pages/Forms/FormLossRun.tsx`
- [Claim fields](https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/DefaultInputs.tsx): `src/components/form/formLossRun/DefaultInputs.tsx`
- [Claim details](https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/Claim.tsx): `src/components/form/formLossRun/Claim.tsx`
- [Claimant details](https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/Claimant.tsx): `src/components/form/formLossRun/Claimant.tsx`
- [Policy details](https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/Policy.tsx): `src/components/form/formLossRun/Policy.tsx`
- [Accrual details](https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/Accrual.tsx): `src/components/form/formLossRun/Accrual.tsx`
- [Payment details](https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/Paid.tsx): `src/components/form/formLossRun/Paid.tsx`
- [Suit details](https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/Suit.tsx): `src/components/form/formLossRun/Suit.tsx`
- [Claim notes](https://github.com/andrewarzola/lossrun/blob/main/src/components/form/formLossRun/Notes.tsx): `src/components/form/formLossRun/Notes.tsx`
- [Loss-run API](https://github.com/andrewarzola/lossrun/blob/main/backend/loss_run_api.py): `backend/loss_run_api.py`
- [Loss-run CSV](https://github.com/andrewarzola/lossrun/blob/main/backend/loss_run_api.py): `backend/loss_run_api.py`
- [Full view](https://github.com/andrewarzola/lossrun/blob/main/src/pages/Tables/FullView.tsx): `src/pages/Tables/FullView.tsx`
- [Trial view](https://github.com/andrewarzola/lossrun/blob/main/src/pages/Tables/TrialView.tsx): `src/pages/Tables/TrialView.tsx`
- [Loss-run view](https://github.com/andrewarzola/lossrun/blob/main/src/pages/Tables/LossRunView.tsx): `src/pages/Tables/LossRunView.tsx`
- [Edit loss-run](https://github.com/andrewarzola/lossrun/blob/main/src/components/tables/edit/EditLossRun.tsx): `src/components/tables/edit/EditLossRun.tsx`

### Dashboard features

- [Dashboard](https://github.com/andrewarzola/lossrun/blob/main/src/pages/Dashboard/Home.tsx): `src/pages/Dashboard/Home.tsx`
- [Charts](https://github.com/andrewarzola/lossrun/blob/main/src/pages/Charts/LineChart.tsx): `src/pages/Charts/LineChart.tsx`
- [Calendar](https://github.com/andrewarzola/lossrun/blob/main/src/pages/Calendar.tsx): `src/pages/Calendar.tsx`
- [User profile](https://github.com/andrewarzola/lossrun/blob/main/src/pages/UserProfiles.tsx): `src/pages/UserProfiles.tsx`
- [Sign-in/up](https://github.com/andrewarzola/lossrun/blob/main/src/pages/AuthPages/SignIn.tsx): `src/pages/AuthPages/SignIn.tsx`
- [General forms](https://github.com/andrewarzola/lossrun/blob/main/src/pages/Forms/FormElements.tsx): `src/pages/Forms/FormElements.tsx`
- [UI examples](https://github.com/andrewarzola/lossrun/blob/main/src/pages/UiElements/Alerts.tsx): `src/pages/UiElements/Alerts.tsx`

### Shared interface

- [Navigation sidebar](https://github.com/andrewarzola/lossrun/blob/main/src/layout/AppSidebar.tsx): `src/layout/AppSidebar.tsx`
- [Theme state](https://github.com/andrewarzola/lossrun/blob/main/src/context/ThemeContext.tsx): `src/context/ThemeContext.tsx`
- [App entry](https://github.com/andrewarzola/lossrun/blob/main/src/main.tsx): `src/main.tsx`

### Other components

- **Admin user**

## Connections

- Admin user → App entry: opens dashboard
- App entry → React routes: renders
- React routes → App layout: routes dashboard
- React routes → Sign-in/up: routes auth
- React routes → Loss-run intake: routes intake
- React routes → Full view: routes table
- React routes → Trial view: routes table
- React routes → Loss-run view: routes table
- React routes → Dashboard: routes home
- React routes → Charts: routes charts
- React routes → Calendar: routes calendar
- React routes → User profile: routes profile
- React routes → General forms: routes forms
- React routes → UI examples: routes examples
- App layout → Navigation sidebar: renders navigation
- App entry → Theme state: provides theme
- Loss-run intake → Claim fields: uses fields
- Loss-run intake → Claim details: uses section
- Loss-run intake → Claimant details: uses section
- Loss-run intake → Policy details: uses section
- Loss-run intake → Accrual details: uses section
- Loss-run intake → Payment details: uses section
- Loss-run intake → Suit details: uses section
- Loss-run intake → Claim notes: uses section
- Loss-run API → Loss-run CSV: reads and writes
- Edit loss-run → Loss-run API: updates record
- Full view → Loss-run API: loads CSV
- Trial view → Loss-run API: loads CSV
- Loss-run view → Loss-run API: loads CSV
- Loss-run intake → Loss-run API: submits record
