FTEG Platform Architecture

Prompt 2c done Canonical model: fteg-store + fteg-erp + sme-erp (Business OS). Entity ERP git: pkg-sme-erp — main checkout hubs/sme-erp. Yuzu Marketing = client on Business OS; 9981 Yuzu = product. Source: /srv/www/hubs/GROUP-ARCHITECTURE.md § restudy

3Architecture layers
12Implementation prompts
100Client target (Business OS)
RM300kYearly revenue goal
Team rule: After each implementation prompt, update data/ecosystem.json and refresh this page so progress stays visible on platform-38792281.fteg.dev. Current map:

1. Three layers

┌─────────────────────────────────────────────────────────────┐
│  fteg-store (platform)                                       │
│  catalog · billing · client portal · provision               │
│  NOT parked under any ERP                                    │
└───────────────────────────┬─────────────────────────────────┘
                            │
      ┌─────────────────────┼─────────────────────┐
      ▼                     ▼                     ▼
 fteg-erp                                    sme-erp (Business OS)
 (FTEG 法人)                                 (Yuzu Marketing + other SMEs)
                                                     └─ 9981 Yuzu = product
      │                     │                     │
      └─────────────────────┴─────────────────────┘
                            │
              product tenants: CMS, Reservation, Commerce, …
    

Today: store logic still inside hubs/fteg-erp. Target: standalone hubs/fteg-storeDESIGN.md (Prompt 2a).

2. fteg-store (commercial platform)

Design: /srv/www/hubs/fteg-store/DESIGN.md · Setup: SETUP.md · Package: pkg-client-portal v0.2

Store buyers (Prompt 2c live)

codebuyer_typepricing_tierERP hubCRM in fteg-erp?
fteginternalinternal_rm0fteg-erpNo
ymsbYuzu Marketinginter_cosme-erp (Business OS)Yes — FTEG client
externalSMEstandardsme-erp if Business OSYes

Staff subscribe + RM0 invoices: StaffSubscribeService in pkg-client-portal. Seeder: StoreBuyerSeeder.

OwnsDoes not own
Global catalog & plans (FTEG admin only)
Store buyers & subscriptions
Invoices / Fiuu (package-billing)
Client portal (external SMEs)
Product instance registry + provision
Company HR / full CRM for group entities
CMS content editing (that's CMS BO)
fung-erp executive rollup

3. entity-erp (company OS)

InstanceLegal entitySold on store?
fteg-erpFTEG TechnologyNo — platform operator
sme-erpClient companies (SMEs)Yes — Business OS SKU
ymsb-erpYuzu Marketing *(transitional shell)*Prefer Business OS on sme-erp
Example — Yuzu Marketing Sdn Bhd
FTEG client → buys Business OS (sme-erp) → company hub.
9981 Yuzu = their custom ecommerce product instance (launcher from Business OS / portal), not a second ERP.

Portal vs ERP hub
Products only → client portal opens each product BO
+ Business OS → ERP hub lists integrated products (launcher, not CMS editor)

3b. entity-erp git — pkg-sme-erp

One Bitbucket repo for all entity-erp host trees: ftegproject/pkg-sme-erp (formerly pkg-erp).
Main development checkout: /srv/www/hubs/sme-erp (path alias /srv/www/pkg-sme-erp → same tree).
hubs/fteg-erp and hubs/ymsb-erp are same-repo overlays (host env, nginx, brand/seed drift) — pull shared app changes from sme-erp / origin/master, do not treat fteg-erp as the git home.
PathRoleRemote
hubs/sme-erp (= pkg-sme-erp) Main development · Business OS multi-tenant git@bitbucket.org:ftegproject/pkg-sme-erp.git
hubs/fteg-erp FTEG operator overlay
hubs/ymsb-erp Transitional YMSB shell overlay

Shared CRM logic lives in Composer package pkg-crm (Bitbucket ftegproject/pkg-crm), not inside the entity-erp git tree. Prefer sme-erp first for shared entity-ERP changes, then pull on fteg/ymsb.

4. CMS — 1 site = 1 purchase

ScenarioSubscriptionsCMS BOs
FTEG official + investor2 × cms-web (RM0)2 separate tenants
Client needs 5 websites5 × cms-web5 BOs; portal/ERP lists all 5
FTEG 官网 (Corporate Web)Optional: no storefteg-officialweb deploy

ERP and portal show many instances; each CMS BO edits one site.

5. Yuzu Marketing (YMSB) — Business OS client

Yuzu Marketing Sdn Bhd = FTEG CRM + store buyer ymsb → purchases Business OSerp_hub=sme-erp.
9981 Yuzu = custom ecommerce under that company (product instance / legacy commerce BO).
Same pattern as any SME: portal + Business OS launcher lists 9981, CMS, etc.
ymsb-erp brand-registry shell is transitional — target is the sme-erp workspace for Yuzu Marketing.

6. Store buyers

BuyerPricingentity-erpfteg-erp CRM client?
External SMEStandardsme-erp (if Business OS)Yes
Yuzu Marketing (ymsb)Inter-co OKsme-erp (Business OS)Yes — FTEG client
FTEGInternal RM0fteg-erpNo (not client of self)

7. Business OS pricing & quotas (mission)

Tier Price Seats Storage CPU units / mo Product instances CRM records
Starter RM300/mo · RM3,000/yr 3 2 GB 1,000 10 500
Pro RM1,000/mo · RM8,000/yr 15 20 GB 10,000 50 5,000

Soft alerts at 80% / 100%. Starter over-quota → upgrade to business-os-pro-yearly (RM8k/yr).
VPS cost floor ~RM350–650/mo shared host; target ≥3× margin — not 100 VPS clones.
See Business OS plan · METERING.md · CAPACITY.md.

8. Shared packages

Package / repoRole
pkg-sme-erpEntity-erp app git (sme / fteg / ymsb host trees) — see § 3b
pkg-crmClients, appointments, pipeline / inbox, quotations, client documents (per entity-erp). UI: Pipeline / Inbox / Appointments — not Lead.
package-billingInvoices & payments
pkg-cloudflareDNS / hostnames BO
myinvoise-Invoice / LHDN
package-cms + SEOWeb CMS product tenant

8b. Maintainability restudy

Verdict: prefer this structure. Two live company-OS shapes (fteg-erp + multi-tenant sme-erp) beat a permanent third peer (ymsb-erp). Yuzu Marketing onboards like any SME; 9981 is a product instance.
Full comparison table: GROUP-ARCHITECTURE.md § Structure restudy.

8c. Group / buyer metrics API (fung)

FTEG: GET /api/group/metrics on fteg-erp.
Yuzu Marketing: GET /api/buyers/ymsb/metrics on fteg-store (YMSB_METRICS_SOURCE=store). Transitional ymsb-erp group API = fallback only.

9. Live access (dev)

All primary hubs for the Yuzu Marketing / Business OS cutover. Staff logins use personal accounts (shared users table) unless a portal demo password is listed on the platform plan.
SurfaceRoleURL
Yuzu Marketing · Business OS Client company hub (slug ymsb) ymsb.sme-erp.fteg.dev/auth/login
9981 Yuzu Ecommerce product under Yuzu 9981wine.fteg.dev · BO
Client portal fteg-store B2B portal fteg-client…/portal/login
fteg-store App store / catalog public fteg-appstore-58290393.fteg.dev
FTEG ERP FTEG staff company OS fteg-erp-bo…/auth/login
fung-erp Executive rollup fung-erp-bo.fteg.dev (deploy pending — see SETUP.md)
ymsb-erp Transitional / frozen ymsb-erp-bo.fteg.dev legacy
Platform map This plan + canvas platform-38792281.fteg.dev · Plan · Map

10. Implementation progress

PromptTopicStatus
0Architecture doc + this pageDone
1apkg-crm v0.4.2 in fteg-erpDone
1bfteg-erp tests green (146 pass)Done
pkg-crm v0.5 client documents · all entity-erp hostsDone
pkg-crm v0.6.1 sales desk — Appointments + Pipeline / Inbox nav on fteg-erp, ymsb-erp, sme-erp, fteg-storeDone
Rename pkg-erp → pkg-sme-erp · git home = sme-erpDone
2afteg-store DESIGN.mdDone
2bfteg-store app + pkg-client-portalDone
2cStore buyers FTEG + YMSB (RM0)Done
3a–bCMS 1-site policy · Business OS SKUDone
4a–bymsb-erp shell · brand registry + store linkDone
5aMulti-product portal / ERP consoleDone
5bGroup metrics API (fung prep)Done
Afung-erp G0 shellDone
Bsme-erp multi-tenant + 100-client capacityDone
CBusiness OS Pro metering + VPS cost modelDone
G1fung-erp cached metrics + group totalsDone
G2fung-erp headcount + 9981 operator widgetsDone
G3Board pack PDF exportDone
S2FTEG can invoice clientsDone
S3YMSB feeds fung financeDone
S4Boss compare dashboardDone

Full copy-paste prompts: /srv/www/hubs/IMPLEMENTATION-PROMPTS.md

11. Related links

Loading version… · Access table on architecture HTML