Skip to content

Magic Portal

The Magic Portal (portal.magiceverse.online) is the central management hub for the entire Magic e-VERSE ecosystem. Built with Vite + React frontend and Express backend, it integrates tenant management, documentation, CRM, support, and infrastructure monitoring into a single interface.

Location: /mnt/data/magic_omniverse/magic_portal/

Frontend: React 19 + Vite 7 + TypeScript
Backend: Express 4.18 (server.cjs, ~3,500 lines)
Frontend: Single App.tsx (~6,500 lines)
Database: MySQL (magic_doc) + PostgreSQL (3 pools: magic_b2b_brinxx, magic_b2b_development, master_magic)
Port: 4096
  • Deploy projects to multiple tenants simultaneously
  • Sequential multi-tenant backend/storefront rebuild with progress tracking
  • Deployment history and release tracking
  • Docker-based infrastructure control
  • Multi-category documentation with full-text search
  • Markdown rendering with Mermaid diagram support
  • System updates and security alerts (severity levels: critical, high, medium, low)
  • Release notes and version tracking
  • Support ticket lifecycle (open, in_progress, waiting_customer, waiting_internal, resolved, closed)
  • Comments and activity logging
  • Staff assignment and categories
  • Knowledge base articles
  • Lead pipeline (new, contacted, qualified, proposal, negotiation, won, lost, churned)
  • Activity tracking (calls, meetings, emails)
  • Task management with due dates
  • Priority levels (hot, warm, cold)
  • IP whitelist management
  • Access request approval workflow
  • Email-based activation links
  • Expiration dates for IP entries
  • Port registry with service categorization
  • Asset management with health status
  • Nginx URLs overview (grouped by category)
  • User management with roles (admin, developer, client)
  • Project access control per user
  • Client management
  • Email invitations with temporary passwords
  1. User submits email + password
  2. Server validates against MySQL users table (bcrypt hashed)
  3. IP check against PostgreSQL ip_whitelist
  4. If IP not whitelisted: 2FA via WhatsApp (6-digit OTP, 5-min expiry)
  5. Session created with 30-day expiration
  6. First login forces password change if must_change_password=1

MySQL (magic_doc):

  • users — Portal users with roles
  • portal_clients — Client organizations
  • portal_projects — Projects per client
  • portal_user_permissions — Access control matrix
  • portal_support_tickets — Support tickets
  • portal_tenant_deployments — Deployment history
  • documents — Documentation articles
  • system_updates — Security/feature updates

PostgreSQL (3 separate database pools via 172.17.0.1:5432):

pgPool — magic_b2b_brinxx (Gatekeeper / IP whitelist):

  • ip_whitelist — IP whitelist entries

pgDevPool — magic_b2b_development (Releases / Dev Projects):

  • dev_projects — Development project tracking
  • dev_project_releases — Release history

pgMasterPool — master_magic (CRM):

  • crm_leads — CRM lead data
  • crm_lead_activities — Lead interaction history
  • crm_lead_tasks — Lead-related tasks
MethodEndpointPurpose
POST/api/auth/loginUser login
POST/api/auth/verify-2fa2FA verification
POST/api/auth/logoutSession termination
GET/api/auth/checkCheck auth status
POST/api/auth/change-passwordChange password (also for forced change on first login)
MethodEndpointPurpose
GET/api/customer-dashboardCustomer-facing dashboard data
MethodEndpointPurpose
GET/api/updatesList system updates and alerts
MethodEndpointPurpose
GET/api/tenant/tenantsList tenants
POST/api/tenant/deploy-projectDeploy projects
POST/api/tenant/rebuildStart rebuild job
GET/api/tenant/rebuild/:jobIdPoll rebuild status
MethodEndpointPurpose
GET/POST/api/crm/leadsLead CRUD
POST/api/crm/leads/:id/activitiesLog activity
POST/api/crm/leads/:id/tasksCreate task
GET/api/crm/statsCRM statistics
MethodEndpointPurpose
GET/api/gatekeeper/my-ipCurrent IP detection
POST/api/gatekeeper/whitelistAdd IP
GET/api/gatekeeper/requestsAccess requests
POST/api/gatekeeper/requests/:id/approveApprove request