How xmatsuda2053/toybox works
1. This repository is a small suite of standalone, browser-based applications built from one shared codebase. The top-level HTML entry points are separate artifacts for each app: hubaddress.html, stepnote.html, and toybox.html, with built outputs in dist/ and source-compatible copies in root/.
2. The technical stack is TypeScript with Lit-style component architecture and colocated SCSS styling. Most UI elements are split into small custom components, with matching .lit.scss files for scoped presentation. A Vite-based build pipeline is implied by vite.config.ts, with build.js likely orchestrating packaging.
3. The shared foundation lives under src/common and src/utils. common contains reusable UI primitives such as file upload, search input, copy button, date picker, markdown editor, help viewer, and data exporter. utils contains cross-cutting logic for dates, config, scheduling, events, and general helpers.
4. src/assets is the shared asset layer. It centralizes icons and related asset generation, so app features can reference a common visual vocabulary rather than duplicating image/icon handling.
5. The StepNote app is the largest subsystem. Its root bootstrap is src/apps/stepnote/step-note-app.ts, and it is organized around task tracking, journaling, configuration, navigation, and dashboard views. The feature set is split into components/{config,dashboard,journal,list,menu,nav,tab,task}.
6. StepNote has a clear data layer boundary under src/apps/stepnote/database. The repositories folder maps to persisted domain entities such as tasks, labels, notes, logs, quick access items, dashboards, and config. services and calculators add derived queries and metrics, especially for dashboard data and task statistics.
7. StepNote’s main data flow is: user actions in Lit components update repositories, repositories read/write the local app database, and query services derive aggregate views for dashboards and summaries. The models in src/apps/stepnote/models define the domain objects that move across this boundary, including tasks, labels, notes, logs, contacts, configs, and KPI values.
8. The StepNote UI is organized as a shell with navigation/menu on one side and task/journal/dashboard content in the main area. The menu subsystem includes embedded help pages in Markdown, which are rendered through shared help/markdown tooling. This app is designed around dense in-app workflows rather than broad page navigation.
9. The HubAddress app is a separate bounded subsystem with its own bootstrap in src/apps/hub-address.ts and implementation root in src/apps/hubaddress/hub-address-app.ts. Its main features are a menu, uploader, and viewer, indicating a workflow centered on ingesting address data and browsing it by division or staff.
10. HubAddress also uses a local database abstraction, src/apps/hubaddress/database/HaDB.ts, and domain models for Division, Staff, FileData, and SearchKeyword. The architecture suggests a pipeline of uploaded file data being parsed/stored locally, then searched and rendered in the viewer components.
11. The HubAddress viewer is split by entity type: one component for divisions and one for staff. That separation is important for the diagram because it means the presentation layer is not generic; it reflects the underlying domain model and likely switches views based on search or selection context.
12. The AppContainer/toybox area under src/apps/appcontainer appears to be a launcher or catalog app for tools, files, and storage-related entries. Its component grouping (app, file, storage, tool) and AppItem model indicate an index/navigation role rather than a single business workflow.
13. The repo’s architecture is therefore “multi-app, shared component library, local data-first.” There is no visible server-side application layer in this tree; the major boundary is between UI/component logic and browser-side persistence/query layers.
14. For an architecture diagram, the cleanest top-level boxes are: shared UI/utilities, StepNote, HubAddress, and AppContainer/Toybox, with each app pointing to its own database/models and also consuming shared widgets from src/common. The build output layer (dist/) sits below all of them as the packaged static delivery artifact.
Main entry points: step-note-app.ts StepNote app · hub-address-app.ts HubAddress app · build.js build.js · library.ts Library
Components 28
Shared
Cross-app UI primitives, assets, and utilities
- Markdown editor · Reusable markdown editing component
src/common/thin-markdown-editor/thin-markdown-editor.ts - Help viewer · Reusable help/content rendering component
src/common/help-viewer/help-viewer.ts - File uploader · Reusable file upload component
src/common/file-uploader/file-uploader.ts - Icons · Shared icon definitions and generation output
src/assets/icons.ts - Utils · Cross-cutting helpers for app code
src/utils/CommonUtils.ts - Library · Shared library entry surface
src/library.ts
StepNote
Task, journal, and dashboard application
- StepNote boot · StepNote application entry module
src/apps/step-note.ts - StepNote app · Main shell for navigation, task, journal, and dashboard views
src/apps/stepnote/step-note-app.ts - Menu · In-app menu and help entry points
src/apps/stepnote/components/menu/sn-menu.ts - Task view · Task-focused presentation and actions
src/apps/stepnote/components/task/sn-task-summary.ts - Dashboard · Dashboard container and KPI/chart views
src/apps/stepnote/components/dashboard/sn-dashboard-container.ts - SnDB · StepNote browser-side database boundary
src/apps/stepnote/database/SnDB.ts - Dashboard queries · Derived dashboard data and summaries
src/apps/stepnote/database/services/DashboardQueryService.ts - Task repo · Persistent task access and updates
src/apps/stepnote/database/repositories/TaskRepository.ts - Task model · Task and related workflow entities
src/apps/stepnote/models/Task.ts
HubAddress
Upload, store, and browse address data
- HubAddress boot · HubAddress application entry module
src/apps/hub-address.ts - HubAddress app · Main shell for uploader and viewer workflow
src/apps/hubaddress/hub-address-app.ts - Uploader · File upload and import entry point
src/apps/hubaddress/components/uploader/wa-uploader.ts - Div viewer · Division-oriented address browser
src/apps/hubaddress/components/viewer/ha-viewer-div.ts - Staff viewer · Staff-oriented address browser
src/apps/hubaddress/components/viewer/ha-viewer-staff.ts - HaDB · HubAddress browser-side database boundary
src/apps/hubaddress/database/HaDB.ts
Toybox
App container and launcher area
- App selector · App catalog and selection component
src/apps/appcontainer/components/app/ap-selector.ts - AppItem · Launcher item metadata for tools and files
src/apps/appcontainer/models/AppItem.ts
Build
Static entry points and packaging pipeline
- stepnote.html · Packaged browser entry for StepNote
dist/stepnote.html - hubaddress.html · Packaged browser entry for HubAddress
dist/hubaddress.html - toybox.html · Packaged browser entry for Toybox
dist/toybox.html - Vite config · Vite build configuration
vite.config.ts - build.js · Build orchestration and packaging script
build.js
Connections 31
- Vite config → build.js: configures · Build pipeline setup
- build.js → stepnote.html: emits · Produces packaged StepNote artifact
- build.js → hubaddress.html: emits · Produces packaged HubAddress artifact
- build.js → toybox.html: emits · Produces packaged Toybox artifact
- StepNote boot → StepNote app: boots · Initializes the StepNote shell
- StepNote app → Menu: uses · Shell composes the menu
- StepNote app → Task view: uses · Shell composes task workflow UI
- StepNote app → Dashboard: uses · Shell composes dashboard views
- StepNote app → SnDB: reads/writes · Shell coordinates the local database
- Task view → Task repo: updates · Task UI persists via repository boundary
- Task repo → SnDB: persists · Repository uses the local database
- Dashboard queries → SnDB: queries · Dashboard data is derived from local storage
- Dashboard → Dashboard queries: renders · Dashboard consumes derived summaries
- Menu → Help viewer: renders · Help pages use shared viewer tooling
- Task view → Markdown editor: uses · Task workflow includes markdown editing
- StepNote app → File uploader: uses · App shell can ingest files through shared uploader
- StepNote app → Icons: uses · Shared icon vocabulary
- StepNote app → Utils: uses · Shared utility functions
- HubAddress boot → HubAddress app: boots · Initializes the HubAddress shell
- HubAddress app → Uploader: uses · Shell composes uploader workflow
- HubAddress app → Div viewer: uses · Shell composes division viewer
- HubAddress app → Staff viewer: uses · Shell composes staff viewer
- HubAddress app → HaDB: reads/writes · Shell coordinates local storage
- Uploader → File uploader: uses · Upload flow reuses shared file input
- Div viewer → HaDB: queries · Division viewer reads persisted data
- Staff viewer → HaDB: queries · Staff viewer reads persisted data
- HubAddress app → Help viewer: uses · App menu/help references shared viewer tooling
- App selector → AppItem: lists · Launcher UI is driven by catalog items
- App selector → Library: uses · App container builds on the shared library surface
- Library → Icons: exports · Shared package exposes icon resources
- Library → Utils: exports · Shared package exposes utility helpers