Skip to content

Magic PIM

Magic PIM is the master product database for the entire ecosystem. Built on Medusa 2.0, it imports product data from multiple suppliers and syncs to tenant databases.

GitHub: midego1/Magic-PIM (private) URL: https://pim.magicomniverse.online (admin panel at /app) Backend port: 4002 | Deployed on: Coolify (new server, 159.195.68.41) Old location: /mnt/data/magic_pim/ (old server, being decommissioned)

Supplier Feeds ──► Connectors ──► magic_pim DB ──► Tenant DBs
(CSV/Excel/JSON) (Parse) (Master) (Per-tenant
aplt_products)
SupplierCodeAPLT VariantsMedusa ProductsMedusa VariantsConnector File(s)Notes
Spranz01760492698spranz.tsStock sync only
Moxz0291515-Not automated
Langenberg03244245257-Not automated
XD Connect046,1651,3866,247xdconnect.ts, xdconnect-categories.tsProducts + prices + stock + print
PF Concept0517,8252,03017,808pfconcept.ts, pfconcept-imagedata.tsProducts + stock + print
Midocean0614,4962,44314,496midocean.tsProducts + stock
Toppoint075,8561,8425,856toppoint.tsProducts
NewWave Textiles0926,23995926,239newwave.ts4 brands: Cutter & Buck, Clique, Craft, Jobman
interface ConnectorConfig {
id: string // e.g., 'spranz_stock'
name: string // Display name
supplierCode: string // Supplier identifier
type: 'products' | 'stock' | 'prices' | 'categories'
feedUrl?: string // Remote feed URL
feedFormat: 'csv' | 'excel' | 'json' | 'xml'
frequency: string // Update schedule
active: boolean
}
MethodEndpointPurpose
GET/POST/admin/connectorsList/configure connectors
POST/admin/connectors/syncTrigger sync (supports force download)
POST/admin/connectors/medusa-syncSync to Medusa native tables

The Medusa sync (/admin/connectors/medusa-sync) groups APLT rows into Medusa products:

  • Grouping: Products are grouped by the model field in APLT. All variants with the same model become one Medusa product with multiple variants (color/size).
  • Variant SKU: Each Medusa variant gets the variant_code from APLT as its SKU.
  • Categories: Products are linked to Medusa categories via master_category_code in APLT → product_category.handle in Medusa.
  • Barcode conflicts: If an EAN is already used by another supplier, the product is created without barcode.
  • SKU conflicts: If a variant SKU already exists under a different supplier, the product is skipped.

All connectors use upsertProduct() (singular) from database.ts:

  • Lookup: variant_code + supplier_code (unique per variant)
  • Fallback: sku + supplier_code if no variant_code

PIM runs on the new Coolify server as a standalone Docker app.

DetailValue
Coolify App UUIDa5j3s2r6zqjter8ps2mpqf12
Container port4002
Databasemagic_pim (189 tables, shared magic-postgres)
RedisShared instance (db index 1)
BuildMulti-stage Dockerfile from backend/
Terminal window
curl -X POST -H 'Authorization: Bearer <API_TOKEN>' \
'https://coolify.magicomniverse.online/api/v1/deploy?uuid=a5j3s2r6zqjter8ps2mpqf12'