Skip to content

AUDIT: Platform Deep Dive & Status Report

╔══════════════════════════════════════════════════════════════════════╗
║ ║
║ █████╗ ██╗ ██╗██████╗ ██╗████████╗ ║
║ ██╔══██╗██║ ██║██╔══██╗██║╚══██╔══╝ ║
║ ███████║██║ ██║██║ ██║██║ ██║ ║
║ ██╔══██║██║ ██║██║ ██║██║ ██║ ║
║ ██║ ██║╚██████╔╝██████╔╝██║ ██║ ║
║ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ║
║ ║
║ P L A T F O R M D E E P D I V E ║
║ ║
║ Magic e-VERSE -- Full Infrastructure Audit ║
║ Docker · Backend · Storefront · Security · Scalability ║
║ ║
║ Date: March 2026 ║
╚══════════════════════════════════════════════════════════════════════╝

This document is a comprehensive audit of the entire Magic e-VERSE platform based on deep analysis of every layer of the stack. It covers the current state, identifies issues by severity, and provides actionable recommendations.

AreaScoreStatus
Docker Architecture6/10Good foundations, security gaps
Backend Codebase5/10Solid features, critical security flaws
Storefront7/10Modern stack, some risky choices
Infrastructure6/10Operational but needs hardening
Code Distribution5/10Works but manual and fragile
Security3/10Critical issues requiring immediate action
Scalability5/10Adequate for now, won’t scale much further
  • 9 commerce tenants plus master billing portal and PIM system
  • 54+ running containers across the server
  • Medusa v2 backend (v2.13.1) with custom APLT B2B module
  • Next.js 15 storefront with React 19 RC
  • PostgreSQL 16, 12 Redis instances, 9 Meilisearch instances
  • 3 n8n instances for workflow automation
  • Single server running everything (8 cores, 15GB RAM)
  • Multi-stage builds on all Dockerfiles (4-stage backend, 3-stage storefront)
  • Non-root user execution (medusa UID 1001, nextjs UID 1001)
  • Alpine base images for minimal footprint
  • Well-organized port slot system with 10-port ranges per tenant
  • Per-tenant network isolation via Docker bridge networks
  • Health checks on Redis and Meilisearch services
  • Service dependency ordering with depends_on: condition: service_healthy
  • .dockerignore files present to reduce build context
  • Critical: no CPU or memory limits configured on containers
  • Production port collisions: tenants reuse 3003 and 9003 in prod configs
  • :latest image tags in production reduce reproducibility
  • No backend health checks, only Redis and Meilisearch checks
  • Massive config duplication: 4,856 lines across 18 docker-compose files with 80%+ duplication
  • Port numbering inconsistencies: magic_spranz uses 4091, magic_logohorloge uses 6381
  • No logging configuration, rotation, or centralized logging
  • Windows path references in production configs (D:/pim_data) that won’t work on Linux
TenantBackendFrontendRedisAPIMeilisearchDatabase
development401010010631070107715magic_b2b_development
demo402010020632070207720magic_b2b_demo
default403010030633070307730magic_b2b_default
brinxx404010040634070407740magic_b2b_brinxx
bovisales405010050635070507750magic_b2b_bovisales
desluis406010060636070607760magic_b2b_desluis
jodasign407010070637070707770magic_b2b_jodasign
logohorloge408010080638170807780magic_b2b_logohorloge
spranz409110090639170907710magic_b2b_spranz
master_magic405963907059master_magic
PIM40021000263807992magic_pim

The backend is built on Medusa v2.13.1 with extensive custom B2B and printing business logic:

  • 95 API route files across admin and store APIs
  • 47,000+ lines of TypeScript in 113 source files
  • 29 React admin components for custom admin UI
  • 6 supplier connector integrations: Spranz, XDConnect, PF Concept, Mid Ocean, Toppoint
  • Custom APLT module for quotations, orders, invoices, customers, techniques, and pricing
  • Modular API structure with clear admin/store separation
  • Parameterized SQL queries used widely
  • TypeScript strict null checks enabled
  • Multi-language support built into the schema
  • Comprehensive B2B features including quotation-to-order conversion, franco limits, technique pricing, and discount groups
  • Critical: unauthenticated code execution risk in Dev Projects routes
  • 14 dev-project routes have AUTHENTICATE = false
  • No consistent request-body validation
  • File path traversal risk in the editor endpoint
  • Near-zero test coverage despite Jest configuration
  • No structured logging beyond console.error
  • Inconsistent error handling across routes
  • Database connection leaks from module-scoped clients
  • No proper database migration system
  • Version misalignment between Brinxx (v2.13.1) and master_magic (v2.11.3)
  • Hardcoded /mnt/data/ paths throughout the codebase
  • No API documentation for 95 routes
  • any types are still common
CategoryScoreNotes
Architecture7/10Modular, clear separation
Code Organization8/10Good naming, logical structure
Type Safety6/10TS enabled but many any types
Testing1/10Essentially zero coverage
Error Handling5/10Inconsistent patterns
Security3/10Unauthenticated critical endpoints
Documentation2/10Minimal comments, no API docs
Performance5/10No caching, blocking syncs
  • Next.js 15 with App Router and React 19 RC
  • 217 component files across 18 feature modules
  • Tailwind CSS plus CSS variable theming
  • 4 languages: Dutch, German, French, English
  • Multi-brand support via environment variables and CSS overrides
  • Server Components by default
  • Modular feature architecture with 18 self-contained modules
  • CSS variable theming for multi-tenant branding
  • Path aliases for clean imports
  • Standalone Docker output for smaller production images
  • ISR and ISG hybrid caching strategy
  • Domain-based brand detection with fallbacks
  • React 19 RC in production
  • TypeScript and ESLint errors are ignored during build
  • reactStrictMode: false
  • dynamic = 'force-dynamic' on product pages disables caching
  • No Web Vitals monitoring
  • Hardcoded brand configs in code
  • All i18n translations loaded upfront
  • No JSON-LD structured data
  • No sitemap generation integrated into build
ResourceValueStatus
CPU8 coresAdequate
RAM15 GB (47% used)Healthy headroom
Root Disk228 GB (68% used)Approaching caution
Data Disk (NVMe)1.8 TB (37% used)Healthy
Backup Disk (SDB)916 GB (61% used)OK
NAS Backup2.7 TB (13% used)Plenty of space
Full Backup (NFS)3.5 TB (39% used)OK
Containers Running54High density
Docker Images490 GB (1,173 images)Needs cleanup

Strengths:

  • Comprehensive security headers
  • Rate limiting on login endpoints
  • TLS 1.2 and 1.3 only
  • Let’s Encrypt auto-renewal every 12 hours
  • Custom device authentication with IP whitelisting
  • Hidden server tokens

Weaknesses:

  • No WAF
  • No DDoS protection beyond basic rate limiting
  • Device auth cache only 5 seconds

PostgreSQL 16:

  • All 9 tenants share one PostgreSQL container
  • Separate database per tenant (magic_b2b_{tenant})
  • No connection pooling
  • sslmode=disable on all connections
  • No read replicas

Redis:

  • Per-tenant isolation
  • No memory limits configured
  • No persistence configured
  • No replication for HA

Meilisearch:

  • Per-tenant search indexes
  • All healthy
  • Predictable master keys ({tenant}_meili_master_key_2026)
ServiceStatusNotes
n8n (3 instances)RunningSQLite database, not production-ready
NextcloudHealthyDocument management
OnlyOfficeHealthyWeb document editor
VaultwardenHealthyPassword manager (localhost only)
SshwiftyRunningWeb SSH terminal (localhost only)
Omada ControllerHealthyNetwork management
rembg-serviceHealthyAI background removal
preflight-serviceUNHEALTHY4,272 failing health checks
  • NAS backup at /mnt/nas-backup/ (last updated Mar 2)
  • Full backup at /mnt/fullbackup/ with weekly/monthly snapshots
  • No automated database backup defined in Docker configs
  • No visible backup encryption
  • No documented restore procedure
  • Brinxx (source) -> Development (staging) -> 7 other tenants
  • Git branches for features using PROJ-2026-XXXX
  • Single git repository at /mnt/data/magic_omniverse/magic_commerce/
  • Bare repo backup at /mnt/data/magic_omniverse/magic_commerce.git/
  • All tenants share one codebase and differ by environment variables
  • Tenant-specific files excluded via .gitignore

Central PIM database syncs products to each tenant via JavaScript scripts:

  • sync-master.js (531 lines) for full product, pricing, and technique sync
  • sync-prices-only.js (153 lines) for price-only updates
  • Manual trigger only
  • No confirmation or rollback mechanism
  • No transaction support, so partial syncs are possible
  • No CI/CD pipeline
  • Deployments are manual: git pull plus docker compose build
  • Inconsistent versions across tenants
  • No automated testing or validation before deployment
  • Configuration drift risk because tenant-specific files are untracked
  • No deployment rollback mechanism
  • master_magic template is behind Brinxx

Overall Security Rating: 3/10 and requires critical action.

SecretLocationSeverity
ANTHROPIC_API_KEY=process.env.ANTHROPIC_API_KEY...All 10 docker-compose.yml filesCRITICAL
DATABASE_URL=...<your-db-password>@...All 37 occurrencesCRITICAL
JWT_SECRET=supersecret29 occurrencesCRITICAL
COOKIE_SECRET=supersecret29 occurrencesCRITICAL
MEILI_MASTER_KEY={tenant}_meili_master_key_2026All tenantsCRITICAL
Nextcloud passwordsmagic_docs/docker-compose.ymlCRITICAL

All of these are committed to git and visible in version history.

The Dev Projects feature exposes 14 routes with AUTHENTICATE = false:

EndpointRisk
POST /admin/dev-projects/commitCreate git commits
GET /admin/dev-projects/editorRead any file
POST /admin/dev-projects/rebuildRebuild the application
GET /admin/dev-projects/gitView git status
GET /admin/dev-projects/browseBrowse directories
GET /admin/dev-projects/filesAccess files
GET /admin/dev-projects/diffView diffs

These allow unauthenticated arbitrary file read and code execution if perimeter controls fail.

All database connections use sslmode=disable.

  • No fine-grained authorization in admin API
  • All admins can access all data
  • No audit logging of data access
  • 490GB of Docker images on disk expands attack surface
  • preflight-service is unhealthy with 4,272 restart attempts
  • No WAF or DDoS protection beyond basic rate limiting

The platform currently runs 9 tenants on a single server with 8 cores, 15GB RAM, and 54+ containers. That is approaching the practical limit.

BottleneckImpactLimit
Single PostgreSQLAll tenants share one DB~20-30 tenants before connection exhaustion
No connection poolingDirect connections per request~100 concurrent connections per backend
Single serverEverything on one machineHardware failure = total outage
Manual deploymentHuman bottleneckAdding tenants takes hours
Docker Compose onlyNo orchestrationCannot distribute across machines
Blocking syncsSupplier syncs block request threadsSlow under load
No CDNAll static assets served from originLatency for distant users
Build cache 0BEvery build starts from scratch20+ minute builds

Immediate:

  • Add PgBouncer for connection pooling
  • Set container resource limits
  • Clean up Docker images
  • Add Docker build cache

Short-term (1-3 months):

  • Move to Docker Swarm for basic orchestration
  • Add PostgreSQL read replicas
  • Implement Redis Sentinel for HA
  • Add CDN for static assets
  • Migrate n8n from SQLite to PostgreSQL

Long-term (6-12 months):

  • Kubernetes migration for multi-node scaling
  • Multi-region deployment with disaster recovery
  • Service mesh for advanced networking
  • Database partitioning by tenant
  • Rotate all exposed secrets and move them to .env files or Docker secrets
  • Authenticate or disable all Dev Projects endpoints and validate file paths
  • Fix or remove preflight-service
  • Add container resource limits
  • Enable database SSL
  • Add backend health checks
  • Implement connection pooling
  • Fix TypeScript and ESLint build errors
  • Synchronize Medusa versions
  • Implement CI/CD pipeline
  • Add test coverage on revenue-critical paths
  • Consolidate Docker configs
  • Add centralized monitoring
  • Implement proper database migrations
  • Add API documentation
  • Move from React 19 RC to a stable release
  • Automate PIM sync with confirmation, rollback, and notifications
  • Clean up Docker images
  • Move brand configs to database
  • Add per-language code splitting
  • Implement Web Vitals monitoring
  • Add JSON-LD for product SEO
  • Implement Redis persistence
  • Add WAF protection
  • Plan Kubernetes migration
ComponentPath
Commerce tenants/mnt/data/magic_omniverse/magic_commerce/magic_{tenant}/
Master template/mnt/data/magic_omniverse/magic_commerce/master_magic/
PIM system/mnt/data/magic_pim/
Bare git repo/mnt/data/magic_omniverse/magic_commerce.git/
Nginx configs/etc/nginx/sites-available/
Device auth/etc/nginx/snippets/device-auth.conf
DevDocs source/mnt/data/magic_omniverse/magic_docs/starlight/
Docker images490GB across 1,173 images
Backups/mnt/nas-backup/, /mnt/fullbackup/
LayerTechnologyVersion
Backend FrameworkMedusav2.13.1
Backend RuntimeNode.js22/24 (Alpine)
Frontend FrameworkNext.js15
Frontend RuntimeReact19 RC
DatabasePostgreSQL16 (Alpine)
CacheRedis7 (Alpine)
SearchMeilisearchv1.6
StylingTailwind CSS3.0.23
LanguageTypeScript5.3-5.6
ContainerDocker Composev5.0.0
Reverse ProxyNginxLatest
SSLLet’s EncryptAuto-renewal
Automationn8n1.122.4
DocsAstro StarlightLatest

This audit was generated on March 4, 2026 by analyzing every layer of the Magic e-VERSE platform using 6 parallel deep-dive agents examining Docker architecture, backend codebase, storefront codebase, infrastructure and networking, code distribution, and security posture.