# roshancodespace/shonenx architecture

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

- Interactive diagram: https://gitdiagram.com/roshancodespace/shonenx
- Repository: https://github.com/roshancodespace/shonenx

## Overview

ShonenX is a cross-platform anime and manga client: users discover titles, select user-managed sources, then watch episodes or read chapters, with progress sync and optional offline downloads. The feature tree separates discovery, source resolution, playback/reading, tracking, and downloads; the README explicitly documents tracker sync and extension support. Native runner excerpts show Flutter host startup only, not Dart feature wiring, so the graph omits uncertain call-level links. Major feature paths are supported by the tree; some behavior is included from the README rather than sampled implementation.

Main entry points: [`lib/features/discovery/presentation/details_screen.dart`](https://github.com/roshancodespace/shonenx/blob/main/lib/features/discovery/presentation/details_screen.dart) (Title Details), [`lib/main.dart`](https://github.com/roshancodespace/shonenx/blob/main/lib/main.dart) (Flutter App), [`lib/features/player/presentation/player_screen.dart`](https://github.com/roshancodespace/shonenx/blob/main/lib/features/player/presentation/player_screen.dart) (Video Player), [`lib/features/reader/presentation/reader_screen.dart`](https://github.com/roshancodespace/shonenx/blob/main/lib/features/reader/presentation/reader_screen.dart) (Manga Reader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and Discovery"]
  node_app["Flutter App<br/>[main.dart]"]
  node_discovery["Browse and Search"]
  node_details["Title Details"]
end

subgraph group_sources["Sources and Metadata"]
  node_extensions["Extension Manager"]
  node_source_engine["Source Engine"]
  node_metadata["Episode Metadata"]
end

subgraph group_consume["Watch and Read"]
  node_player["Video Player<br/>[player_screen.dart]"]
  node_reader["Manga Reader<br/>[reader_screen.dart]"]
end

subgraph group_progress["Progress and Organization"]
  node_tracking["Progress Tracking"]
  node_history[("Watch and Read History")]
  node_library[("Personal Library")]
  node_calendar["Airing Calendar"]
  node_notifications["Airing Notifications"]
  node_comments["Comments"]
end

subgraph group_platform["Offline and Services"]
  node_downloads["Offline Downloads"]
  node_download_store[("Download Repository")]
  node_discord["Discord Integration"]
  node_remote_config["Remote Configuration"]
end

node_user(("Viewer"))
node_external_sources{{"Third-party Sources"}}
node_tracker_services{{"Tracker APIs"}}

node_user -->|"opens"| node_app
node_app -->|"shows"| node_discovery
node_discovery -->|"selects title"| node_details
node_details -->|"resolves media"| node_source_engine
node_extensions -->|"registers sources"| node_source_engine
node_source_engine -.->|"requests streams"| node_external_sources
node_details -->|"loads episode info"| node_metadata
node_details -->|"starts watching"| node_player
node_details -->|"starts reading"| node_reader
node_player -->|"records watch progress"| node_history
node_reader -->|"records read progress"| node_history
node_player -->|"updates watch progress"| node_tracking
node_reader -->|"updates read progress"| node_tracking
node_tracking -.->|"syncs progress"| node_tracker_services
node_user -->|"requests offline copy"| node_downloads
node_downloads -->|"saves tasks"| node_download_store
node_user -->|"manages titles"| node_library
node_user -->|"views schedule"| node_calendar
node_user -->|"sets reminders"| node_notifications
node_user -->|"joins discussion"| node_comments
node_user -->|"links account"| node_discord
node_app -->|"loads configuration"| node_remote_config

click node_app "https://github.com/roshancodespace/shonenx/blob/main/lib/main.dart"
click node_discovery "https://github.com/roshancodespace/shonenx/tree/main/lib/features/discovery/presentation"
click node_details "https://github.com/roshancodespace/shonenx/blob/main/lib/features/discovery/presentation/details_screen.dart"
click node_extensions "https://github.com/roshancodespace/shonenx/tree/main/lib/features/extensions"
click node_source_engine "https://github.com/roshancodespace/shonenx/tree/main/lib/source_engine"
click node_metadata "https://github.com/roshancodespace/shonenx/tree/main/lib/features/episode_metadata"
click node_player "https://github.com/roshancodespace/shonenx/blob/main/lib/features/player/presentation/player_screen.dart"
click node_reader "https://github.com/roshancodespace/shonenx/blob/main/lib/features/reader/presentation/reader_screen.dart"
click node_downloads "https://github.com/roshancodespace/shonenx/tree/main/lib/features/downloads"
click node_download_store "https://github.com/roshancodespace/shonenx/blob/main/lib/features/downloads/domain/download_repository.dart"
click node_tracking "https://github.com/roshancodespace/shonenx/tree/main/lib/features/tracking"
click node_history "https://github.com/roshancodespace/shonenx/tree/main/lib/features/history"
click node_library "https://github.com/roshancodespace/shonenx/tree/main/lib/features/library"
click node_calendar "https://github.com/roshancodespace/shonenx/tree/main/lib/features/calendar"
click node_notifications "https://github.com/roshancodespace/shonenx/tree/main/lib/features/notifications"
click node_comments "https://github.com/roshancodespace/shonenx/tree/main/lib/features/comments"
click node_discord "https://github.com/roshancodespace/shonenx/tree/main/lib/features/discord"
click node_remote_config "https://github.com/roshancodespace/shonenx/tree/main/lib/core/remote_config"

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_discovery,node_details,node_user toneBlue
class node_extensions,node_source_engine,node_metadata toneAmber
class node_player,node_reader,node_tracker_services toneMint
class node_tracking,node_history,node_library,node_calendar,node_notifications,node_comments toneRose
class node_downloads,node_download_store,node_discord,node_remote_config,node_external_sources toneIndigo
```

## Components

### App and Discovery

- [Flutter App](https://github.com/roshancodespace/shonenx/blob/main/lib/main.dart): `lib/main.dart`
- [Browse and Search](https://github.com/roshancodespace/shonenx/tree/main/lib/features/discovery/presentation): `lib/features/discovery/presentation`
- [Title Details](https://github.com/roshancodespace/shonenx/blob/main/lib/features/discovery/presentation/details_screen.dart): `lib/features/discovery/presentation/details_screen.dart`

### Sources and Metadata

- [Extension Manager](https://github.com/roshancodespace/shonenx/tree/main/lib/features/extensions): `lib/features/extensions`
- [Source Engine](https://github.com/roshancodespace/shonenx/tree/main/lib/source_engine): `lib/source_engine`
- [Episode Metadata](https://github.com/roshancodespace/shonenx/tree/main/lib/features/episode_metadata): `lib/features/episode_metadata`

### Watch and Read

- [Video Player](https://github.com/roshancodespace/shonenx/blob/main/lib/features/player/presentation/player_screen.dart): `lib/features/player/presentation/player_screen.dart`
- [Manga Reader](https://github.com/roshancodespace/shonenx/blob/main/lib/features/reader/presentation/reader_screen.dart): `lib/features/reader/presentation/reader_screen.dart`

### Progress and Organization

- [Progress Tracking](https://github.com/roshancodespace/shonenx/tree/main/lib/features/tracking): `lib/features/tracking`
- [Watch and Read History](https://github.com/roshancodespace/shonenx/tree/main/lib/features/history): `lib/features/history`
- [Personal Library](https://github.com/roshancodespace/shonenx/tree/main/lib/features/library): `lib/features/library`
- [Airing Calendar](https://github.com/roshancodespace/shonenx/tree/main/lib/features/calendar): `lib/features/calendar`
- [Airing Notifications](https://github.com/roshancodespace/shonenx/tree/main/lib/features/notifications): `lib/features/notifications`
- [Comments](https://github.com/roshancodespace/shonenx/tree/main/lib/features/comments): `lib/features/comments`

### Offline and Services

- [Offline Downloads](https://github.com/roshancodespace/shonenx/tree/main/lib/features/downloads): `lib/features/downloads`
- [Download Repository](https://github.com/roshancodespace/shonenx/blob/main/lib/features/downloads/domain/download_repository.dart): `lib/features/downloads/domain/download_repository.dart`
- [Discord Integration](https://github.com/roshancodespace/shonenx/tree/main/lib/features/discord): `lib/features/discord`
- [Remote Configuration](https://github.com/roshancodespace/shonenx/tree/main/lib/core/remote_config): `lib/core/remote_config`

### Other components

- **Viewer**
- **Third-party Sources**
- **Tracker APIs**

## Connections

- Viewer → Flutter App: opens
- Flutter App → Browse and Search: shows
- Browse and Search → Title Details: selects title
- Title Details → Source Engine: resolves media
- Extension Manager → Source Engine: registers sources
- Source Engine → Third-party Sources: requests streams
- Title Details → Episode Metadata: loads episode info
- Title Details → Video Player: starts watching
- Title Details → Manga Reader: starts reading
- Video Player → Watch and Read History: records watch progress
- Manga Reader → Watch and Read History: records read progress
- Video Player → Progress Tracking: updates watch progress
- Manga Reader → Progress Tracking: updates read progress
- Progress Tracking → Tracker APIs: syncs progress
- Viewer → Offline Downloads: requests offline copy
- Offline Downloads → Download Repository: saves tasks
- Viewer → Personal Library: manages titles
- Viewer → Airing Calendar: views schedule
- Viewer → Airing Notifications: sets reminders
- Viewer → Comments: joins discussion
- Viewer → Discord Integration: links account
- Flutter App → Remote Configuration: loads configuration
