Skip to content

Architecture

Simdrom edited this page Nov 27, 2026 · 1 revision

Architecture

Four crates

Kuro is a Cargo workspace of four crates. Each depends only on those above it, so the rules can be tested without a network or a window.

Crate Package What it holds
crates/core kuro-core The domain: model, list rules, statistics, calendar and the SQLite store. No network, no interface.
crates/api kuro-api Every remote service behind one Api: AniList, MyAnimeList, music, Google Calendar, GitHub releases, sign-in and Kioku's sources.
crates/app kuro The program: interface (egui), background work and Windows integration.
crates/setup kuro-setup The setup, with the program inside (KURO_PAYLOAD at build time).
flowchart LR
  core[kuro-core] --> api[kuro-api]
  core --> app[kuro]
  api --> app
  core --> setup[kuro-setup]
  api --> setup
Loading

How things move

Things move one way.

flowchart LR
  UI[ui/ draws a frame] -- Act --> Acts[app/acts.rs]
  Acts -- App::save / App::change --> Store[(SQLite store + outbox)]
  Acts -- request --> Backend[backend/ threads]
  Backend -- Event --> Events[app/events.rs]
  Events --> State[App state]
  State --> UI
  Store --> Sync[backend/sync.rs]
  Sync -- retries while offline --> Service[(AniList / MyAnimeList)]
Loading
  1. The interface never changes state while it draws. It asks with an Act, which app/acts.rs applies after the frame.
  2. Network and disk work runs in backend/ and comes back as an Event, handled by app/events.rs.
  3. Every change to the list goes through App::save, or App::change, which also offers to undo it. The store keeps the change with an entry in the outbox, and backend/sync.rs sends it, retrying while offline.

kuro-core

File What it does
model.rs ListEntry, Media, Schedule, custom list names
progress.rs Rules that turn an action into a new entry
list.rs Filtering (status, format, genre, custom list) and sorting; ListOp
stats.rs Counts by status, and insights (scores, genres, years…)
calendar.rs Upcoming episodes, .ics, delays and breaks
friends.rs Friends, titles in common, taste match and picks
notify.rs Which episode notifications are due
reminders.rs Titles left behind and the weekly summary
overview.rs Every title of a franchise, in order
season.rs, links.rs, backup.rs, settings.rs Seasons, kuro:// links, backups, settings
store.rs SQLite: library, outbox, cache, settings, Kioku
kioku/ History items, the matcher and the review

kuro-api

File What it does
lib.rs Api: one facade over every service
anilist.rs, mal.rs Lists, search, details, custom lists and tags
music.rs Openings and endings, and where to play them
google.rs The Google calendar of episodes
updates.rs The latest release on GitHub
oauth.rs, secrets.rs Sign-in, and tokens in the Windows Credential Manager
http.rs, images.rs HTTPS with bounded sizes; images from known hosts
kioku/ Crunchyroll, Netflix and Prime Video histories

kuro (the app)

Folder or file What it does
app/mod.rs App: library, save, undo, links
app/views.rs The state of each screen, Act and Route
app/acts.rs Requests from the interface
app/events.rs Answers from the background, schedule changes
app/timers.rs Notifications, reminders, backups, new versions
app/calendar.rs The .ics file and Google Calendar
app/kioku.rs Applying a Kioku review
app/window.rs Keys, clipboard, settings changes, the window
backend/mod.rs Event, the runtime and the response cache
backend/sync.rs Reading the list and sending changes
backend/files.rs Images, file dialogs, backups
backend/google.rs Google Calendar
backend/history.rs Kioku: reading and matching a history
ui/ One file per screen: mylist, ownlists, detail, browse, calendar, friends, stats, settings, kioku, dialogs (editor, palette, toasts), float (widget)
strings.txt Every text, in 7 languages
i18n.rs, theme.rs, widgets.rs, system.rs, format.rs Translation, themes, shared widgets, Windows integration, formatting

kuro-setup

File What it does
engine.rs Install, update, reinstall, go back, uninstall
ui.rs, text.rs The window and its texts in 7 languages
notes.rs Reads whats-new.txt
win.rs Start menu and desktop shortcuts (COM; the only unsafe code)
build.rs Compresses the program and its licences into the setup

Where data lives

What Where
SQLite store (library, outbox, cache, settings, Kioku) %LOCALAPPDATA%\Kuro, or KURO_PROFILE_DIR
Tokens Windows Credential Manager

The store has a schema version. The setup refuses to install an older Kuro that cannot read a newer schema.

Clone this wiki locally