docs: describe the core/pages architecture in both READMEs

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
BlackAngelTVandCodebuff committed 2026-09-13 11:45:55 +02:00
1 parent 897c174925
commit 5720c398ef
2 files changed
+94 -8

No files matched your search

+46 -4
View File
@@ -14,26 +14,68 @@ Package manager for **Arch Linux** based on **pacman**, with a Qt6 graphical int
## Architecture
The code is split in two layers, and the split is structural: **every rule lives
in `AppCore`**, every screen lives in `pages/` — the Qt window (`MainWindow`) is
only the frame around them.
- `include/app-core.h` + `src/app-core.cpp` — **the logic**: providers (pacman,
Flatpak, AUR…), worker threads, history, plugin registry, privileged commands
(`sudo`), pacman's database lock, self-update. No widget at all: the layer
depends on Qt Core only and runs headless (`build/app-core-test` does not even
link QtWidgets).
- `include/main-window.h` + `src/main-window.cpp` — **the frame**: sidebar,
header, status bar, menus, tray, dialogs (sudo password, pacman lock, export)
and the stack holding the screens. No business rule.
- `pages/` — **the screens, one file per screen**: `dashboard-page`,
`browse-page` (search / installed / updates), `cleanup-page`,
`history-page`, `logs-page`, `plugins-page`. `page.h` holds the shared
contract (`navTitle()`, `refresh()`, asking the frame for an operation) and
`ui-kit.*` the shared widgets (tables, cards, badges). Reworking a UI means
editing its file under `pages/`; adding a screen means one `Page` subclass
plus a sidebar entry — nothing else.
The conversation always goes the same way: the view calls a core method
(`install()`, `loadUpdates()`, `cleanCaches()`…), which answers "started", "I
need the sudo password" or "pacman's database is locked"; the view then asks the
user for whatever is missing and replays the request. Results come back as
signals (`listFinished`, `actionProgress`, `actionFinished`, `statusMessage`…).
Every operation that spawns a process is asynchronous.
```
package-manager/
├── CMakeLists.txt # Build root
├── include/
│ ├── app-core.h # LOGIC: everything the app does (no widget)
│ ├── workers.h # Shared threads (search / listings / actions)
│ ├── package-manager.h # Package manager interface (IPackageManager)
│ ├── plugin.h # Generic plugin contract (PluginInfo, IPlugin)
│ ├── provider-plugin.h # C ABI contract for plugins (providers + addons)
│ ├── pacman-manager.h # pacman manager (Arch Linux, built-in)
│ ├── plugin-manager.h # Plugin registry + shared-library loading
│ ├── main-window.h # Main GUI
│ ├── main-window.h # INTERFACE: the window frame
│ ├── history-manager.h # Action history
│ └── package-model.h # Qt model for the list
│ ├── package-model.h # Qt model for the list
│ └── update-manager.h # Self-update (releases)
├── src/
│ ├── main.cpp
│ ├── app-core.cpp
│ ├── workers.cpp
│ ├── main-window.cpp
│ ├── pacman-manager.cpp
│ ├── flatpak-manager.cpp
│ ├── plugin-manager.cpp
│ ├── history-manager.cpp
│ └── package-model.cpp
│ ├── package-model.cpp
│ ├── update-manager.cpp
│ └── app-logging.cpp
├── pages/ # INTERFACE: one file per screen
│ ├── page.h/.cpp # Screen contract (Page) + helpers
│ ├── ui-kit.h/.cpp # Shared widgets (tables, cards, badges)
│ ├── dashboard-page.h/.cpp # Dashboard
│ ├── browse-page.h/.cpp # Search / installed / updates
│ ├── cleanup-page.h/.cpp # Cleanup
│ ├── history-page.h/.cpp # History
│ ├── logs-page.h/.cpp # pacman logs
│ └── plugins-page.h/.cpp # Plugins
├── plugins/
│ ├── example-provider/ # Example external provider plugin (template)
│ ├── example-addon/ # Example external addon plugin (extension, template)