Quick Start
Prerequisites
Section titled “Prerequisites”- Node.js >= 20 (v22 recommended)
- Docker and Docker Compose
- SSH access to the server
- Access to the PostgreSQL database (port 5432)
Development Workflow
Section titled “Development Workflow”-
Make changes in the master tenant
All development happens in
magic_development:Terminal window cd /mnt/data/magic_omniverse/magic_commerce/magic_development/backend/ -
Edit source code
Backend code is in
src/:src/api/admin/aplt/ # Admin API routessrc/api/store/ # Store API routessrc/admin/routes/ # Admin UI pagessrc/modules/ # Custom Medusa modules -
Rebuild the backend container
Terminal window cd /mnt/data/magic_omniverse/magic_commerce/magic_developmentdocker compose build backenddocker compose up -d backend -
Test your changes
Visit
https://admin-development.magiceverse.onlinefor the admin panel or check logs:Terminal window docker logs magic_development_backend_dev --tail=50 -f -
Distribute to other tenants
Terminal window 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; dodst="/mnt/data/magic_omniverse/magic_commerce/$tenant/backend/src/api/admin/aplt"cp -r "$src/your-changed-folder/" "$dst/your-changed-folder/"done -
Rebuild tenant containers
Terminal window cd /mnt/data/magic_omniverse/magic_commerce/magic_brinxxdocker compose build backenddocker compose up -d backend
Common Commands
Section titled “Common Commands”Check container status
Section titled “Check container status”docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" | grep magic_View logs
Section titled “View logs”# Backend logsdocker logs magic_brinxx_backend_dev --tail=50 -f
# Storefront logsdocker logs magic_brinxx_storefront_dev --tail=50 -fDatabase access
Section titled “Database access”# PostgreSQLdocker exec magic_pim_postgres_dev psql -U postgres -d magic_b2b_brinxx
# MySQLdocker exec mysql mysql -uroot -p<your-db-password> magic_docRebuild 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 backenddonePort Map Quick Reference
Section titled “Port Map Quick Reference”| Tenant | Backend | API | Storefront | Redis |
|---|---|---|---|---|
| Development | 4010 | 7010 | 10010 | 6310 |
| Demo | 4020 | 7020 | 10020 | 6320 |
| Default | 4030 | 7030 | 10030 | 6330 |
| Brinxx | 4040 | 7040 | 10040 | 6340 |
| Bovisales | 4050 | 7050 | 10050 | 6350 |
| De Sluis | 4060 | 7060 | 10060 | 6360 |
| Jodasign | 4070 | 7070 | 10070 | 6370 |
| Logohorloge | 4080 | 7080 | 10080 | 6381 |
| Spranz | 4091 | 7090 | 10090 | 6391 |
| Master Magic | 4059 | 7059 | — | 6390 |
Shared Services:
| Service | Port |
|---|---|
| PIM Backend | 4002 |
| PIM API | 7992 |
| PostgreSQL | 5432 |
| MySQL | 3306 |
Dev Projects Tracking
Section titled “Dev Projects Tracking”Use the Dev Projects system to track your changes:
# Create a new projectcurl -X POST "https://admin-development.magiceverse.online/admin/dev-projects" \ -H "Content-Type: application/json" \ -d '{"name": "My Feature", "description": "Description", "project_type": "feature"}'
# Add files to the projectcurl -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/route.ts", "change_type": "modified"}]}'
# Log a changelog entrycurl -X POST "https://admin-development.magiceverse.online/admin/dev-projects/changelog" \ -H "Content-Type: application/json" \ -d '{"project_id": 1, "action": "modify", "description": "Fixed order PDF", "changed_by": "developer"}'