MAS-ERP Platform Setup
First run only: connect the database, SMTP, and create the Super Admin. The system will then create the required schema, permissions, and policies automatically.
Checking current state...
Provider-only saves update only the selected provider. Use Initialize / Reconfigure Database when moving to a new Supabase project or rebuilding a database; unrelated saved settings are preserved when their fields are left unchanged.

1. Database

Dashboard credentials are stored only in the protected mas-erp/platform-config.json and are never returned to browser responses. They are used only by the server-side provider Usage reader.
The ImgBB key is saved only in the protected local mas-erp/platform-config.json file on your server/device. It is never written to the keyless JSON or sent back to the browser. Leave blank to keep the saved key.
Oracle Cloud: use Host + Port + Service Name + User + Password. The ERP code does not need to change for each database; the provider adapter implements the same schema contract.

2. Email / SMTP

3. AI Provider

The AI API key is stored server-side in the persistent platform configuration and is never returned to the browser.

4. Initial Super Admin

5. Test Mode

Test Mode also requires the individual company's own Test Mode toggle (Super Admin → company list) and at least one active, non-placeholder employee — this is the platform-level gate both of those depend on. Disabled automatically in production (NODE_ENV=production).
Checking platform status...
MAS ERP
Select account and password:

📝 Registration Control

Loading registration controls... ⏳

🗄️ Database Monitor & Control

Loading database metrics... ⏳
🧾 Audit LogCentral Excel-style operations log
Loading audit log... ⏳

💬 Feedback Center

Loading feedback... ⏳

🛡️ Super Admin — Company Management (Platform)

📈 Registered / OnlineTenant · Supplier / Category · Customer
Loading registration and platform metrics... ⏳
🎁 OffersPlatform offers, eligibility, expiry, and redemptions
Loading offers... ⏳
⭐ MASA LoyaltyCustomers, points, rewards, participation, and expiry
Loading MASA Loyalty... ⏳
⚙️ Platform SettingsPlatform-wide security and authentication
🔐 Security & Authentication

Authentication now uses Supabase Auth, ERP operational data uses PostgreSQL/JSONB with Tenant isolation through RLS. Legacy test-company data is not used here.

✅ Supabase Auth Connected
💬 MASA ChatSearch and ask MASA without leaving the workspace
📚 Knowledge CenterMASA ready-question catalog and answers
🧾 Pricing → CostPlatform AI usage cost
📈 Pricing → Cost → Live Competitive PricingSuper Admin market intelligence and paid Tenant access control
🧪 Universal Case Verification FrameworkPlatform-wide verification / selected operation / MASA remediation readiness
🧠 Market Learning / Defaults BankLearned scenarios and approved defaults

💳 Subscription & Trial

How to use:

  1. Open Tenants Demo, record the Admin Email (or press Use existing Company Admin if the Demo already has one) and press Migrate (this company only) to turn a Demo into a Trial.
  2. Online registrations are created directly as a Trial (activation link by email). They appear under Tenants Live and need no migration; Migrate is only for Demos created by the Super Admin.
  3. Open Tenants Live, expand the company row (+) and press Settings / Expiry to set the license expiry.
  4. When the agreed subscription starts, press Convert to Subscribed on the Trial row.
  5. Trial duration for online registrations is set from Registration Trial Policy.
TrialBasicAdvanced

🔐 Feature Entitlements

Choose a company in Modules & Engines to grant or deny individual engine access. This panel explains the control boundary; it does not duplicate the detailed entitlement editor.

📈 KPI & Annual Appraisal

Load a company to get its industry-specific KPI library. Edit the template weights, save an employee profile using their job title, enter actual achievement percentages, then create the annual appraisal. Enabled KPI weights must total 100.

🛡️ Access / Audit

What it is: a shortcut to the central Audit Log (source: erp_audit_log). It records Grant / Deny / expiry changes and every time a Super Admin enters a company.
What you do here: open the Audit Log, then use the filters (company, industry, type, dates) and Export Excel. Changing access itself is done in Modules & Engines.

👥 Assistant Admins

Status: not built yet. There is no screen to create an Assistant Admin in this release.
Until it exists: give a trusted employee the Org Chart edit permission in the company's Permissions screen; that user can then change the company's departments (Org Chart > Departments) without being a Company Admin. Super Admin rights are never inherited.

🏢 Company Management — Full Access

Select a company below to enter it temporarily with full Company Admin privileges and manage its operational modules.

🤖 AI ModuleAI, Vision, Help Bot, and AI controls
Loading Energy readings... ⏳

🏭 Industrial & Manufacturing Operations

Industrial Operations, Production/MRP, BOM/Routing and Quality on canonical platform Engines

...

🔔 Notifications Center
🔊 Notification Sound
Operational modules — each section appears once below.
Loading competitor pricing... ⏳

🌳 الهيكل التنظيمي المعتمد (Org Chart)

عرض المرؤوسين والمسؤوليات المباشرة حسب موقعك
👤 Company Admin
Loading organizational hierarchy... ⏳

🏘️ Compound & Community Management

Units, owners, dues, vehicles, services, visitors, maintenance, security and assemblies
Loading compound data... ⏳
📋 أوامر العمل (Work Orders)
Loading tasks... ⏳
👈 Select a work order from the list to view details

📦 المخزن والمعدات (WearHouse & HSE)

Inventory, issued assets and operational equipment
Loading warehouse inventory... ⏳

🛒 المشتريات والموردين (Procurement)

Shortages, purchase requests, approval cycle and suppliers
Loading procurement... ⏳
📅 إدارة الاجتماعات وحجز الغرف
Loading meetings... ⏳
👈 Select a meeting from the list to view details
💰 المالية — الفروع المالية
⚙️ Approval Configuration
Central configuration outside advances and allowance branches. Each policy type is independent; administrative approval is built from the Org Chart, and execution follows the permission matrix.
🏦 Branch Treasury Balances
Accounting Manager, CFO and higher-authority users can review branch Treasury balances. The assigned branch Treasury employee can maintain the balance for that branch.
Choose the required finance branch. Opening the advance screen in a new tab is optional.

🔧 Automotive Service Operations

Workshop, vehicle references, parts references and service orders on the canonical Automotive Engine

🌾 Agriculture Operations

Farm Operations + Crop Lifecycle on the existing canonical Engines

🚗 Fleet Management & Mission Vehicle Booking

Current utilization, planned trips, drivers and vehicles — in one view
Loading fleet and requests... ⏳

🛒 Trade & Retail Core

🔧 Technician Assignment to Work Orders

See workload, planned assignments and technician availability
Loading technician requests... ⏳

🛡️ Roles & Permissions

Control access, roles and approval capabilities
Loading permissions... ⏳

✈️ إدارة التنقلات (طيران / أتوبيسات)

Travel requests, approvals and booked journeys
Loading transportation requests... ⏳

🏨 إدارة الإقامة (فنادق / إيجارات)

Hotels, rentals and approved stays
Loading accommodation requests... ⏳
👥 الموارد البشرية — طلبات الإجازات ورصيدها
جاري تحميل بيانات الإجازات... ⏳
👈 اختار طلب إجازة من القائمة عشان تشوف التفاصيل

🗂️ إدارة المراسلات والسكرتارية

Correspondence routing, ownership and follow-up
جاري تحميل المراسلات... ⏳
💻 طلبات الدعم الفني (IT)
جاري تحميل تذاكر الدعم الفني... ⏳
👈 اختار تذكرة من القائمة عشان تشوف التفاصيل