Code Distribution
Overview
Section titled “Overview”magic_development is the master codebase. All code changes are made here first, tested, then distributed to the other 7+ tenants.
Workflow
Section titled “Workflow”-
Develop in
magic_developmentTerminal window cd /mnt/data/magic_omniverse/magic_commerce/magic_development/backend/# Edit files in src/ -
Rebuild and test
Terminal window cd /mnt/data/magic_omniverse/magic_commerce/magic_developmentdocker compose build backenddocker compose up -d backend -
Verify at
https://admin-development.magiceverse.online -
Distribute to other tenants
Terminal window src="/mnt/data/magic_omniverse/magic_commerce/magic_development/backend/src"for tenant in magic_brinxx magic_default magic_logohorloge magic_bovisales magic_demo magic_desluis magic_jodasign magic_spranz; dodst="/mnt/data/magic_omniverse/magic_commerce/$tenant/backend/src"cp -r "$src/api/admin/aplt/your-changed-route/" "$dst/api/admin/aplt/your-changed-route/"done -
Rebuild affected tenants
Terminal window cd /mnt/data/magic_omniverse/magic_commerce/magic_brinxxdocker compose build backenddocker compose up -d backend
Examples
Section titled “Examples”Deploy a PDF fix to all tenants
Section titled “Deploy a PDF fix to all tenants”src="/mnt/data/magic_omniverse/magic_commerce/magic_development/backend/src/api/admin/aplt"for tenant in magic_brinxx magic_default magic_logohorloge magic_bovisales magic_demo magic_desluis magic_jodasign magic_spranz; do dst="/mnt/data/magic_omniverse/magic_commerce/$tenant/backend/src/api/admin/aplt" cp "$src/orders/pdf/route.ts" "$dst/orders/pdf/route.ts" cp "$src/quotations/pdf/route.ts" "$dst/quotations/pdf/route.ts"doneRebuild all backends
Section titled “Rebuild all backends”for d in /mnt/data/magic_omniverse/magic_commerce/*/; do cd "$d" && docker compose build backend && docker compose up -d backenddoneDev Projects Tracking
Section titled “Dev Projects Tracking”Use the Dev Projects system to track changes:
# Create projectcurl -X POST "https://admin-development.magiceverse.online/admin/dev-projects" \ -H "Content-Type: application/json" \ -d '{"name": "PDF Fix", "project_type": "bugfix"}'
# Track filescurl -X POST "https://admin-development.magiceverse.online/admin/dev-projects/files" \ -H "Content-Type: application/json" \ -d '{"project_id": 1, "files": [{"file_path": "src/api/admin/aplt/orders/pdf/route.ts", "change_type": "modified"}]}'
# Log changecurl -X POST "https://admin-development.magiceverse.online/admin/dev-projects/changelog" \ -H "Content-Type: application/json" \ -d '{"project_id": 1, "action": "fix", "description": "Fixed PDF generation", "changed_by": "developer"}'Git Integration
Section titled “Git Integration”Dev Projects creates git branches:
- Branch pattern:
dev-project/{projectCode} - Repository root:
/mnt/data/magic_omniverse/magic_commerce/magic_development - Commits logged with “Dev Projects Bot” author