Description
Restructure the project into a monorepo layout to support separate desktop and mobile frontends while sharing types, stores, API wrappers, utilities, and i18n.
This must happen before any mobile frontend code is written.
Scope:
- Move
src/ to apps/desktop/src/
- Extract shared code to
shared/:
types/ β all TypeScript type definitions
api/ β all Tauri IPC wrappers (same invoke() calls used by both platforms)
stores/ β shared stores: discovery, discoveryPlaylist, expandedReleases, player, tags, playlists, settings, toast
utils/ β format, sorting, selection, storage, artwork utilities
i18n/ β all locale files and i18n setup
services/previewPlayer.ts β HTML5 Audio singleton
- Desktop-only stores stay in
apps/desktop/src/lib/stores/: devices, export, sync (USB), analysis, drag, app, crash, diagnostics, missingTracks, updater, splash, backup, pageActions
- Desktop-only components, controllers, and hooks stay in
apps/desktop/
- Update Tauri configs (
tauri.conf.json, tauri.dev.conf.json, etc.) to point to apps/desktop/
- Add
$shared path alias in both svelte.config.js and vite.config.ts pointing to ../../shared/
- Scaffold
apps/mobile/ with SvelteKit, own svelte.config.js, vite.config.ts, same $shared alias
- Update all import paths throughout the desktop frontend
- Verify desktop build works identically after restructuring
Key files:
src/ β apps/desktop/src/
shared/ β new directory
apps/mobile/ β new scaffolded directory
svelte.config.js, vite.config.ts β both apps
src-tauri/tauri.conf.json and environment-specific configs
Open questions
- Should the root
package.json use Yarn workspaces, or keep a single package.json with path aliases only?
- Should
svelte.config.js and vite.config.ts live in apps/desktop/ or remain at root with the mobile equivalents added alongside?
- Should the
ui store be split (shared core state vs. desktop-specific layout state) or kept entirely in desktop?
Acceptance criteria
- Desktop application builds and runs identically after restructuring (no functional changes)
apps/desktop/src/ contains only desktop-specific code (components, controllers, hooks, desktop-only stores)
shared/ contains types, API wrappers, shared stores, utils, i18n, and previewPlayer service
apps/mobile/ is scaffolded with SvelteKit and can import from $shared
- All import paths are updated and resolve correctly
src-tauri/ is unchanged in location and continues to serve both platforms
- Tauri configs correctly reference
apps/desktop/ for frontend
Tasks
TBD
Description
Restructure the project into a monorepo layout to support separate desktop and mobile frontends while sharing types, stores, API wrappers, utilities, and i18n.
This must happen before any mobile frontend code is written.
Scope:
src/toapps/desktop/src/shared/:types/β all TypeScript type definitionsapi/β all Tauri IPC wrappers (sameinvoke()calls used by both platforms)stores/β shared stores: discovery, discoveryPlaylist, expandedReleases, player, tags, playlists, settings, toastutils/β format, sorting, selection, storage, artwork utilitiesi18n/β all locale files and i18n setupservices/previewPlayer.tsβ HTML5 Audio singletonapps/desktop/src/lib/stores/: devices, export, sync (USB), analysis, drag, app, crash, diagnostics, missingTracks, updater, splash, backup, pageActionsapps/desktop/tauri.conf.json,tauri.dev.conf.json, etc.) to point toapps/desktop/$sharedpath alias in bothsvelte.config.jsandvite.config.tspointing to../../shared/apps/mobile/with SvelteKit, ownsvelte.config.js,vite.config.ts, same$sharedaliasKey files:
src/βapps/desktop/src/shared/β new directoryapps/mobile/β new scaffolded directorysvelte.config.js,vite.config.tsβ both appssrc-tauri/tauri.conf.jsonand environment-specific configsOpen questions
package.jsonuse Yarn workspaces, or keep a singlepackage.jsonwith path aliases only?svelte.config.jsandvite.config.tslive inapps/desktop/or remain at root with the mobile equivalents added alongside?uistore be split (shared core state vs. desktop-specific layout state) or kept entirely in desktop?Acceptance criteria
apps/desktop/src/contains only desktop-specific code (components, controllers, hooks, desktop-only stores)shared/contains types, API wrappers, shared stores, utils, i18n, and previewPlayer serviceapps/mobile/is scaffolded with SvelteKit and can import from$sharedsrc-tauri/is unchanged in location and continues to serve both platformsapps/desktop/for frontendTasks
TBD