# delmoonkarn/del-anime-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/delmoonkarn/del-anime-tracker
- Repository: https://github.com/delmoonkarn/del-anime-tracker

## Overview

Anime Tracker is a seasonal anime tracking app with a React client and two deployment modes: local SQLite or Cloudflare D1. The user workflow is to explore/search AniList, add shows to the schedule or collections, update watch progress and links, and persist the resulting lists; routing also supports direct links to pages and show details. Settings provide account and backup workflows. The README documents these capabilities; where their implementation was not sampled, the graph preserves the subsystem but omits unverified internal links.

Main entry points: [`src/App.tsx`](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/App.tsx) (App orchestration), [`server/app.ts`](https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/app.ts) (HTTP API routes), [`src/lib/anilist.ts`](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/lib/anilist.ts) (AniList client), [`src/components/DiscoverPage.tsx`](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/DiscoverPage.tsx) (Season explore)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Tracker client"]
  node_react["Client bootstrap<br/>[main.tsx]"]
  node_app["App orchestration<br/>[App.tsx]"]
  node_routing["Page routing<br/>[routes.ts]"]
  node_settings["Settings and backups UI<br/>[SettingsPage.tsx]"]
end

subgraph group_anime["Anime features"]
  node_schedule["Season schedule<br/>[ScheduleGrid.tsx]"]
  node_watchlist["Watchlist<br/>[WatchlistPage.tsx]"]
  node_explore["Season explore<br/>[DiscoverPage.tsx]"]
  node_adult["H explore and favorites<br/>[HDiscoverPage.tsx]"]
  node_collections["Collections<br/>[CollectionPage.tsx]"]
  node_detail["Show details"]
  node_search["Global search<br/>[GlobalSearch.tsx]"]
  node_anilist["AniList client<br/>[anilist.ts]"]
  node_links["Streaming links<br/>[streamLinks.ts]"]
end

subgraph group_server["App server"]
  node_approuter["HTTP API routes<br/>[app.ts]"]
  node_localentry["Local server entry<br/>[index.ts]"]
  node_worker["Cloudflare Worker<br/>[worker.ts]"]
end

subgraph group_persistence["Persistence and backups"]
  node_storageclient["Client list storage<br/>[storage.ts]"]
  node_db["Database operations<br/>[db.ts]"]
  node_sqlite["SQLite adapter<br/>[sqlite.ts]"]
  node_d1["D1 adapter<br/>[d1.ts]"]
  node_backup["SQL backup and restore<br/>[backup.ts]"]
end

subgraph group_identity["Accounts and email"]
  node_authgate["Sign-in gate<br/>[AuthGate.tsx]"]
  node_auth["Account authentication<br/>[auth.ts]"]
  node_email["Backup email<br/>[email.ts]"]
end

node_user(("Tracker user"))
node_anilistservice(("AniList"))
node_sqlitefile[("Local SQLite database")]
node_cloudflare[("Cloudflare D1")]
node_resend["Resend email service"]

node_user -->|"uses"| node_react
node_react -->|"mounts"| node_authgate
node_authgate -->|"renders"| node_app
node_app -->|"parses routes"| node_routing
node_app -->|"renders"| node_schedule
node_app -->|"renders"| node_watchlist
node_app -->|"routes to"| node_explore
node_app -->|"routes to"| node_adult
node_app -->|"routes to"| node_collections
node_app -->|"renders"| node_detail
node_app -->|"renders"| node_settings
node_app -->|"renders"| node_search
node_explore -->|"fetches catalog"| node_anilist
node_search -->|"searches"| node_anilist
node_detail -->|"fetches details"| node_anilist
node_anilist -->|"queries"| node_anilistservice
node_app -->|"saves lists"| node_storageclient
node_schedule -->|"updates progress"| node_user
node_watchlist -->|"updates progress"| node_user
node_detail -->|"resolves watch links"| node_links
node_explore -->|"filters services"| node_links
node_app -.->|"requests storage API"| node_approuter
node_settings -->|"requests backup API"| node_approuter
node_localentry -->|"serves routes"| node_approuter
node_localentry -->|"configures"| node_sqlite
node_worker -->|"serves routes"| node_approuter
node_worker -->|"configures"| node_d1
node_approuter -->|"reads and writes"| node_db
node_approuter -->|"builds backups"| node_backup
node_approuter -.->|"authenticates"| node_auth
node_auth -->|"sends reset mail"| node_email
node_backup -->|"sends scheduled backups"| node_email
node_email -.->|"sends mail"| node_resend
node_sqlite -->|"stores data"| node_sqlitefile
node_d1 -->|"stores data"| node_cloudflare
node_storageclient -->|"writes API data"| node_approuter

click node_react "https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/main.tsx"
click node_app "https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/App.tsx"
click node_routing "https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/lib/routes.ts"
click node_schedule "https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/ScheduleGrid.tsx"
click node_watchlist "https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/WatchlistPage.tsx"
click node_explore "https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/DiscoverPage.tsx"
click node_adult "https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/HDiscoverPage.tsx"
click node_collections "https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/CollectionPage.tsx"
click node_detail "https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/AnimeDetailPage.tsx"
click node_search "https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/GlobalSearch.tsx"
click node_anilist "https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/lib/anilist.ts"
click node_links "https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/lib/streamLinks.ts"
click node_storageclient "https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/lib/storage.ts"
click node_settings "https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/SettingsPage.tsx"
click node_authgate "https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/AuthGate.tsx"
click node_approuter "https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/app.ts"
click node_localentry "https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/index.ts"
click node_worker "https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/worker.ts"
click node_db "https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/db.ts"
click node_sqlite "https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/sqlite.ts"
click node_d1 "https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/d1.ts"
click node_backup "https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/backup.ts"
click node_auth "https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/auth.ts"
click node_email "https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/email.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_react,node_app,node_routing,node_settings,node_user toneBlue
class node_schedule,node_watchlist,node_explore,node_adult,node_collections,node_detail,node_search,node_anilist,node_links,node_sqlitefile,node_cloudflare toneAmber
class node_approuter,node_localentry,node_worker toneMint
class node_storageclient,node_db,node_sqlite,node_d1,node_backup toneRose
class node_authgate,node_auth,node_email,node_anilistservice,node_resend toneIndigo
```

## Components

### Tracker client

- [Client bootstrap](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/main.tsx): `src/main.tsx`
- [App orchestration](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/App.tsx): `src/App.tsx`
- [Page routing](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/lib/routes.ts): `src/lib/routes.ts`
- [Settings and backups UI](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/SettingsPage.tsx): `src/components/SettingsPage.tsx`

### Anime features

- [Season schedule](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/ScheduleGrid.tsx): `src/components/ScheduleGrid.tsx`
- [Watchlist](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/WatchlistPage.tsx): `src/components/WatchlistPage.tsx`
- [Season explore](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/DiscoverPage.tsx): `src/components/DiscoverPage.tsx`
- [H explore and favorites](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/HDiscoverPage.tsx): `src/components/HDiscoverPage.tsx`
- [Collections](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/CollectionPage.tsx): `src/components/CollectionPage.tsx`
- [Show details](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/AnimeDetailPage.tsx): `src/components/AnimeDetailPage.tsx`
- [Global search](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/GlobalSearch.tsx): `src/components/GlobalSearch.tsx`
- [AniList client](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/lib/anilist.ts): `src/lib/anilist.ts`
- [Streaming links](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/lib/streamLinks.ts): `src/lib/streamLinks.ts`

### App server

- [HTTP API routes](https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/app.ts): `server/app.ts`
- [Local server entry](https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/index.ts): `server/index.ts`
- [Cloudflare Worker](https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/worker.ts): `server/worker.ts`

### Persistence and backups

- [Client list storage](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/lib/storage.ts): `src/lib/storage.ts`
- [Database operations](https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/db.ts): `server/db.ts`
- [SQLite adapter](https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/sqlite.ts): `server/sqlite.ts`
- [D1 adapter](https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/d1.ts): `server/d1.ts`
- [SQL backup and restore](https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/backup.ts): `server/backup.ts`

### Accounts and email

- [Sign-in gate](https://github.com/delmoonkarn/del-anime-tracker/blob/main/src/components/AuthGate.tsx): `src/components/AuthGate.tsx`
- [Account authentication](https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/auth.ts): `server/auth.ts`
- [Backup email](https://github.com/delmoonkarn/del-anime-tracker/blob/main/server/email.ts): `server/email.ts`

### Other components

- **Tracker user**
- **AniList**
- **Local SQLite database**
- **Cloudflare D1**
- **Resend email service**

## Connections

- Tracker user → Client bootstrap: uses
- Client bootstrap → Sign-in gate: mounts (evidence: `src/main.tsx`)
- Sign-in gate → App orchestration: renders (evidence: `src/components/AuthGate.tsx`)
- App orchestration → Page routing: parses routes (evidence: `src/App.tsx`)
- App orchestration → Season schedule: renders (evidence: `src/App.tsx`)
- App orchestration → Watchlist: renders (evidence: `src/App.tsx`)
- App orchestration → Season explore: routes to (evidence: `src/App.tsx`)
- App orchestration → H explore and favorites: routes to (evidence: `src/App.tsx`)
- App orchestration → Collections: routes to (evidence: `src/App.tsx`)
- App orchestration → Show details: renders (evidence: `src/App.tsx`)
- App orchestration → Settings and backups UI: renders (evidence: `src/App.tsx`)
- App orchestration → Global search: renders (evidence: `src/App.tsx`)
- Season explore → AniList client: fetches catalog (evidence: `src/components/DiscoverPage.tsx`)
- Global search → AniList client: searches (evidence: `src/components/GlobalSearch.tsx`)
- Show details → AniList client: fetches details (evidence: `src/components/AnimeDetailPage.tsx`)
- AniList client → AniList: queries (evidence: `src/lib/anilist.ts`)
- App orchestration → Client list storage: saves lists (evidence: `src/App.tsx`)
- Season schedule → Tracker user: updates progress
- Watchlist → Tracker user: updates progress
- Show details → Streaming links: resolves watch links (evidence: `src/components/AnimeDetailPage.tsx`)
- Season explore → Streaming links: filters services (evidence: `src/components/DiscoverPage.tsx`)
- App orchestration → HTTP API routes: requests storage API
- Settings and backups UI → HTTP API routes: requests backup API
- Local server entry → HTTP API routes: serves routes (evidence: `server/index.ts`)
- Local server entry → SQLite adapter: configures (evidence: `server/index.ts`)
- Cloudflare Worker → HTTP API routes: serves routes (evidence: `server/worker.ts`)
- Cloudflare Worker → D1 adapter: configures (evidence: `server/worker.ts`)
- HTTP API routes → Database operations: reads and writes (evidence: `server/app.ts`)
- HTTP API routes → SQL backup and restore: builds backups (evidence: `server/app.ts`)
- HTTP API routes → Account authentication: authenticates (evidence: `server/app.ts`)
- Account authentication → Backup email: sends reset mail (evidence: `server/auth.ts`)
- SQL backup and restore → Backup email: sends scheduled backups (evidence: `server/backup.ts`)
- Backup email → Resend email service: sends mail
- SQLite adapter → Local SQLite database: stores data
- D1 adapter → Cloudflare D1: stores data
- Client list storage → HTTP API routes: writes API data (evidence: `src/lib/storage.ts`)
