2.3 KiB
2.3 KiB
Layout And Naming
Canonical Structure
<repo-root>/
web/
run.sh
src/
app.py
<web modules>
requirements.txt
ONBOARDING.md
mac/
src/
<Project>.xcodeproj/
App/
ContentView.swift
<AppMain>.swift
EmbeddedBackend/
WebBackend
Help/
help.html
AppTests/
AppUITests/
scripts/
build_embedded_backend.sh
build_selfcontained_mac_app.sh
create_installer_dmg.sh
build/
dmg/
<AppName>-<timestamp>.dmg
docs/
architecture.md
Naming Rules
- Repo: lowercase hyphenated (
trader-desktop-shell). - macOS target/scheme: PascalCase (
TraderMacor project-defined), but source folders should stay generic (App,AppTests,AppUITests). - Embedded backend binary: stable generic default (
WebBackend) with env override support. - Settings directory: lowercase snake or kebab (
~/.trader_app). - Environment port var: uppercase snake (keep legacy fallbacks during migration).
Script Discovery Rules
- Build scripts should discover the first
*.xcodeprojundermac/srcunlessMAC_PROJECT_PATHis provided. - Build scripts should discover scheme via
xcodebuild -list -jsonunlessMAC_SCHEMEis provided. - Embedded backend target dir should be derived from selected project sources or
EMBEDDED_BACKEND_DIR. - Python tests should run with
PYTHONPATH=web/src. - DMG scripts should write to
build/dmg/and clean temporary staging folders.
Ignore Rules
Add these to root .gitignore:
build/*.dmgrw.*.dmg
Migration Rules For Existing Projects
- Do not rename everything in one commit.
- First, add new folders and compatibility references.
- Move scripts and docs next.
- Move web source only after build scripts are updated.
- Move mac source into
mac/src/App*before optional target/project renames. - Add compatibility lookup for old backend binary names and old settings paths during transition.
Commit Strategy
chore(layout): add canonical foldersbuild(backend): add embedded binary buildfeat(mac-shell): host local backend in webviewfeat(sync): add shared settings contractfeat(help): add native help popup + web fallbackbuild(packaging): add self-contained app + dmg scriptschore(rename): finalize naming migration