Restricted Access
LEAD COMMAND · PHASE 0 · AUTHORISED PERSONNEL ONLY
Invalid credentials
L
LEAD // Phase 0
ENV: STAGING
BUILD: v0.1.0-alpha
Business Finland MVS

LEAD Architecture

Internal Engineering Hub & Prototype Logic Suite

This environment houses the Minimum Viable System (MVS) logic for LEAD's Phase 0 prototype, structured for Business Finland grant evaluation. All modules represent live prototype logic — not mockups — designed to validate the four-way handshake model, result-oriented discovery UX, and geo-radius logistics routing as fundable technical differentiators.

System Actors
4
Core Collections
3
Handshake States
4
MVS Phase
0
01

Result-Oriented Portrayal & Interactive Discovery

PROTOTYPE LOGIC: Consumer discovery engine filters listings by outcome attributes — not cuisine type. Multi-tag intersection logic updates results in real-time. Surfaces chef proximity, macro-match score, and ETA.
Discover
Deals & Value
Dietary
Preferences
Showing 8 / 8 results Sort: Match Score ↓
🥗
38g protein
Greek Power Bowl
Chef Markku · 0.8km
22 min €11.50
Match Score: 94%
🍛
Vegan
Lentil Masala Wrap
Chef Aino · 1.2km
18 min €9.00
Match Score: 88%
🥩
45g protein
Grilled Salmon Plate
Chef Lauri · 2.1km
25 min €14.90
Match Score: 85%
🥙
Vegan
Falafel & Tahini Box
Chef Priya · 0.5km
32 min €8.50
Match Score: 79%
🍳
32g protein
Egg White Scramble
Chef Outi · 0.3km
15 min €7.80
Match Score: 91%
🌮
Vegan
Black Bean Tacos
Chef Sakari · 1.7km
20 min €10.20
Match Score: 76%
🥦
41g protein
Teriyaki Chicken Bowl
Chef Juhani · 1.0km
28 min €13.50
Match Score: 83%
🫕
Local
Nordic Porridge Set
Chef Helmi · 0.6km
12 min €6.90
Match Score: 72%
⚙️
No results match the active filter combination.
Expand filters or adjust outcome criteria.
02

The Four-Way Handshake — Logistics State Machine

PROTOTYPE LOGIC: The handshake FSM is the core orchestration model. A Webhook fires on Chef acceptance, routing a geo_radius_ping to available couriers within a set radius. The platform acts as coordination authority at State 3.
👤
Consumer
Idle
👨‍🍳
Chef
Idle
⚙️
Platform
Idle
🛵
Courier
Idle
STATE_1 Consumer → Indent Placed

Consumer submits an Indent referencing a Chef listing. Writes to active_indents_collection with order_state: "PENDING".

STATE_2 Chef → Indent Accepted

Chef confirms availability and preparation timeline. State moves to "CONFIRMED". Triggers Platform webhook listener.

STATE_3 Platform → Logistics Webhook

Platform dispatches webhook to logistics_webhook_routing. Computes geo_radius_ping and assigns courier_bounty_price.

STATE_4 Courier → Geo-Radius Assigned

Nearest available Courier within radius accepts dispatch. Order transitions to "IN_TRANSIT".

// Press "Run Simulation" to execute handshake FSM
// System ready — all nodes at IDLE state
Progress:
0%
03

Backend Architecture — Database Collections

users_collection MongoDB
// Core identity & KYC layer
{
user_id: ObjectId,
role_type: Enum[
"CONSUMER", "CHEF",
"COURIER", "ADMIN"
],
kyc_status: Enum[
"UNVERIFIED", "PENDING", "VERIFIED"
],
live_geo_location: {
type: "Point",
coordinates: [lng, lat]
} // GeoJSON
}
// Indexes
2dsphere: live_geo_location
compound: role_type + kyc_status
active_indents_collection MongoDB
// Live order state tracking
{
indent_id: ObjectId,
consumer_id: Ref(users),
chef_id: Ref(users),
courier_id: Ref(users) | null,
order_state: Enum[
"PENDING", "CONFIRMED",
"DISPATCHED", "IN_TRANSIT",
"DELIVERED", "CANCELLED"
],
created_at: ISODate,
ttl_expires: ISODate
}
// Indexes
order_state: 1
consumer_id + created_at: compound
TTL: ttl_expires // auto-expire
logistics_webhook_routing MongoDB
// Dispatch & geo-routing events
{
dispatch_id: ObjectId,
associated_indent_id:
Ref(active_indents),
geo_radius_ping: {
origin: GeoJSON,
radius_km: Float,
candidates_found: Int,
ping_timestamp: ISODate
},
courier_bounty_price: {
base_rate: Decimal128,
surge_multiplier: Float,
currency: "EUR"
},
webhook_status: Enum[
"FIRED", "ACCEPTED", "TIMEOUT"
]
}
// Indexes
associated_indent_id: 1
webhook_status + ping_timestamp: compound
users (CONSUMER) ──[places]──→ active_indents ←──[accepts]── users (CHEF)
active_indents ──[triggers]──→ logistics_webhook_routing ──[pings]──→ users (COURIER, kyc: VERIFIED)
// GeoJSON 2dsphere index on users.live_geo_location enables sub-10ms radius queries at scale
04

Platform Operations Hub — Onboarding & KYC Management

PROTOTYPE LOGIC: This console reads live data from the RBAC Simulator via shared localStorage and BroadcastChannel. Open both pages in the same browser, complete any onboarding flow, and data appears here in real-time. KYC approval/rejection broadcasts back to the simulator.
RBAC Simulator: Waiting…
Storage: loading…
Last update:
↗ Open RBAC Simulator
Total Registered
0
Consumers
0
Chefs
0
Couriers
0
KYC Pending
0
KYC Approved
0
Live Indents (DB)
connecting…
⏳ KYC Review Queue Chefs & Couriers only
📋
No pending KYC applications.
Open the RBAC Simulator and complete a Chef or Courier onboarding.
📡 Live Event Log
📡
Waiting for events…
📦 Live Indents Feed
● LIVE
📦
Waiting for live indents from Supabase…
Indents appear here when customers place orders in the RBAC Simulator.
👥 Users Registry
👥
No users registered yet.