# goshi4058/actis-web architecture

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

- Interactive diagram: https://gitdiagram.com/goshi4058/actis-web
- Repository: https://github.com/goshi4058/actis-web

## Overview

ACTIS appears to be a railway timetable and staff-information web application, with dataset management, train views, and account/admin areas. The main user flow enters through the React app, selects a dataset, and opens timetable, line, train, or staff views; authenticated users also manage datasets and accounts. Firebase provides authentication and database access, while staff views derive train relationships and render station details. The README is only the Vite template, so product capabilities and connections are inferred conservatively from the tree and available source index; unsampled modules are not assumed to be wired together.

Main entry points: [`src/App.jsx`](https://github.com/goshi4058/actis-web/blob/main/src/App.jsx) (Application Router), [`src/firebase/config.js`](https://github.com/goshi4058/actis-web/blob/main/src/firebase/config.js) (Firebase Auth and Database), [`src/App.tsx`](https://github.com/goshi4058/actis-web/blob/main/src/App.tsx) (Alternate Router), [`src/components/dataset/DatasetSelector.jsx`](https://github.com/goshi4058/actis-web/blob/main/src/components/dataset/DatasetSelector.jsx) (Dataset Selector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app_entry["Application Router<br/>[App.jsx]"]
  node_app_ts["Alternate Router<br/>[App.tsx]"]
end

subgraph group_datasets["Dataset Management"]
  node_dataset_context["Dataset Context<br/>[DatasetContext.jsx]"]
  node_dataset_selector["Dataset Selector"]
  node_datasets_page["Dataset Manager<br/>[Datasets.jsx]"]
  node_shared_dataset["Shared Dataset<br/>[SharedDataset.jsx]"]
  node_upload["Data Upload<br/>[upload.jsx]"]
end

subgraph group_rail["Railway Views"]
  node_home["Home<br/>[Home.jsx]"]
  node_timetable["Timetable<br/>[Timetable.jsx]"]
  node_lines["Railway Lines<br/>[Lines.jsx]"]
  node_departure["Departure Board<br/>[DepartureBoard.jsx]"]
  node_trains["Train Views<br/>[trains.jsx]"]
  node_diagram["Railway Diagram<br/>[Diagram.jsx]"]
  node_train_relations["Train Relations<br/>[trainRelations.js]"]
  node_oud_parser["OUD2 Parser<br/>[oud2Parser.js]"]
end

subgraph group_staff["Staff Operations"]
  node_operation_parser["Operation Parser<br/>[operationParser.js]"]
  node_staff_page["Staff Details<br/>[Staff.jsx]"]
  node_staff_operation["Staff Operation<br/>[StaffOperation.jsx]"]
  node_roster["Staff Roster<br/>[Roster.jsx]"]
  node_staff_roster["Roster View<br/>[StaffRoster.jsx]"]
  node_staff_card["Staff Card<br/>[StaffCard.jsx]"]
  node_staff_table["Station Table<br/>[StaffTable.jsx]"]
  node_crew_routes["Crew Route Generator"]
end

subgraph group_identity["Identity and Admin"]
  node_firebase[("Firebase Auth and Database<br/>[config.js]")]
  node_auth_guard["Authentication Guard<br/>[AuthGuard.jsx]"]
  node_admin_guard["Admin Guard<br/>[AdminGuard.jsx]"]
  node_admin["Admin Console<br/>[Admin.jsx]"]
  node_account["Account<br/>[Account.jsx]"]
  node_admin_utils["Admin Checks<br/>[admin.js]"]
  node_auth_worker["Authentication Worker<br/>[index.js]"]
end

node_user(("User"))

node_user -->|"opens"| node_app_entry
node_app_entry -->|"routes to"| node_home
node_app_entry -->|"routes to"| node_timetable
node_app_entry -->|"routes to"| node_lines
node_app_entry -->|"routes to"| node_datasets_page
node_app_entry -->|"routes to"| node_staff_page
node_app_entry -->|"routes to"| node_staff_operation
node_app_entry -->|"routes to"| node_crew_routes
node_app_entry -->|"protects routes"| node_auth_guard
node_app_entry -->|"protects routes"| node_admin_guard
node_app_entry -->|"routes to"| node_shared_dataset
node_app_ts -->|"routes to"| node_roster
node_app_ts -->|"routes to"| node_trains
node_app_ts -->|"routes to"| node_departure
node_app_ts -->|"routes to"| node_diagram
node_dataset_context -->|"reads datasets"| node_firebase
node_dataset_selector -->|"selects dataset"| node_dataset_context
node_datasets_page -->|"uses dataset state"| node_dataset_context
node_timetable -->|"renders selector"| node_dataset_selector
node_timetable -->|"loads rail data"| node_firebase
node_lines -->|"renders selector"| node_dataset_selector
node_lines -->|"loads line data"| node_firebase
node_departure -->|"uses relations"| node_train_relations
node_staff_page -->|"derives connections"| node_train_relations
node_staff_page -->|"renders details"| node_staff_card
node_staff_card -->|"renders table"| node_staff_table
node_staff_operation -->|"renders details"| node_staff_card
node_crew_routes -->|"loads trains and lines"| node_firebase
node_crew_routes -->|"renders selector"| node_dataset_selector
node_auth_guard -->|"checks user"| node_firebase
node_admin_guard -->|"checks admin"| node_admin_utils
node_admin_guard -->|"checks auth state"| node_firebase
node_admin -->|"uses account data"| node_firebase
node_account -->|"uses account data"| node_firebase

click node_app_entry "https://github.com/goshi4058/actis-web/blob/main/src/App.jsx"
click node_app_ts "https://github.com/goshi4058/actis-web/blob/main/src/App.tsx"
click node_dataset_context "https://github.com/goshi4058/actis-web/blob/main/src/context/DatasetContext.jsx"
click node_dataset_selector "https://github.com/goshi4058/actis-web/blob/main/src/components/dataset/DatasetSelector.jsx"
click node_datasets_page "https://github.com/goshi4058/actis-web/blob/main/src/pages/Datasets.jsx"
click node_shared_dataset "https://github.com/goshi4058/actis-web/blob/main/src/pages/SharedDataset.jsx"
click node_upload "https://github.com/goshi4058/actis-web/blob/main/src/pages/upload.jsx"
click node_firebase "https://github.com/goshi4058/actis-web/blob/main/src/firebase/config.js"
click node_home "https://github.com/goshi4058/actis-web/blob/main/src/pages/Home.jsx"
click node_timetable "https://github.com/goshi4058/actis-web/blob/main/src/pages/Timetable.jsx"
click node_lines "https://github.com/goshi4058/actis-web/blob/main/src/pages/Lines.jsx"
click node_departure "https://github.com/goshi4058/actis-web/blob/main/src/pages/DepartureBoard.jsx"
click node_trains "https://github.com/goshi4058/actis-web/blob/main/src/pages/trains.jsx"
click node_diagram "https://github.com/goshi4058/actis-web/blob/main/src/pages/Diagram.jsx"
click node_train_relations "https://github.com/goshi4058/actis-web/blob/main/src/utils/trainRelations.js"
click node_oud_parser "https://github.com/goshi4058/actis-web/blob/main/src/parser/oud2Parser.js"
click node_operation_parser "https://github.com/goshi4058/actis-web/blob/main/src/parser/operationParser.js"
click node_staff_page "https://github.com/goshi4058/actis-web/blob/main/src/pages/Staff.jsx"
click node_staff_operation "https://github.com/goshi4058/actis-web/blob/main/src/pages/StaffOperation.jsx"
click node_roster "https://github.com/goshi4058/actis-web/blob/main/src/pages/Roster.jsx"
click node_staff_roster "https://github.com/goshi4058/actis-web/blob/main/src/pages/StaffRoster.jsx"
click node_staff_card "https://github.com/goshi4058/actis-web/blob/main/src/components/staff/StaffCard.jsx"
click node_staff_table "https://github.com/goshi4058/actis-web/blob/main/src/components/staff/StaffTable.jsx"
click node_crew_routes "https://github.com/goshi4058/actis-web/blob/main/src/pages/CrewRouteGenerator.jsx"
click node_auth_guard "https://github.com/goshi4058/actis-web/blob/main/src/components/AuthGuard.jsx"
click node_admin_guard "https://github.com/goshi4058/actis-web/blob/main/src/components/AdminGuard.jsx"
click node_admin "https://github.com/goshi4058/actis-web/blob/main/src/pages/Admin.jsx"
click node_account "https://github.com/goshi4058/actis-web/blob/main/src/pages/Account.jsx"
click node_admin_utils "https://github.com/goshi4058/actis-web/blob/main/src/utils/admin.js"
click node_auth_worker "https://github.com/goshi4058/actis-web/blob/main/workers/actis-auth/src/index.js"

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_entry,node_app_ts,node_user toneBlue
class node_dataset_context,node_dataset_selector,node_datasets_page,node_shared_dataset,node_upload toneAmber
class node_home,node_timetable,node_lines,node_departure,node_trains,node_diagram,node_train_relations,node_oud_parser toneMint
class node_operation_parser,node_staff_page,node_staff_operation,node_roster,node_staff_roster,node_staff_card,node_staff_table,node_crew_routes toneRose
class node_firebase,node_auth_guard,node_admin_guard,node_admin,node_account,node_admin_utils,node_auth_worker toneIndigo
```

## Components

### Application

- [Application Router](https://github.com/goshi4058/actis-web/blob/main/src/App.jsx): `src/App.jsx`
- [Alternate Router](https://github.com/goshi4058/actis-web/blob/main/src/App.tsx): `src/App.tsx`

### Dataset Management

- [Dataset Context](https://github.com/goshi4058/actis-web/blob/main/src/context/DatasetContext.jsx): `src/context/DatasetContext.jsx`
- [Dataset Selector](https://github.com/goshi4058/actis-web/blob/main/src/components/dataset/DatasetSelector.jsx): `src/components/dataset/DatasetSelector.jsx`
- [Dataset Manager](https://github.com/goshi4058/actis-web/blob/main/src/pages/Datasets.jsx): `src/pages/Datasets.jsx`
- [Shared Dataset](https://github.com/goshi4058/actis-web/blob/main/src/pages/SharedDataset.jsx): `src/pages/SharedDataset.jsx`
- [Data Upload](https://github.com/goshi4058/actis-web/blob/main/src/pages/upload.jsx): `src/pages/upload.jsx`

### Railway Views

- [Home](https://github.com/goshi4058/actis-web/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Timetable](https://github.com/goshi4058/actis-web/blob/main/src/pages/Timetable.jsx): `src/pages/Timetable.jsx`
- [Railway Lines](https://github.com/goshi4058/actis-web/blob/main/src/pages/Lines.jsx): `src/pages/Lines.jsx`
- [Departure Board](https://github.com/goshi4058/actis-web/blob/main/src/pages/DepartureBoard.jsx): `src/pages/DepartureBoard.jsx`
- [Train Views](https://github.com/goshi4058/actis-web/blob/main/src/pages/trains.jsx): `src/pages/trains.jsx`
- [Railway Diagram](https://github.com/goshi4058/actis-web/blob/main/src/pages/Diagram.jsx): `src/pages/Diagram.jsx`
- [Train Relations](https://github.com/goshi4058/actis-web/blob/main/src/utils/trainRelations.js): `src/utils/trainRelations.js`
- [OUD2 Parser](https://github.com/goshi4058/actis-web/blob/main/src/parser/oud2Parser.js): `src/parser/oud2Parser.js`

### Staff Operations

- [Operation Parser](https://github.com/goshi4058/actis-web/blob/main/src/parser/operationParser.js): `src/parser/operationParser.js`
- [Staff Details](https://github.com/goshi4058/actis-web/blob/main/src/pages/Staff.jsx): `src/pages/Staff.jsx`
- [Staff Operation](https://github.com/goshi4058/actis-web/blob/main/src/pages/StaffOperation.jsx): `src/pages/StaffOperation.jsx`
- [Staff Roster](https://github.com/goshi4058/actis-web/blob/main/src/pages/Roster.jsx): `src/pages/Roster.jsx`
- [Roster View](https://github.com/goshi4058/actis-web/blob/main/src/pages/StaffRoster.jsx): `src/pages/StaffRoster.jsx`
- [Staff Card](https://github.com/goshi4058/actis-web/blob/main/src/components/staff/StaffCard.jsx): `src/components/staff/StaffCard.jsx`
- [Station Table](https://github.com/goshi4058/actis-web/blob/main/src/components/staff/StaffTable.jsx): `src/components/staff/StaffTable.jsx`
- [Crew Route Generator](https://github.com/goshi4058/actis-web/blob/main/src/pages/CrewRouteGenerator.jsx): `src/pages/CrewRouteGenerator.jsx`

### Identity and Admin

- [Firebase Auth and Database](https://github.com/goshi4058/actis-web/blob/main/src/firebase/config.js): `src/firebase/config.js`
- [Authentication Guard](https://github.com/goshi4058/actis-web/blob/main/src/components/AuthGuard.jsx): `src/components/AuthGuard.jsx`
- [Admin Guard](https://github.com/goshi4058/actis-web/blob/main/src/components/AdminGuard.jsx): `src/components/AdminGuard.jsx`
- [Admin Console](https://github.com/goshi4058/actis-web/blob/main/src/pages/Admin.jsx): `src/pages/Admin.jsx`
- [Account](https://github.com/goshi4058/actis-web/blob/main/src/pages/Account.jsx): `src/pages/Account.jsx`
- [Admin Checks](https://github.com/goshi4058/actis-web/blob/main/src/utils/admin.js): `src/utils/admin.js`
- [Authentication Worker](https://github.com/goshi4058/actis-web/blob/main/workers/actis-auth/src/index.js): `workers/actis-auth/src/index.js`

### Other components

- **User**

## Connections

- User → Application Router: opens
- Application Router → Home: routes to (evidence: `src/App.jsx`)
- Application Router → Timetable: routes to (evidence: `src/App.jsx`)
- Application Router → Railway Lines: routes to (evidence: `src/App.jsx`)
- Application Router → Dataset Manager: routes to (evidence: `src/App.jsx`)
- Application Router → Staff Details: routes to (evidence: `src/App.jsx`)
- Application Router → Staff Operation: routes to (evidence: `src/App.jsx`)
- Application Router → Crew Route Generator: routes to (evidence: `src/App.jsx`)
- Application Router → Authentication Guard: protects routes (evidence: `src/App.jsx`)
- Application Router → Admin Guard: protects routes (evidence: `src/App.jsx`)
- Application Router → Shared Dataset: routes to (evidence: `src/App.jsx`)
- Alternate Router → Staff Roster: routes to (evidence: `src/App.tsx`)
- Alternate Router → Train Views: routes to (evidence: `src/App.tsx`)
- Alternate Router → Departure Board: routes to (evidence: `src/App.tsx`)
- Alternate Router → Railway Diagram: routes to (evidence: `src/App.tsx`)
- Dataset Context → Firebase Auth and Database: reads datasets (evidence: `src/context/DatasetContext.jsx`)
- Dataset Selector → Dataset Context: selects dataset (evidence: `src/components/dataset/DatasetSelector.jsx`)
- Dataset Manager → Dataset Context: uses dataset state (evidence: `src/pages/Datasets.jsx`)
- Timetable → Dataset Selector: renders selector (evidence: `src/pages/Timetable.jsx`)
- Timetable → Firebase Auth and Database: loads rail data (evidence: `src/pages/Timetable.jsx`)
- Railway Lines → Dataset Selector: renders selector (evidence: `src/pages/Lines.jsx`)
- Railway Lines → Firebase Auth and Database: loads line data (evidence: `src/pages/Lines.jsx`)
- Departure Board → Train Relations: uses relations (evidence: `src/pages/DepartureBoard.jsx`)
- Staff Details → Train Relations: derives connections (evidence: `src/pages/Staff.jsx`)
- Staff Details → Staff Card: renders details (evidence: `src/pages/Staff.jsx`)
- Staff Card → Station Table: renders table (evidence: `src/components/staff/StaffCard.jsx`)
- Staff Operation → Staff Card: renders details (evidence: `src/pages/StaffOperation.jsx`)
- Crew Route Generator → Firebase Auth and Database: loads trains and lines (evidence: `src/pages/CrewRouteGenerator.jsx`)
- Crew Route Generator → Dataset Selector: renders selector (evidence: `src/pages/CrewRouteGenerator.jsx`)
- Authentication Guard → Firebase Auth and Database: checks user (evidence: `src/components/AuthGuard.jsx`)
- Admin Guard → Admin Checks: checks admin (evidence: `src/components/AdminGuard.jsx`)
- Admin Guard → Firebase Auth and Database: checks auth state (evidence: `src/components/AdminGuard.jsx`)
- Admin Console → Firebase Auth and Database: uses account data (evidence: `src/pages/Admin.jsx`)
- Account → Firebase Auth and Database: uses account data (evidence: `src/pages/Account.jsx`)
