# kingjrm/genshinarchive architecture

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

- Interactive diagram: https://gitdiagram.com/kingjrm/genshinarchive
- Repository: https://github.com/kingjrm/genshinarchive

## Overview

Teyvat Archive is a Next.js reference and exploration site for Genshin Impact story content. Visitors enter through the home page or shared navigation, then browse character, classified-file, story-arc, location, volume, and lore views; selection state and character profiles are managed by the shared archive shell. Content is held in typed local datasets rather than a database or API. The graph preserves the documented browsing branches and shared motion layer; connections to unsampled implementations are included only where the README or source index supports them.

Main entry points: [`src/components/ArchiveShell.tsx`](https://github.com/kingjrm/genshinarchive/blob/main/src/components/ArchiveShell.tsx) (Archive shell), [`src/components/ArcsExplorer.tsx`](https://github.com/kingjrm/genshinarchive/blob/main/src/components/ArcsExplorer.tsx) (Arc explorer), [`src/data/characters.ts`](https://github.com/kingjrm/genshinarchive/blob/main/src/data/characters.ts) (Character records), [`src/animations/PageMotion.tsx`](https://github.com/kingjrm/genshinarchive/blob/main/src/animations/PageMotion.tsx) (Page motion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routes["App routes"]
  node_home["Home page<br/>[page.tsx]"]
  node_characters_route["Characters route<br/>[page.tsx]"]
  node_classified_route["Classified route<br/>[page.tsx]"]
  node_arcs_route["Arcs route<br/>[page.tsx]"]
  node_locations_route["Locations route<br/>[page.tsx]"]
  node_volumes_route["Volumes route<br/>[page.tsx]"]
  node_lore_route["Lore route<br/>[page.tsx]"]
end

subgraph group_explorers["Archive explorers"]
  node_characters_explorer["Character explorer"]
  node_devils_explorer["Classified explorer<br/>[DevilsExplorer.tsx]"]
  node_arcs_explorer["Arc explorer<br/>[ArcsExplorer.tsx]"]
  node_locations_explorer["Location explorer"]
  node_volumes_explorer["Volume gallery"]
end

subgraph group_content["Archive content"]
  node_characters_data["Character records<br/>[characters.ts]"]
  node_devils_data["Classified records<br/>[devils.ts]"]
  node_arcs_data["Story arc records<br/>[arcs.ts]"]
  node_locations_data["Location records<br/>[locations.ts]"]
  node_volumes_data["Volume records<br/>[volumes.ts]"]
  node_lore_data["Lore records<br/>[lore.ts]"]
end

subgraph group_shared["Shared experience"]
  node_archive_shell["Archive shell<br/>[ArchiveShell.tsx]"]
  node_profile["Character profile"]
  node_modal["Modal accessibility<br/>[useModal.ts]"]
end

subgraph group_motion["Motion system"]
  node_page_motion["Page motion<br/>[PageMotion.tsx]"]
  node_panel_motion["Selection motion<br/>[usePanelMotion.ts]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_home
node_visitor -->|"browses"| node_characters_route
node_visitor -->|"browses"| node_classified_route
node_visitor -->|"browses"| node_arcs_route
node_visitor -->|"browses"| node_locations_route
node_visitor -->|"browses"| node_volumes_route
node_visitor -->|"browses"| node_lore_route
node_characters_route -->|"renders"| node_characters_explorer
node_classified_route -->|"renders"| node_devils_explorer
node_arcs_route -->|"renders"| node_arcs_explorer
node_locations_route -->|"renders"| node_locations_explorer
node_volumes_route -->|"renders"| node_volumes_explorer
node_characters_explorer -->|"reads"| node_characters_data
node_devils_explorer -->|"reads"| node_devils_data
node_arcs_explorer -->|"reads"| node_arcs_data
node_arcs_explorer -->|"reads"| node_characters_data
node_arcs_explorer -->|"reads"| node_devils_data
node_arcs_explorer -->|"reads"| node_locations_data
node_locations_explorer -->|"reads"| node_locations_data
node_locations_explorer -->|"reads"| node_arcs_data
node_locations_explorer -->|"reads"| node_characters_data
node_volumes_explorer -->|"reads"| node_volumes_data
node_volumes_explorer -->|"reads"| node_arcs_data
node_lore_route -->|"reads"| node_lore_data
node_lore_route -->|"reads"| node_characters_data
node_home -->|"reads"| node_characters_data
node_home -.->|"reads"| node_arcs_data
node_home -.->|"uses navigation"| node_archive_shell
node_archive_shell -->|"loads records"| node_characters_data
node_archive_shell -->|"renders"| node_profile
node_archive_shell -->|"uses"| node_modal
node_characters_explorer -->|"gets selection"| node_archive_shell
node_devils_explorer -->|"gets selection"| node_archive_shell
node_arcs_explorer -->|"gets selection"| node_archive_shell
node_locations_explorer -->|"uses context"| node_archive_shell
node_volumes_explorer -->|"uses context"| node_archive_shell
node_characters_explorer -->|"animates selection"| node_panel_motion
node_devils_explorer -->|"animates selection"| node_panel_motion
node_home -->|"uses"| node_page_motion
node_characters_route -->|"uses"| node_page_motion
node_classified_route -->|"uses"| node_page_motion
node_arcs_route -->|"uses"| node_page_motion
node_locations_route -->|"uses"| node_page_motion
node_volumes_route -->|"uses"| node_page_motion

click node_home "https://github.com/kingjrm/genshinarchive/blob/main/src/app/page.tsx"
click node_characters_route "https://github.com/kingjrm/genshinarchive/blob/main/src/app/characters/page.tsx"
click node_classified_route "https://github.com/kingjrm/genshinarchive/blob/main/src/app/classified-files/page.tsx"
click node_arcs_route "https://github.com/kingjrm/genshinarchive/blob/main/src/app/arcs/page.tsx"
click node_locations_route "https://github.com/kingjrm/genshinarchive/blob/main/src/app/locations/page.tsx"
click node_volumes_route "https://github.com/kingjrm/genshinarchive/blob/main/src/app/volumes/page.tsx"
click node_lore_route "https://github.com/kingjrm/genshinarchive/blob/main/src/app/lore/page.tsx"
click node_characters_explorer "https://github.com/kingjrm/genshinarchive/blob/main/src/components/CharactersExplorer.tsx"
click node_devils_explorer "https://github.com/kingjrm/genshinarchive/blob/main/src/components/DevilsExplorer.tsx"
click node_arcs_explorer "https://github.com/kingjrm/genshinarchive/blob/main/src/components/ArcsExplorer.tsx"
click node_locations_explorer "https://github.com/kingjrm/genshinarchive/blob/main/src/components/LocationsExplorer.tsx"
click node_volumes_explorer "https://github.com/kingjrm/genshinarchive/blob/main/src/components/VolumesExplorer.tsx"
click node_characters_data "https://github.com/kingjrm/genshinarchive/blob/main/src/data/characters.ts"
click node_devils_data "https://github.com/kingjrm/genshinarchive/blob/main/src/data/devils.ts"
click node_arcs_data "https://github.com/kingjrm/genshinarchive/blob/main/src/data/arcs.ts"
click node_locations_data "https://github.com/kingjrm/genshinarchive/blob/main/src/data/locations.ts"
click node_volumes_data "https://github.com/kingjrm/genshinarchive/blob/main/src/data/volumes.ts"
click node_lore_data "https://github.com/kingjrm/genshinarchive/blob/main/src/data/lore.ts"
click node_archive_shell "https://github.com/kingjrm/genshinarchive/blob/main/src/components/ArchiveShell.tsx"
click node_profile "https://github.com/kingjrm/genshinarchive/blob/main/src/components/CharacterProfile.tsx"
click node_modal "https://github.com/kingjrm/genshinarchive/blob/main/src/lib/useModal.ts"
click node_page_motion "https://github.com/kingjrm/genshinarchive/blob/main/src/animations/PageMotion.tsx"
click node_panel_motion "https://github.com/kingjrm/genshinarchive/blob/main/src/animations/usePanelMotion.ts"

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_home,node_characters_route,node_classified_route,node_arcs_route,node_locations_route,node_volumes_route,node_lore_route toneBlue
class node_characters_explorer,node_devils_explorer,node_arcs_explorer,node_locations_explorer,node_volumes_explorer toneAmber
class node_characters_data,node_devils_data,node_arcs_data,node_locations_data,node_volumes_data,node_lore_data toneMint
class node_archive_shell,node_profile,node_modal toneRose
class node_page_motion,node_panel_motion,node_visitor toneIndigo
```

## Components

### App routes

- [Home page](https://github.com/kingjrm/genshinarchive/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Characters route](https://github.com/kingjrm/genshinarchive/blob/main/src/app/characters/page.tsx): `src/app/characters/page.tsx`
- [Classified route](https://github.com/kingjrm/genshinarchive/blob/main/src/app/classified-files/page.tsx): `src/app/classified-files/page.tsx`
- [Arcs route](https://github.com/kingjrm/genshinarchive/blob/main/src/app/arcs/page.tsx): `src/app/arcs/page.tsx`
- [Locations route](https://github.com/kingjrm/genshinarchive/blob/main/src/app/locations/page.tsx): `src/app/locations/page.tsx`
- [Volumes route](https://github.com/kingjrm/genshinarchive/blob/main/src/app/volumes/page.tsx): `src/app/volumes/page.tsx`
- [Lore route](https://github.com/kingjrm/genshinarchive/blob/main/src/app/lore/page.tsx): `src/app/lore/page.tsx`

### Archive explorers

- [Character explorer](https://github.com/kingjrm/genshinarchive/blob/main/src/components/CharactersExplorer.tsx): `src/components/CharactersExplorer.tsx`
- [Classified explorer](https://github.com/kingjrm/genshinarchive/blob/main/src/components/DevilsExplorer.tsx): `src/components/DevilsExplorer.tsx`
- [Arc explorer](https://github.com/kingjrm/genshinarchive/blob/main/src/components/ArcsExplorer.tsx): `src/components/ArcsExplorer.tsx`
- [Location explorer](https://github.com/kingjrm/genshinarchive/blob/main/src/components/LocationsExplorer.tsx): `src/components/LocationsExplorer.tsx`
- [Volume gallery](https://github.com/kingjrm/genshinarchive/blob/main/src/components/VolumesExplorer.tsx): `src/components/VolumesExplorer.tsx`

### Archive content

- [Character records](https://github.com/kingjrm/genshinarchive/blob/main/src/data/characters.ts): `src/data/characters.ts`
- [Classified records](https://github.com/kingjrm/genshinarchive/blob/main/src/data/devils.ts): `src/data/devils.ts`
- [Story arc records](https://github.com/kingjrm/genshinarchive/blob/main/src/data/arcs.ts): `src/data/arcs.ts`
- [Location records](https://github.com/kingjrm/genshinarchive/blob/main/src/data/locations.ts): `src/data/locations.ts`
- [Volume records](https://github.com/kingjrm/genshinarchive/blob/main/src/data/volumes.ts): `src/data/volumes.ts`
- [Lore records](https://github.com/kingjrm/genshinarchive/blob/main/src/data/lore.ts): `src/data/lore.ts`

### Shared experience

- [Archive shell](https://github.com/kingjrm/genshinarchive/blob/main/src/components/ArchiveShell.tsx): `src/components/ArchiveShell.tsx`
- [Character profile](https://github.com/kingjrm/genshinarchive/blob/main/src/components/CharacterProfile.tsx): `src/components/CharacterProfile.tsx`
- [Modal accessibility](https://github.com/kingjrm/genshinarchive/blob/main/src/lib/useModal.ts): `src/lib/useModal.ts`

### Motion system

- [Page motion](https://github.com/kingjrm/genshinarchive/blob/main/src/animations/PageMotion.tsx): `src/animations/PageMotion.tsx`
- [Selection motion](https://github.com/kingjrm/genshinarchive/blob/main/src/animations/usePanelMotion.ts): `src/animations/usePanelMotion.ts`

### Other components

- **Visitor**

## Connections

- Visitor → Home page: opens (evidence: `README.md`)
- Visitor → Characters route: browses (evidence: `README.md`)
- Visitor → Classified route: browses (evidence: `README.md`)
- Visitor → Arcs route: browses (evidence: `README.md`)
- Visitor → Locations route: browses (evidence: `README.md`)
- Visitor → Volumes route: browses (evidence: `README.md`)
- Visitor → Lore route: browses (evidence: `README.md`)
- Characters route → Character explorer: renders (evidence: `src/app/characters/page.tsx`)
- Classified route → Classified explorer: renders (evidence: `src/app/classified-files/page.tsx`)
- Arcs route → Arc explorer: renders (evidence: `src/app/arcs/page.tsx`)
- Locations route → Location explorer: renders (evidence: `src/app/locations/page.tsx`)
- Volumes route → Volume gallery: renders (evidence: `src/app/volumes/page.tsx`)
- Character explorer → Character records: reads (evidence: `src/components/CharactersExplorer.tsx`)
- Classified explorer → Classified records: reads (evidence: `src/components/DevilsExplorer.tsx`)
- Arc explorer → Story arc records: reads (evidence: `src/components/ArcsExplorer.tsx`)
- Arc explorer → Character records: reads (evidence: `src/components/ArcsExplorer.tsx`)
- Arc explorer → Classified records: reads (evidence: `src/components/ArcsExplorer.tsx`)
- Arc explorer → Location records: reads (evidence: `src/components/ArcsExplorer.tsx`)
- Location explorer → Location records: reads (evidence: `src/components/LocationsExplorer.tsx`)
- Location explorer → Story arc records: reads (evidence: `src/components/LocationsExplorer.tsx`)
- Location explorer → Character records: reads (evidence: `src/components/LocationsExplorer.tsx`)
- Volume gallery → Volume records: reads (evidence: `src/components/VolumesExplorer.tsx`)
- Volume gallery → Story arc records: reads (evidence: `src/components/VolumesExplorer.tsx`)
- Lore route → Lore records: reads (evidence: `src/app/lore/page.tsx`)
- Lore route → Character records: reads (evidence: `src/app/lore/page.tsx`)
- Home page → Character records: reads (evidence: `src/app/page.tsx`)
- Home page → Story arc records: reads
- Home page → Archive shell: uses navigation
- Archive shell → Character records: loads records (evidence: `src/components/ArchiveShell.tsx`)
- Archive shell → Character profile: renders (evidence: `src/components/ArchiveShell.tsx`)
- Archive shell → Modal accessibility: uses (evidence: `src/components/ArchiveShell.tsx`)
- Character explorer → Archive shell: gets selection (evidence: `src/components/CharactersExplorer.tsx`)
- Classified explorer → Archive shell: gets selection (evidence: `src/components/DevilsExplorer.tsx`)
- Arc explorer → Archive shell: gets selection (evidence: `src/components/ArcsExplorer.tsx`)
- Location explorer → Archive shell: uses context (evidence: `src/components/LocationsExplorer.tsx`)
- Volume gallery → Archive shell: uses context (evidence: `src/components/VolumesExplorer.tsx`)
- Character explorer → Selection motion: animates selection (evidence: `src/components/CharactersExplorer.tsx`)
- Classified explorer → Selection motion: animates selection (evidence: `src/components/DevilsExplorer.tsx`)
- Home page → Page motion: uses (evidence: `src/app/page.tsx`)
- Characters route → Page motion: uses (evidence: `src/app/characters/page.tsx`)
- Classified route → Page motion: uses (evidence: `src/app/classified-files/page.tsx`)
- Arcs route → Page motion: uses (evidence: `src/app/arcs/page.tsx`)
- Locations route → Page motion: uses (evidence: `src/app/locations/page.tsx`)
- Volumes route → Page motion: uses (evidence: `src/app/volumes/page.tsx`)
