UnityScraper is moving toward a modular monolith: one local desktop-first application, with feature domains that own their models, services, schema, commands, tests, and UI adapters.
The current top-level modules remain supported while code moves into the
unityscraper package incrementally.
unityscraper/
app/
desktop/
cli/
api/
core/
db/
jobs.py
paths.py
domains/
library/
knowledge/
backups/
profiles/
packages/
collections/
console_sync/
tools/
plugins/
unityscraper.appadapts desktop, CLI, and REST entry points.unityscraper.coreholds shared infrastructure that has no Xbox-specific product behavior.unityscraper.domainsholds feature behavior and should avoid importing UI modules.- Top-level modules are compatibility shims or legacy implementations until their behavior is moved behind domain packages.
Each domain should grow toward this internal layout:
domain/
models.py
service.py
repository.py
commands.py
api.py
migrations.py
ui.py
models.pycontains dataclasses, enums, and validation types.service.pyowns business workflows.repository.pyowns SQLite access for that domain.commands.pyexposes UI-neutral use cases for CLI, REST, and desktop jobs.api.pyadapts use cases to HTTP only.ui.pyadapts use cases to Tk only.migrations.pyregisters additive schema changes throughunityscraper.core.db.MigrationRegistry.
- Keep existing entry points working.
- Add package-facing adapters for existing services.
- Move pure models and parsing helpers first.
- Move repositories and schema ownership next.
- Move command handlers after services are UI-neutral.
- Split large UI pages only after their services are stable.
unityscraper.core.pathsowns application storage and resource resolution;app_paths.pyis a compatibility wrapper.unityscraper.core.versionowns version constants;app_version.pyis a compatibility wrapper.unityscraper.core.metadataexposes app name, slug, and version metadata for UI, CLI, API, diagnostics, and packaging.unityscraper.core.jobsexposes shared job results, progress events, cancellation tokens, contexts, and a synchronous runner for future desktop, CLI, and API workflow reuse.unityscraper.app.clihas a command registry and lazy legacy CLI adapter so package command discovery does not import the full scraper runtime.unityscraper.app.apiandunityscraper.app.desktopkeep package imports light by importing their legacy runtime only when their surface starts.unityscraper.domains.packagesexposes read-only package models and inspectors.unityscraper.domains.packages.commandsexposes the first UI-neutral package use cases for STFS inspection and file-table inventory.unityscraper.domains.backupsexposes backup models and operations.unityscraper.domains.backups.migrationsowns the backup schema function;backup_service.ensure_backup_schemaremains import-compatible.unityscraper.domains.profilesexposes profile/save models and helpers.unityscraper.domains.knowledgeexposes first-class model and repository adapters around its existing implementations.unityscraper.domains.libraryowns the read-only library model and query service. Its XboxUnity title catalog remains behind a package adapter until the catalog migration and knowledge dependencies move into package modules.unityscraper.domains.toolsowns its data models, catalog, executable discovery, command construction, and process runner.tool_catalog.pyandexternal_tools.pyremain compatibility wrappers.
| Domain | Owns |
|---|---|
library |
XboxUnity titles, covers, title updates, local library search |
knowledge |
source-attributed facts, citations, conflicts, offline archive |
backups |
owned-content inventory, import, export, verification, FTP-safe flows |
profiles |
profile/save discovery, snapshots, restore, achievement inspection |
packages |
STFS, XEX, XBE inspection and read-only extraction |
collections |
preservation matching, DAT checks, health reports, repair previews |
console_sync |
console inventories, durable transfer plans, dashboard capabilities |
tools |
external executable catalog, argument templates, captured execution |
plugins |
opt-in collectors, trust state, isolated plugin runs |
New Xbox 360 capabilities should enter as domain use cases first. Desktop buttons, REST routes, and CLI flags should call those use cases rather than owning file, database, FTP, or package logic themselves.