Portal browser
│ HTTPS + Ibnu Sina session cookie
▼
Next.js 16 frontend ───────────────► Laravel 13 API (/api/v1)
│
├── PostgreSQL / Supabase data project
├── Supabase Storage
├── Utopia Hub identity and profiles
├── Legacy mirror/projection
└── Integration outbox
Utopiaspace Ops ── Hub JWT + X-OE-BU ──► Utopia OE ──► /api/v1/ops/*
Utopia OE board ── Ibnu Sina API token ──────────────► /api/v1/oe/*
| Layer | Technology | Responsibility |
|---|---|---|
| Portal | Next.js 16, React 19, TypeScript, Tailwind | Staff screens, navigation and document views |
| API | Laravel 13, PHP 8.3+ | Validation, PBAC, state transitions, audit and integration orchestration |
| Data | PostgreSQL in the Ibnu Sina Supabase project | Operational records, counters, audit, legacy mirror and projection |
| Files | Supabase Storage through S3-compatible disks | Proof, slips, identity documents and catalogue images |
| Identity | Shared Utopia Hub Supabase | Google authentication, JWT, profiles, policies and shared fleet source |
| Field client | Expo/React Native Utopiaspace Ops | Driver and warehouse workflows |
| Broker | Utopia OE | Chooses the BU using X-OE-BU and forwards contracts unchanged |
app_users row establishes membership.The frontend can adopt the shared Utopia Hub session through the parent-domain cookie and exchange it for an Ibnu Sina session. Google PKCE remains the direct-login fallback. Authentication answers who the person is; the local user record answers whether the person belongs to this system.
is_live_ machine token with the relevant scopes.Source row events first enter legacy_mirror. Ingestion state, mappings and issues are recorded separately. Projection functions then update operational tables with identity and out-of-order safeguards. The operational model remains the portal’s query surface.
| Path | Purpose |
|---|---|
backend/app/Http/Controllers |
HTTP endpoints grouped by business capability |
backend/app/Services |
State machines and transactional business logic |
backend/app/Models |
Operational records and relationships |
backend/app/Http/Resources |
Stable API response shapes |
backend/app/Http/Requests |
Validation at the API boundary |
backend/supabase/migrations |
Authoritative schema, seed and database functions |
backend/supabase/functions |
Legacy/event integration functions where present |
frontend/app |
Next.js routes |
frontend/components |
Feature and shared UI |
frontend/lib |
API clients, types and pure helpers |
utopiaspace-ops/src/bu/ibnu-sina |
Independent driver/warehouse client slice |
stock_units and batch-on-hand results are current-state projections, not replacement history.