Skip to content

Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.

docs: update module maps with models and service layers

Samir Hossains641d1722b3e1
diff --git a/docs/architecture.md b/docs/architecture.md
index bc11bc7..8b57100 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -12,9 +12,12 @@ src/
alternate screen, App::new + App::run
lib.rs crate root, module declarations
cache.rs disk cache: provider-namespaced, TTL'd, atomic writes
+ config.rs Config load/save (config.json)
download.rs download engine (resume, ranges, segments, retry)
history.rs watch history persistence
logging.rs file logging (rotation, sanitization)
+ models.rs shared domain models (SearchResult, BrowseMetrics, StreamPool, Notification)
+ player.rs player detection (OnceLock) and command construction (mpv/VLC/IINA/Android)
providers/
mod.rs provider module tree
models.rs shared typed models (ProviderKind, CatalogItem,
@@ -24,6 +27,8 @@ src/
bdix/circleftp/ BDIX CircleFTP provider
bdix/dhakaflix/ BDIX DhakaFlix provider
m3u.rs M3U playlist parser (URL and local file)
+ service.rs MovieBoxService headless engine (search, details, streams, captions)
+ updater.rs GitHub release update check
tui/
app/ the application object and all behavior
mod.rs App struct, App::new, helpers
@@ -43,15 +48,12 @@ src/
system.rs help, refresh, cache, theme, updates, focus, resize
state.rs AppState: all UI state + in-memory LRU caches
action.rs the Action enum (event/message model)
- config.rs Config load/save (config.json)
event.rs EventHandler: input events + tick → Action channel
- player.rs player detection and command construction
overlay.rs popups, pickers, notifications
screens/ render-only modules (home, details, help)
terminal.rs terminal capability probes
theme.rs color themes
text.rs grapheme-safe text helpers
- updater.rs GitHub release update check
```
## The event loop
diff --git a/docs/modules.md b/docs/modules.md
index 7f8e04b..fd8a6f3 100644
--- a/docs/modules.md
+++ b/docs/modules.md
@@ -8,12 +8,15 @@ responsibility.
src/
main.rs Entry point. Logging init, panic hook, raw mode, alternate
screen, TerminalGuard, App::new + App::run.
- lib.rs Crate root: declares pub mod cache/download/history/logging/
- providers/tui.
+ lib.rs Crate root: declares pub mod cache/config/download/history/
+ logging/models/player/providers/service/tui/updater.
cache.rs Disk cache: provider-namespaced directories, TTL expiry,
atomic temp-file writes, payload validation, background purge.
+ config.rs Config struct: load/save config.json (provider, theme,
+ auto-update, default player, bdix flag).
+
download.rs Download engine (pure, async): resume via .part files,
HTTP ranges, optional multi-segment download, retries, cancel
via an AtomicBool, Windows-safe file stems.
@@ -24,6 +27,13 @@ src/
logging.rs File logging: flexi_logger, rotation (5MB, keep 3),
MOVIEBOX_LOG level, URL/path sanitization for sharing.
+ models.rs Pure domain data models: SearchResult, BrowseMetric,
+ BrowsePreset, BrowseMetrics, SubjectStreamPool, Notification.
+
+ player.rs Player detection (OnceLock) and command construction for
+ mpv / VLC / IINA / Android intent, subtitle args, headers,
+ terminal-sized window.
+
providers/
mod.rs Module declarations.
models.rs Shared types: ProviderKind, CatalogItem, MediaDetails,
@@ -43,18 +53,19 @@ src/
dhakaflix/ BDIX DhakaFlix provider (client + parser).
m3u.rs M3U playlist parser (http(s) URL or local file).
+ service.rs MovieBoxService: unified multi-provider headless client &
+ engine (suggest, search, details, homepage, resolutions,
+ captions, subtitle download, path resolution).
+
+ updater.rs GitHub release update check.
+
tui/
action.rs The Action enum: every UI event/message (input, network
results, downloads, playback, tv, system).
- config.rs Config struct: load/save config.json (provider, theme,
- auto-update, default player, bdix flag).
state.rs AppState: all UI state, LRU image/preview caches, and the
PlayerKind enum + label()/parse(), tv manager row model.
event.rs EventHandler: crossterm event stream + tick interval,
forwards to the action channel.
- player.rs Player detection (OnceLock) and command construction for
- mpv / VLC / IINA / Android intent, subtitle args, headers,
- terminal-sized window.
overlay.rs Popups: notifications, pickers, confirmation, modal centering.
screens/
home.rs Home/startup + search list rendering (streaming and TV).
@@ -63,7 +74,6 @@ src/
terminal.rs Terminal capability probes (basic UI, image querying).
theme.rs Color themes + terminal color detection.
text.rs Grapheme-safe width/truncation helpers.
- updater.rs GitHub release update check.
tui/app/ The application object (App) and all behavior.
mod.rs App struct, App::new, and small helpers.