A shared product and architecture reference for the team. Every fleet gets its own brand, users, settings and permissions on the same underlying infrastructure.
Architecture, product scope & MVP data · v4.4 review draft · 21 October 2026 · Turkey launch
Design principle: keep order processing dependable while courier locations, live screens and background work scale independently.
This combines Kamal’s Phase 1 and Phase 2 proposal with the shared-platform architecture and operational recommendations. It preserves the proposed AWS/.NET direction: IoT Core/MQTT, Kinesis, Redis/Valkey, Aurora PostgreSQL, SQS and ECS/Fargate. Kamal’s message did not specify or confirm infrastructure vendors; those choices remain an engineering proposal for review.
What changed in v4.4: Extended the MVP Data Reference from eleven additional screenshots, with operational policy fields, readiness, evidence, location review and planned groups. Future fields and policy differences are explicit. The existing architecture, diagrams, product stages and noindex settings are preserved.
Capabilities are grouped by the job they serve. Select a stage to see its scope, then follow a system link to the architectural boundary. This is a proposed scope map, not a completion report or engineering task board.
MVP First real fleetNext After core operationsLater Scale / optimizationNot Planned Revisit only with evidence
Mapping: P0 → MVP, P1 → Next, P2 → Later, CUT → Not Planned. Mixed CUT/P2 items default to Not Planned. Autonomy’s existing commitments take precedence where explained in the priority decisions. Stages express intent, not shipping dates. Architecture coverage does not mean a feature has been implemented.
01
Dispatch
The live control room
MVP
Live dispatch workspace
Map and queues for unassigned, offered and active deliveries; order age, assignment delay, merchant, courier, address, value and payment method.
Tenant, availability, fresh position and capacity checks; distance shortlist, pickup ETA, offer deadlines, safe acceptance and retry after rejection or expiry.
Create/edit/activate couriers, contact/login, tenant membership, eligibility, current load and delivery history; separate enabled, online, available and fresh.
POS/marketplace adapters, webhook/API imports, health and retries; delivery fees, notifications and downloadable reports. Provider access is a prerequisite.
Per-fleet iOS/Android builds and delegated publishing, app/version registry, feature flags, safe API compatibility, optional/required updates and eligible OTA changes.
Source: Ahmed’s supplied “Pasted markdown(1).md” Vimax-informed inventory (37 areas), reviewed against the current Autonomy v4.1 architecture on 15 October 2026. The inventory includes both reference-product observations and Autonomy requirements.
MVP / Shared data reference
MVP Data Reference
The initial information Autonomy needs to operate deliveries.
A shared reference for Ahmed and Kemal to review. These are product data requirements; they do not prescribe database tables or API design. Fields marked “To confirm” remain open pilot decisions.
New screenshot review: staff and assignment audit details extend the MVP records. Operating-policy details, readiness, photo evidence, GPS review and planned groups are labeled by scope below. Read the policy differences and evidence limits →
RequiredNeeded for the initial workflow.
OptionalUseful when available.
When applicableRecord once the relevant event occurs.
To confirmAgree with the pilot team.
Open an entity to see its fields. “When available” denotes optional evidence; identifiers and timestamps may be generated by the system rather than entered by a person.
01Fleet / TenantEach fleet operator is a separate tenant.›
Required
Fleet ID
Fleet name
Account status: active or suspended
Timezone
Default currency
Brand / app display name
Optional
Logo and brand colors
Support phone / email
Fleet ownership connects the records below. A shared backend must keep each fleet’s information separate.
Whether vehicle type or registration plate is needed at launch
Online status, availability, location freshness and workload are separate information. Counts and current assignment can be derived from operational records.
05DeliveriesThe central record connecting a merchant, customer and courier.›
Required
Delivery ID
Human-readable delivery reference
Fleet ID
Merchant ID
Creation source: manual initially
Customer name
Customer phone
Pickup address and coordinates
Drop-off address and coordinates
Order value
Currency
Payment method
Delivery status
Current assignment, when assigned
Created time
Last updated time
Created by
Optional
Merchant’s own order / reference number
Pickup instructions
Customer delivery instructions
Fleet-only internal notes
When applicable
First assignment time
Travel-to-pickup start time
Arrival-at-merchant time
Pickup time
Travel-to-customer start time
Delivery completion time
Cancellation / failure time
Cancellation / failure reason
Completion confirmation method and actor
Pickup and drop-off details are saved as snapshots. Later changes to a merchant’s address must not change existing delivery records. The confirmation method remains to be agreed; recording it does not require every proof option in MVP.
07AssignmentsWhich courier is responsible for a delivery, with previous assignments retained.›
Required
Assignment ID
Fleet ID
Delivery ID
Courier ID
Assignment time
Assignment source: accepted offer or dispatcher action
Assignment status
End time, when applicable
When applicable
Related offer ID
Assigning dispatcher
Release / reassignment reason
Previous assignment reference
When applicable · MVP audit
Dispatch origin: automatic selection or manual selection
Selected / assigned by user or system
Released / reassigned by user or system
Related policy version when a configurable rule was used
Preserve assignment history when a delivery changes courier. The current assignment and previous assignments have different permissions and operational meaning.
08Courier Location and Work SessionInformation used for live maps and dispatch eligibility.›
Required
Fleet ID
Courier ID
Work session ID
Session start time and end time when ended
Latitude and longitude
Location accuracy
Device capture time
Server receipt time
Sequence or equivalent ordering information
Optional
Heading
Speed
To confirm
Location update frequency
When a location becomes stale
Whether historical GPS is needed and how long to retain it
Location collection is limited to the agreed on-duty window. A stored position does not necessarily mean the courier is currently connected. A work session is not a scheduled shift.
09Delivery History and ProblemsWhat happened, who acted, and what needs attention.›
Required
Event / issue ID
Fleet ID
Delivery ID
Event or problem type
Actor: user or system
Timestamp
Relevant status change, for a status-change event
When applicable
Reason or description
Related courier / assignment / offer
Issue status: open / resolved
Resolution
Resolved by
Resolution time
Next · adjustment decisions
Adjustment request reference and requested change type
Old and proposed values; requester and request time
Decision: approved / rejected, decision actor and time
Decision method: manual / automatic, with policy version if automation is approved
Opening an issue does not automatically cancel or fail a delivery. History events and open issues are related concepts, not necessarily one database table.
10Branded Courier Apps and DevicesConnect each fleet’s app and courier devices to the shared platform.›
Required
Fleet ID
App identity
Platform: iOS / Android
Bundle / package identifier
Installed app version / build
Device / installation ID
Linked courier / user
Device registration status
When available
Push notification token
Last device activity
Store app identifier
To confirm
Minimum supported app version
Pilot fleets requiring separate branded store apps
Fleet owners retain their developer accounts. Signing and push credentials are protected backend configuration, never ordinary client-visible data. App configuration and device registrations may be separate records.
11Commercial RecordsConfirm the minimum evidence needed to operate the pilot.›
MVP baseline
Order value: value of the merchant’s goods
Currency
Payment method
To confirm
Merchant delivery charge: what the merchant owes for delivery
Courier compensation: what the courier earns
Payment / collection record: evidence that money actually changed hands
Keep order value, delivery charges, courier compensation and actual collection separate. A payment method is not proof of payment. Charges, compensation and cash-collection evidence are not added to MVP without a confirmed pilot need.
Merchant-category rule reference, if categories are introduced
Whether authorized manual completion can override photo requirements
Courier visibility of dispatch origin, releasing actor and release reason
Adjustment approval mode and eligible request types; automation remains to confirm
To confirm
Whether rules are fleet-wide or allow merchant overrides
Effective time and rule precedence; do not silently change historical decisions
Record the policy applied to an action. Configurable settings screens remain Next; MVP still needs agreed cancellation and tracking rules. Reference-product settings and values are not Autonomy defaults.
13Preparation and ReadinessNext · readiness workflow›
Fields if enabled
Fleet ID, merchant ID and delivery ID
Estimated preparation duration / ready time, with estimate source
Actual ready time and marked-ready actor
Dispatch-eligible time and reason for any hold
Ready-button enabled state, allowed delivery stages and repeat-notification cooldown in seconds
Last ready notification time
Optional rules to confirm
Minimum courier-call delay: duration, unit and reference event
High-value preparation rule enabled state
Order-value threshold and currency
Minimum preparation duration for matching orders
Applied policy version
Keep actual readiness separate from estimated preparation and courier pickup. The reference high-value rule extends preparation without shortening an already longer estimate. Its “minimum courier-call time” setting does not establish a clear unit or starting event in the supplied view. Do not copy its displayed numbers as defaults.
14Pickup and Delivery EvidenceTo confirm for pilot · otherwise Next›
Fields if photos are enabled
Evidence ID, fleet ID, delivery ID and assignment ID
Evidence type: pickup receipt photo or delivery photo
Protected file reference, media type and file size
Uploaded by, capture time if available and server upload time
Upload / validation state
Retention / deletion date under agreed policy
When a rule applies
Required evidence type and minimum photo count
Matched policy version / merchant / payment-method rule
Evidence completion status
Authorized override actor, reason and time
A pickup receipt photo and proof of delivery are different evidence. Keep files private with scoped access and validated uploads. If selected, add scoped uploads, protected access and retention within the existing file-storage boundary; photos are not automatically required for MVP. A photo or receipt does not by itself prove collection of payment.
Permission override status, expiry if used and revocation time
Policy to confirm
Detection enabled state and supported platform behavior
Effect on location publishing and dispatch eligibility
Operator notification status and recovery procedure
The reference describes blocking device-reported mock GPS while flagging implausible jumps for review. These are different signals, not proof of misconduct. Autonomy’s detection reliability and response policy need validation; do not promise universal detection or silently block active work.
Group status: held / waiting / released / cancelled
Release condition: specified time / delay or courier available
Release time / delay and its starting event
Exclusion from ordinary auto-dispatch while held
Released time, releasing actor / system and resulting assignment references
Removal / cancellation actor, time and reason
These are grouped deliveries held for conditional assignment, distinct from a scheduled single order. Removing a delivery returns eligible work to the ordinary pool. Group release must recheck capacity, tenancy and delivery state; it cannot bypass acceptance/assignment controls. Multiple simultaneous jobs remain a separate capacity decision.
Reports derive from the records and timestamps above. State the date range, included records and missing data; a calculated metric does not necessarily need a separate input field.
The eleven supplied screenshots reveal more operational rules, evidence and timing data. Existing MVP records stay in place; the new panels label future or conditional fields explicitly. No infrastructure vendor, new service or automatic scope expansion is approved by this review.
Reference observation
Autonomy treatment
Director / staff directory
Names, contact details and account access already fit Users and Access. Add deactivation audit; keep staff departure dates and scheduled shifts separate. A “Directors” label does not establish a new role or its permissions.
Merchant cancellation
The screenshot allows cancellation only before pickup and within five minutes when enabled. Our detailed handoff proposed waiting-only merchant cancellation. Policy difference to confirm: capture allowed stages and any time window; do not silently adopt either policy or the five-minute value.
Merchant location visibility
The shown setting describes limited detail before pickup. Our MVP already includes merchant tracking for its own active deliveries. Visibility decision: agree stage and precision; preserve existing tracking scope pending review.
Pickup receipt / delivery photos
Separate evidence types. The delivery-photo description matches selected merchant or payment method, with a separate category rule and manual-panel exemption. These are reference behaviors only; Autonomy must agree precedence and any audited override before adopting them.
Automatic approval fragment
Visible text mentions own, undelivered jobs and an automatic-approval history entry, but the heading and full change type are cropped. Keep typed adjustments Next; record decision method if enabled. Do not infer blanket approval rights.
GPS signals / planned baskets
Add separate future review and grouped-dispatch records. Basic location freshness remains MVP. Conditional group release does not establish multi-order capacity or justify another service.
Small controls and limits of the evidence
Table appearance: the screen explicitly says this preference is stored on that device/browser. Keep it a local UI preference; cross-device storage is not an MVP backend requirement.
Unseen-delivery reminders: shown as “Coming soon.” Capability is not established. If adopted later, define viewed/acknowledged time, reminder timing/count and last reminder time; a push-provider response is not evidence of viewing.
“Send test package”: a button is visible, but its payload and effect are not shown. Confirm whether it creates a test delivery or tests notifications before adding data fields.
Release reason visibility: the heading is visible but its explanation is cut off. The underlying actor/reason audit is useful now; the courier-facing display policy remains to confirm.
Evidence: user-supplied Vimax screenshots dated 15 October 2026, covering Settings, Directors, operation settings and readiness/GPS/grouped orders. Field descriptions only; staff names, contact details and screenshots are not republished. UI descriptions indicate intended behavior, not verified backend implementation.
Reference added 20 October 2026 · Extended 21 October 2026 from additional screenshots · Review draft. Customer contact, location and device data follow the data handling boundaries. Individual implementation tasks stay in Trello.
Vimax reference / Autonomy retained
The reference broadens the operational surface without replacing Autonomy’s platform design. There is no verified Vimax-absent capability in the supplied evidence. The inventory mixes visible dashboard features with Autonomy-specific requirements; it is not a complete Vimax product or backend audit. “Not established” below means the evidence is insufficient, not that Vimax lacks it.
Capability
What the supplied reference establishes
Autonomy position
Delivery operations
Dispatch, orders, couriers, merchants, approvals, reporting and finance are reference areas.
Keep the core delivery loop; add grouped scope for operational breadth without committing to the whole inventory.
Multi-tenant fleet platform
Inventory §26 is explicitly an Autonomy requirement; Vimax isolation behavior is not established.
Retained · MVP. Server-enforced tenant/merchant/courier scopes across database, jobs, cache, MQTT and realtime.
Fleet-owned branded courier apps
§27–28 are explicitly Autonomy requirements; Vimax’s account-ownership and release model is not established.
Retained. One app codebase; each fleet owns its developer accounts; separate brand/build identity and delegated publishing.
Order-scoped customer link
No explicit equivalent in this inventory.
Retained · Next proposed, pilot timing open. Expiring and revocable access to one delivery, never the fleet feed.
Separate location and order infrastructure
Realtime UI is represented; underlying Vimax topology is not observable here.
Retained · MVP architecture. MQTT/Kinesis telemetry separate from transactional order commands; stale-data behavior and recovery.
Reliable offer/assignment semantics
Automatic/manual assignment is represented; database transaction semantics are not established.
Retained · MVP. Offers separate from assignment, transactional acceptance, idempotency, late-accept protection and outbox delivery.
Restaurant + courier intelligence
Performance, preparation and optimization are in the inventory; proprietary methods cannot be compared.
Retained · Next/Later. Kamal’s Phase 2 preparation forecasts, fairness, route efficiency, versioned decisions and measured data quality.
Tenant capacity protection
No evidence of Vimax’s resource-isolation controls.
These are reference feature areas, not a requirement to copy all of them.
Commercial calculations Next; accounting Later; radio/review suites Not Planned. Preserve Autonomy’s smaller pilot boundary.
To claim competitive exclusivity later, verify Vimax’s public product documentation or obtain a demonstrated answer about tenancy, app-store ownership, tracking links and recovery guarantees. No such verification is asserted here.
Priority differences and open decisions
These are deliberate resolutions of conflicts between the reference inventory and the existing design. They remain review proposals; no implementation work is marked complete.
Difference
Working scope
Reason / decision still open
Pickup ETA: inventory P1 scoring
MVP: existing pickup ETA where routing is available. Next: richer scoring. Later: prediction.
Preserve the current dispatch v1. Agree the visible fallback if routing is unavailable.
Acceptance rate + merchant map: inventory P1
MVP: basic acceptance metric and merchant tracking already in Phase 1.
Richer analysis, exports and merchant notifications remain Next.
Freshness and idempotency: some inventory P1
MVP: stale-location checks, event deduplication and ordering, reconnect recovery.
Already required to prevent unsafe assignment and misleading maps; do not postpone these safeguards.
Shifts / zones listed broadly in Phase 1
MVP: availability, load and basic permitted service area. Next: scheduled shifts, approved breaks and configurable zone strategies.
Clarify the old broad wording. Agree the initial capacity limit; the pilot can use one active delivery without needing batching.
Reassignment: inventory P1 lifecycle
MVP: safe override/reassignment and failed-offer redispatch. Next: richer exception queues.
Existing manual fallback stays. Allowed transitions and revocation policy need agreement.
White label: inventory P1
MVP: tenant isolation, shared code/config and pilot app identity. Next: repeatable multi-brand release operations.
If the pilot needs a branded store app, its signing, push credentials and fleet-owned account publishing are launch requirements, even before pipeline automation.
Customer tracking + pilot finance
Next proposed: customer link; inclusion in MVP still open. MVP: value/method and agreed minimum commercial records.
Do not remove either existing option. Confirm the fleet’s minimum charging/reconciliation needs before fixing the pilot scope.
A specific launch-required provider would be an explicit scope change; provider availability is not assumed.
Generic domain: inventory P2
Use Merchant and Delivery naming now; Later: new vertical workflows.
Avoid unnecessary restaurant-only schema constraints without building parcel/pharmacy products in the pilot.
Mixed CUT/P2 items
Not Planned: radio, review-management suite and full applicant management. Later: staffing forecasts and operational performance views.
Resolve contradictory mobile-radio labels conservatively. Revisit with fleet demand; no voice/review infrastructure now.
Privacy review: some inventory P1
MVP gate: decide data categories, access, retention and provider/region suitability before real data. Next: configurable self-service workflows.
Future admin UI does not postpone required operational handling. This review makes no legal conclusion about Turkish residency requirements.
Architecture review: keep the topology, extend the contracts
Structural decision: keep the four existing diagrams and the five-branch tree. The four deployable workloads remain Core API, Tracking, Realtime and Background Workers. Add modules and data contracts inside those boundaries; this review does not approve a new vendor, microservice, workflow engine or analytics cluster.
Review finding
Existing coverage
Focused addition
Timing
Core delivery loop
Covered by product panels, lifecycle, dispatch and tracking diagrams.
Make customer/payment fields, searchable operational queries and exact state meanings explicit.
MVP contract clarification
Courier state
Online, availability, assignment and freshness already separated.
Separate enabled/account state, load/capacity and later shift/break approval; avoid one overloaded status enum.
MVP state contract; workforce Next
Permissions and audit
Tenant enforcement, operational events and privileged support access exist.
Specify role/resource scopes, append-only audit entries and type-specific approval permissions.
MVP baseline; approval rules Next
Adjustment workflow
Reasons and exceptions exist; no reusable change-request lifecycle is defined.
TenantBrand/AppRelease registry, per-app credentials, compatible APIs, version policy and controlled flagging.
Pilot identity now; scalable process Next
Turkey data handling
Region selection and retention remain open in v4.1.
Dataset/vendor/region review covering GPS, customer records, logs, backups, maps and push. Revisit AWS topology only if verified requirements demand it.
Production gate, not a claim of compliance
Coverage here means the documentation provides a place for a capability. It is not evidence of running software, passing tests or customer use.
Product-to-system contracts
These extensions refine the existing modules. The linked architecture tree and diagrams still describe how infrastructure connects.
Orders / canonical record
MVP: tenant, merchant, customer/contact, pickup and delivery coordinates/address, instructions, internal notes, amount/currency/payment method, source, version and lifecycle timestamps. Add indexes for tenant + date/status and bounded merchant/courier/customer/address lookup.
Delivery progresses through created/waiting, assigned, en route to pickup, arrived at merchant, picked up, en route to customer, delivered; cancelled and failed are guarded terminal outcomes. JobOffer separately has pending/accepted/rejected/expired/revoked states. A courier rejection is not a failed delivery. Assignment is committed when acceptance succeeds; do not add a second ambiguous “courier accepted” order state.
Persist server-authorized transitions, actor/reason and outbox atomically. Use a generic Merchant/Delivery core; food-specific preparation is an extension. Scheduling is Next, new vertical workflows Later.
MVP: keep account enabled, online intent, connection freshness, availability, assignment ownership and active load/capacity as separate dimensions. Eligibility combines these with tenant and permitted area; “online” alone is insufficient.
Next: shifts, break requests, dedicated/pool mode, vehicles and configurable limits extend this model. A break approval checks current assignments and atomically changes availability; resuming a break must recheck freshness and capacity. Scheduling an employee does not imply they are connected.
Basic service-area eligibility stays in v1; advanced zone strategies and multi-order routing are separate scope.
MVP: tenant-scoped snapshots and paginated API queries power the dispatch map and queues. Enrich rows with age, assignment wait, payment details, ETA and distance; keep offered/unassigned/active work distinct.
Location remains MQTT → Kinesis → tracking workers → Redis + SignalR. Validate identity, capture time and sequence; apply bounded cadence, stale thresholds and recovery. UI updates are hints to reconcile with authoritative versions. Routing is cached/throttled, not requested for every GPS ping.
Search and operational tables start with indexed PostgreSQL queries; no new search cluster.
MVP: platform admin manages tenant lifecycle with audited support access; fleet admin manages its fleet; dispatchers operate permitted fleet deliveries; merchant users see their own merchant; couriers see their own offers/jobs and necessary customer details. Enforce resource ownership on every API, query, realtime subscription, export and background job.
UI permission checks improve usability but never replace server checks. Server-side tenant membership, scoped unique keys and optional row-level defense prevent cross-fleet access. Tenant suspension must revoke operations/subscriptions according to an agreed live-delivery policy.
Use append-only operational audit entries with tenant, entity, action, actor, time, reason, correlation and before/after values when changed. Audit retention/access are separate from the outbox’s delivery lifecycle; purge/redact sensitive content under an explicit policy. Next: accounting/operations roles and type-specific approvals.
MVP: authentication and tenant binding, offers, navigation, pickup/delivery actions, on-duty background location and push hints. Restore active work after restart from the API; locally pending actions are never displayed as server-confirmed.
Use bounded local queues and idempotency keys. Reconnect reloads current order and offer versions; stale acceptance cannot reclaim reassigned work. A device notification is not proof of acceptance. The delivery-confirmation method remains an operational decision; retain the architecture’s button/OTP/photo options without promising all in MVP.
MVP: merchant users create manual requests and see their own orders, courier progress, ETA, history and basic reports. Merchant account access and operational/open status are distinct. Cancellation passes lifecycle and permission checks.
Retain existing merchant live tracking. Preparation events may be captured when reliably available; a full readiness/configuration workflow is Next. Record actual versus estimated preparation separately so restaurant intelligence does not infer cooking time from request creation.
Next proposed; pilot inclusion open. Retain an expiring, revocable, unguessable link scoped to one order. Limit data and live subscriptions to that delivery and end access after the allowed window.
This is a separate audience from authenticated merchants. Never expose the full fleet or unrelated courier jobs. The existing platform diagram deliberately keeps launch timing open.
Next: POS and marketplace providers map into the same canonical order command as manual entry. Store tenant + provider + external order/event IDs with uniqueness; durably record the webhook receipt before acknowledgement and process idempotently.
Keep provider credentials tenant-scoped and secret; verify signatures where supported. Use existing SQS workers, bounded retry, dead-letter handling and visible health. Source provenance belongs in the record now even while all pilot orders are manual.
Yemeksepeti, Trendyol Go and Migros are candidate integrations, conditional on authorized technical/commercial access. Outbound synchronization and self-service configuration are Later.
MVP: record order value/currency/payment method and the minimum agreed pilot fee evidence. Next: separate MerchantCharge from CourierCompensation; use versioned rules, currency-safe monetary values and an explicit rounding policy.
Freeze per-delivery inputs, distance basis, rule version and calculated amounts at the agreed charge milestone. A later rule edit must not rewrite historical earnings. Address/value/payment changes recalculate proposed effects before approval; commit approved financial deltas with the order audit.
Exports and totals are calculations, not proof of payment or settlement. No payment processor is implied by a stored payment method.
MVP: indexed, tenant-bounded PostgreSQL queries/summaries for outcome counts, delivery and assignment duration, courier/merchant counts and basic acceptance rate. Keep the existing metric definitions, sample sizes and missing-data exclusions.
Next: versioned summaries for day-end/utilization/cost/earnings and CSV/Excel exports. Large exports run in existing workers with authorized short-lived file access, tenant checks and retention. Capture event IDs/versions to avoid double counting under retries; invalidate/rebuild affected summaries after corrections.
Keep reporting away from the dispatch critical path. No ClickHouse, warehouse or separate reporting service is required for the pilot.
Next: fair distribution, workload balancing and preparation/courier performance summaries. Later: forecasts, route-efficiency optimization, demand/heatmaps and richer performance-based scoring.
Preserve Restaurant Intelligence and Courier Intelligence. Version scoring inputs/rules, compare against v1 under similar conditions and retain rollback. Distinguish restaurant delays from courier performance; incomplete GPS must not masquerade as precise route analysis.
Machine learning and ClickHouse remain optional scale-driven choices; no new infrastructure solely for P2 items.
MVP: offer, assignment, cancellation and important operational push events from committed state. Route through the correct fleet app’s APNs/FCM identity, with scoped device tokens and safe retry.
Next: authorized dispatcher messages to selected, grouped or active couriers; keep a send/audit record and provider outcome. A provider “accepted” response is not proof that the device displayed or the courier read it.
Later: templates and sounds. Radio/media recording infrastructure is Not Planned.
Later: invoicing, statements, reconciliation, settlement periods and accounting integration. Extend commercial snapshots with explicit receivable/payable entries and append-only corrections; define the ledger model before any balances or real funds rely on it.
Keep operational order value, merchant charge, courier earnings, invoices and actual collection/payout records distinct. Full accounting and automated fund movement do not block the pilot. A payment or tax integration needs its own confirmed scope.
Keep monitoring, crash/error logging, API retries, assignment concurrency controls, outbox, backups and tested restore. Show pending/offline/stale/denied/empty/error states accurately. Bound tenant work so one operator cannot starve others.
Next: incident history, integration-health screens and richer operational service reporting. Agree measurable availability, latency, freshness and recovery targets before production; the architecture does not promise zero failures.
A typed AdjustmentRequest module inside the Core API handles address, order-value and payment-method changes. Store tenant, target entity, request type, requested-by, old/proposed values, reason, metadata, expected entity version, pending/approved/rejected status, created/decided times and decision actor. Break requests can reuse approval mechanics but apply their own courier-state rules.
Request
Capture intent and current version; current order stays unchanged.
Review
Authorize reviewer; recalculate address, ETA, distance and price impacts.
Resolve
Approve atomically or reject with reason; stale versions require a refreshed review.
Publish
Existing outbox delivers committed changes to realtime, reports and notifications.
One approval transaction: verify pending request, tenant, permission, allowed lifecycle and expected version; update business/commercial state; record audit and decision; write outbox. Duplicate approval retries return the prior result. A reject resolves the request and records the decision without changing the order. A conflict never silently overwrites newer data.
Reuse PostgreSQL, outbox and background workers. A generic workflow engine or a separate approval service is unnecessary for this scope.
Confirmed ownership stays unchanged: each fleet owns its Apple Developer / App Store Connect and Google Play Console accounts. Autonomy operates a shared courier-app codebase with fleet-specific builds and delegated publishing access.
Boundary
Design contract
Stage
TenantBrand + app identity
Tenant ID, name/logo/theme, verified web-domain mappings, app bundle/package IDs, store app IDs and references to each fleet’s protected signing/push credentials. Branding and domains never decide membership; authenticated server checks do.
MVP pilot configuration; domain automation Next
Build and publish
Build iOS/Android variants from the same code, bind each artifact to its fleet/account and publish with delegated rights. Keep secrets outside source. Store review and account readiness are dependencies, not guaranteed by this document.
Required for any branded pilot app; repeatable automation Next
AppRelease registry
Track tenant, platform, app identity, app version/build, runtime/API compatibility, release state and supported minimum. Preserve old-client compatibility during staggered fleet adoption.
Minimum compatibility policy MVP; managed registry Next
Controlled changes
Separate deployment from feature activation. Flags are server-evaluated by tenant/capability and do not replace authorization. Use optional updates normally; enforce a required upgrade only with a defined recovery path for active deliveries.
Next; broader canary/staged rollout Later
OTA boundary
Use only for compatible eligible changes within the installed app/runtime and applicable store policy. Native dependency, permission or runtime changes need store builds. Signing, channel isolation, rollback and kill switches need explicit selection.
Next; provider not selected
Shared backend
Per-tenant configuration and compatibility contracts, one underlying backend. Do not create a database, queue stack or deployment copy merely because a fleet has its own logo.
MVP foundation
Privacy / location and hosting decision gate
Before production data: document on-duty GPS purpose/cadence, customer and courier fields, access by role, retention/deletion policy and every receiving service. Review storage, backups, logs/crash reports, mapping/routing, push and external providers—not just the primary database.
Confirm Turkey/KVKK and any applicable transfer/localization requirements with qualified review before choosing regions or enabling the history archive. This update neither establishes that all location data must be stored in Turkey nor asserts that the proposed AWS design is compliant. No hosting topology change is made on an unverified legal assumption.
Keep location collection limited to the agreed operational window, mask unnecessary personal data, protect sensitive access and provide an operational route for required deletion/access requests. Configurable retention and self-service request tooling are Next; any required handling cannot wait for that UI.
If verified requirements conflict with selected managed services or regions, record the conflict and compare compliant hosting options before a structural change. Retention durations and provider selection remain open.
Visual guide to the platform
Read the overview first, then follow the backend, delivery and tracking diagrams. All four are simplified views of the proposed architecture. The detailed rules below remain authoritative where a diagram omits an exception.
On small screens, scroll within each diagram. The diagrams are embedded in this file and work offline.
01
Platform overview
People use role-specific interfaces. Business commands go through the core API; courier movement follows a separate tracking path; live updates reach authorized viewers.
Conceptual view: the after-commit event path is expanded in the backend diagram. The customer tracking link remains an open Phase 1 decision. Autonomy admin uses the same permission-controlled API.
Editable Mermaid source
Copy this source into a Mermaid block in Notion to revise the diagram. The HTML displays an embedded SVG snapshot; regenerate it when the source changes.
flowchart TD
panels["Fleet and restaurant panels · Delivery operations"]
courier["Courier app · Jobs, navigation and location"]
customer["Customer tracking link · One order; pilot timing open"]
api["Core API · .NET · Permissions, orders and dispatch"]
tracking["Location pipeline · IoT Core, Kinesis and workers"]
db["PostgreSQL · Official order and assignment state"]
live["Realtime gateway · SignalR · Authorized updates and freshness"]
panels -->|"Commands"| api
courier -->|"Accept / reject"| api
courier -->|"GPS"| tracking
api -->|"Commit business state"| db
api -->|"After-commit events"| live
tracking -->|"Location updates"| live
live -->|"Live view"| customer
live -->|"Live view"| panels
02
Backend infrastructure
The API commits official state and an outbox event together. Background workers process retriable side effects; the realtime gateway maintains live viewer connections.
Core API, realtime gateway, tracking workers and background workers are independently deployable ECS/Fargate workloads. The outbox relay is part of the background workload. Deploy production across at least two Availability Zones; keep database/cache private. The tracking workload is expanded separately below. Arrows show logical flow, not a complete network or failover diagram.
Editable Mermaid source
Copy this source into a Mermaid block in Notion to revise the diagram. The HTML displays an embedded SVG snapshot; regenerate it when the source changes.
flowchart TD
clients["Web and mobile clients"]
ingress["WAF + Application Load Balancer · Public HTTPS and SignalR"]
api["Core API · .NET · Orders, offers and dispatch"]
live["Realtime gateway · .NET · Authorized SignalR subscriptions"]
db["Aurora PostgreSQL · Business state + transactional outbox"]
relay["Outbox relay · Background workload"]
cache["Redis / Valkey · SignalR backplane"]
queue["SQS queues · Retries and dead-letter handling"]
jobs["Background workers · .NET · Notifications, integrations and timers"]
clients --> ingress
ingress -->|"HTTPS commands"| api
ingress -->|"Live connections"| live
api -->|"One transaction"| db
db -->|"Read"| relay
relay -->|"Publish committed events"| queue
queue -->|"Consume safely under retries"| jobs
jobs -->|"Committed-state updates"| live
live -->|"Cross-instance fan-out"| cache
03
One delivery: offers, assignment and completion
An offer reserves an opportunity to accept; the assignment becomes official only after the server validates and commits acceptance.
Simplified flow, not the full state machine. Invalid or late acceptance returns a conflict and refreshes current state. A dispatcher may assign/reassign only through the same tenant, capacity and concurrency controls, revoking obsolete offers. Cancellation/failure applies only where the lifecycle permits it; record reason and actor. Sequential offers remain a proposal.
Editable Mermaid source
Copy this source into a Mermaid block in Notion to revise the diagram. The HTML displays an embedded SVG snapshot; regenerate it when the source changes.
flowchart TD
request["Delivery requested"]
eligible["Find and rank eligible couriers · Fleet, service area, freshness, capacity"]
offer["Pending offer · Deadline; not yet an assignment"]
retry["Reject or expire · Next candidate within retry limits"]
manual["Dispatcher intervention · No candidates or limits reached"]
commit["Validate and commit assignment · Valid offer + capacity + concurrency"]
pickup["Restaurant arrival → pickup · Record milestones"]
done["Delivery confirmed"]
failure["Cancelled / failed · Permitted transition + reason"]
request --> eligible
eligible -->|"Candidate found"| offer
offer -->|"Accept while valid"| commit
offer -->|"Reject / timeout"| retry
retry -->|"Try next candidate"| eligible
retry -->|"No candidate / limit"| manual
manual --> eligible
eligible -->|"None eligible"| manual
commit -->|"Assigned work"| pickup
pickup -->|"Travel + proof"| done
request -->|"Allowed cancellation"| failure
pickup --> failure
04
Live courier tracking
High-frequency GPS updates travel independently from order commands. Current locations drive live maps, while retained history follows a separate archive branch.
Late or duplicate GPS events cannot overwrite newer positions. Stream lag or a disconnected courier must produce a stale-location indicator. Redis is derived state; PostgreSQL remains authoritative for orders. On reconnect, clients refresh authorized snapshots. Archive availability is not a dependency of live display.
Editable Mermaid source
Copy this source into a Mermaid block in Notion to revise the diagram. The HTML displays an embedded SVG snapshot; regenerate it when the source changes.
01Products people useThe visible experience for each participant›
Fleet owner & dispatcher panel Phase 1
Manage restaurants, couriers, automatic offers, manual assignments, reassignments and delivery exceptions. Review live fleet activity and basic reports.
Engineering detail
React web application. HTTPS API for commands and snapshots; authorized SignalR subscriptions for updates. Dispatch actions require server validation and concurrency checks. Show offered, accepted, expired and unassigned work separately.
Restaurant panel Phase 1
Create delivery requests manually, manage orders, track couriers, receive status updates and view basic reports. Capture food-ready status when available.
Engineering detail
Restrict access by tenant and restaurant membership. Share UI components and API contracts while preserving role-specific capabilities. Manual entry is the MVP baseline; external order import is a separate scope decision. Record operational timestamps needed for later preparation-time analysis.
Courier app Phase 1
Go online/offline, accept or reject job offers, navigate to pickup and drop-off, share location while on duty and confirm delivery.
Engineering detail
Shared React Native codebase and backend, with tenant branding/build configuration. Use HTTPS for order commands, MQTT for telemetry and APNs/FCM for push hints. Distinguish online, available and busy; an online flag alone does not prove fresh connectivity. Persist pending commands and a bounded location buffer locally. Reconcile expired offers after reconnect. Test background tracking on real devices. Confirm whether navigation opens an external map app and whether completion needs a button, OTP, photo or another agreed method.
Customer tracking link Decision
Show one delivery’s progress, estimated arrival and permitted courier location. Part of the intended product; decide its Phase 1 inclusion.
Engineering detail
Expiring, revocable, unguessable access token scoped to one order. Restrict every snapshot and live subscription. End tracking access after the permitted delivery window; never expose a fleet feed.
Autonomy admin Phase 1 · basic
Onboard fleet companies, configure branding, manage access and investigate incidents.
Engineering detail
Privileged roles, strong administrator authentication and audited support access. Shared deployment with configuration per tenant; no copied backend per brand. Confirmed account ownership: each fleet owner owns its Apple Developer / App Store Connect account and its Google Play Console developer account. Autonomy uses the shared courier codebase with fleet-specific configuration and branding. Pilot brands and release-provider choices remain open. The white-label release contract now defines the proposed account, identity, compatibility and rollout boundaries.
02Delivery operationsThe business rules and official delivery state›
Companies, users & permissions Phase 1
Define who belongs to each fleet and what each person can see or change. Tenant separation applies from the first pilot.
Engineering detail
ASP.NET Core authorization using a managed OpenID Connect identity provider; provider selection is still open. Resolve tenant membership on the server. Enforce it in queries, writes, MQTT policies, live groups, jobs and file access. Include tenant scope in uniqueness constraints and cache keys; add database row-level security as defense in depth.
Track delivery requests through assignment, pickup, completion, cancellation and failure, with an operational event history.
Engineering detail
Explicit state machine in a modular .NET application. Model job offers separately from committed assignments. Persist state transitions and pending events in one PostgreSQL transaction. Use idempotency keys and version checks. Record reasons for rejection, reassignment, cancellation and failure without allowing late device events to overwrite newer server state.
Check courier availability, shortlist by distance, rank by estimated time to pickup, offer the job and handle rejection or timeout. Provide manual assignment and override.
Engineering detail
Filter candidates by tenant, permitted service area, fresh location/connectivity and configured capacity. Use distance for candidate shortlisting and a routing estimate for pickup ETA where available. Record offers with deadlines and status. Commit acceptance atomically in PostgreSQL; Redis is only a candidate lookup. Proposed baseline: one courier offer at a time, then try the next candidate, with a dispatcher fallback. Confirm offer policy, timeout, workload limits and stale-location threshold with operations.
Courier & restaurant management Phase 1
Manage fleet membership, restaurant access, courier online/offline status, availability, current load and basic permitted service areas. Scheduled shifts, break approvals and configurable zone strategies are Next; see courier-state contract.
Engineering detail
Keep business availability and assignment ownership in PostgreSQL. Track connection freshness separately. A courier can be online but busy, or appear online with an expired heartbeat; neither automatically makes them eligible for a new offer.
Dispatch Engine v2 Phase 2
Add courier scoring, better ETA prediction, workload balancing, fair job distribution and courier performance scoring.
Engineering detail
Consume restaurant and courier intelligence from recorded operations. Keep eligibility constraints and tenant boundaries ahead of ranking. Version scoring rules and record decision inputs so assignments can be explained. Define fairness and performance criteria with operations; account for restaurant delays and connectivity failures. Phase 2 extends the dispatch module and does not automatically require a new microservice or an ML model.
Delivery fees & reconciliation Decision
Record delivery charges and provide fleet reconciliation if required to operate the pilot.
Engineering detail
Confirm the minimum commercial records needed for Phase 1. Keep fee rules and tenant settings as separate modules. Full payment collection, accounting and automated settlement require their own confirmed scope.
Address, value and payment-method changes share a typed request and permission-checked decision flow.
Engineering detail
Run inside the existing Core API. Approve against an expected entity version; save the change, request decision, audit and outbox in one transaction. A rejection does not mutate the order. Full adjustment contract.
Notify couriers of offers and status changes; support mapping/routing. External order integrations have a separate rollout decision.
Engineering detail
Use provider adapters. Where order integrations are approved, validate webhook signatures where supported and durably record events before acknowledging them. Deduplicate by tenant, provider and event/order ID. Use timeouts, bounded retries and dead-letter queues. A push notification prompts a refresh; it is not assignment acceptance.
03Live delivery & background workMovement, live updates and work that can retry›
Receive courier locations · AWS IoT Core / MQTT
Accept frequent movement updates from authenticated courier devices.
Engineering detail
Authorize the specific tenant/courier topic from trusted identity, not a client-supplied tenant ID. Use scoped, revocable credentials. Include event ID, device session, sequence and capture time. Choose QoS and cadence explicitly. AWS supports QoS 0 and 1; duplicate handling is required. [1]
Buffer & process locations · Kinesis + tracking workers
Absorb bursts, validate positions and update each courier’s latest known location.
Engineering detail
IoT rule writes to Kinesis; partition by tenant plus courier. Configure rule error handling and alarms, consumer checkpoints and bounded replay retention. Reject stale/duplicate updates before replacing current state. A broker acknowledgement is not proof of downstream processing. Track end-to-end lag. [2]
Update live screens · SignalR / WebSockets
Send relevant changes to dispatchers, restaurants and individual tracking pages.
Engineering detail
Separate .NET realtime deployment, with a Redis backplane to distribute updates across gateway instances. Scope groups server-side. Configure load-balancer affinity unless all clients meet Microsoft’s WebSockets-only/SkipNegotiation exception. Push is transient: clients reload an authoritative snapshot after reconnect. [3]
Retry background work · SQS + .NET workers
Deliver notifications, synchronize providers and process non-interactive jobs.
Engineering detail
Relay committed outbox events to queues. Assume redelivery and make every side effect idempotent. Use separate queues/consumer pools for unrelated workloads; one shared queue is not broadcast. Add dead-letter alerts and a reviewed replay procedure. [4]
04Data, reporting & intelligenceCapture evidence in Phase 1; improve decisions in Phase 2›
Business records · Aurora PostgreSQL Launch
The source of truth for tenants, orders, assignments, fee records and delivery history.
Engineering detail
Use a writer plus a failover-capable reader in a different Availability Zone for production. Configure backups and point-in-time recovery; rehearse restore and failover. Aurora’s replicated storage alone does not replace a ready database failover instance. [5]
Latest locations & cache · Redis / Valkey Launch
Fast access to the current map state and recent courier heartbeats.
Engineering detail
Managed ElastiCache with replication/failover. Values have age/expiry and tenant scope. Rebuild location state from the stream where retained, or fresh device updates. Capacity-isolate cache and realtime workloads as needed. Redis failure must not invalidate committed orders.
Files & retained history · S3 Launch
Store permitted delivery evidence, exports and an explicitly retained location archive.
Engineering detail
Private objects with authorized short-lived access. Apply retention/lifecycle rules and tenant access checks. A consumer can batch history to S3; Firehose/Parquet is the planned managed archive option. Size storage from actual update rates and agreed retention.
Operational events & basic reporting Phase 1
Record offer outcomes, delivery milestones and available preparation events. Report delivery time and acceptance rate from the first pilot.
Engineering detail
Store tenant, order, courier/restaurant, event ID, actor/source, server receipt time, observed time where relevant, version and reason. Preserve each offer’s identity. Distinguish measured from estimated timestamps. Start with indexed, bounded queries and summaries in PostgreSQL; telemetry remains on the tracking pipeline.
Calculate average preparation time, detect delays, report restaurant performance and forecast preparation time.
Engineering detail
Use preparation-start and food-ready events where captured. A delivery request is not evidence that cooking started. Track courier arrival and pickup separately to measure pickup waiting. Show missing-data coverage and estimate quality. Feed forecasts into dispatch timing and customer ETA without blocking core order processing.
Courier Intelligence Phase 2
Monitor acceptance rates, delivery performance and route efficiency; provide inputs to workload balancing and scoring.
Engineering detail
Build on Phase 1 offer outcomes and milestones plus permitted, sufficiently complete route history. Define comparison groups by operating conditions and service area. Separate courier travel from restaurant waiting and flag incomplete GPS traces. Basic acceptance reporting starts in Phase 1; richer analysis and use in dispatch are Phase 2.
Large-scale analytics · ClickHouse Cloud When justified
Support larger historical datasets and more demanding fleet analysis as volume grows.
Engineering detail
Feed analytics asynchronously. Keep analytical queries outside the dispatch critical path. Phase 2 intelligence can begin with PostgreSQL summaries; ClickHouse and the full archive pipeline are scale-driven choices, not mandatory prerequisites for Phase 2.
05Hosting, security & reliabilityThe foundation beneath every branch›
Run & expose the platform
Host the web panels and keep the backend available across separate failure zones.
Engineering detail
CloudFront + S3 for static web assets. WAF + Application Load Balancer for public HTTPS/SignalR traffic. ECS/Fargate tasks in private subnets across at least two AZs; databases/cache private. IoT Core has its own authenticated managed endpoint. Plan redundant outbound access for provider calls. Choose the AWS region after latency, service-availability and data-handling requirements are confirmed.
Alert on lost orders, stale tracking, growing queues, latency and failing dependencies.
Engineering detail
CloudWatch, OpenTelemetry and Sentry with correlation IDs, structured logs and tenant-safe diagnostics. Monitor API availability, GPS freshness, ingestion failures, stream lag, outbox/queue age, dead-letter counts and database saturation. Define a named responder and escalation route.
Deploy & recover safely
Release changes gradually and recover with a documented, rehearsed procedure.
Engineering detail
Terraform and CI/CD, isolated staging, backward-compatible database migrations, health checks and rollback. Keep secrets in Secrets Manager and use least-privilege service roles. Agree recovery-time and data-loss objectives; rehearse backup restoration and database failover.
Protect shared capacity
A busy fleet must not consume all capacity needed by other companies.
Engineering detail
Tenant rate limits, fair job processing and bounded concurrency. Scale the core API, telemetry consumers, realtime gateway and background workers independently. Exercise tenant isolation and mixed peak workloads before expanding the live fleet.
One architecture, two delivery phases
These retain Kamal’s original strategic phases. The new scope map adds release granularity: MVP is the core pilot; Next includes operational extensions and early Phase 2 capabilities; Later includes advanced prediction and scale. Phase 2 is not a commitment to ship every optimization together.
The fleet company is the primary customer and tenant. Its restaurants and couriers are the operating participants. The MVP should validate fleet-operator adoption alongside restaurant demand and courier availability.
Phase 1 · Core Delivery Platform
Goal: validate that fleet operators can reliably run real deliveries for restaurants using available couriers.
Restaurant portal: manual delivery requests, order dashboard, courier tracking, status updates and basic reporting.
Courier app: online/offline, accept/reject, navigation support, live location and delivery confirmation.
Kamal’s pilot targets: first 10–20 restaurants and 50–100 active couriers. Track average delivery time and courier acceptance rate.
Also measure fleet adoption and continued use. Agree the number of pilot fleet companies and the meaning of “active”; 50–100 active couriers does not automatically mean 50–100 simultaneous connections.
Phase 2 · Intelligent Dispatching
Goal: reduce delivery time, courier waiting and courier idle time while improving completion.
Smart dispatch: courier scoring, improved ETA prediction, workload balancing, fair job distribution and courier performance scoring.
Restaurant intelligence: average preparation time, delay detection, performance analytics and preparation-time forecasting.
Courier intelligence: acceptance monitoring, delivery performance and route efficiency analysis.
Kamal’s success measures: reduced courier waiting time, improved delivery completion rate and improved average delivery duration.
Compare against the Phase 1 baseline under similar restaurants, service areas and operating hours. Set improvement targets after the baseline is measured. Phase 2 does not require ClickHouse or machine learning by default.
Phase boundary: basic automatic dispatch belongs in Phase 1. Data-informed scoring, forecasting and richer balancing belong in Phase 2. Event capture begins in Phase 1 so Phase 2 has usable evidence.
Additional scope
Combined recommendation
Decision still needed
Fleet panel & tenant boundaries
Include in Phase 1; essential to the shared fleet-software product
Pilot fleet count, roles, membership and service areas
White-label releases
Use one codebase with company configuration and branding
Which tenant brands and mobile release channels the pilot needs
Customer tracking link
Retain in architecture; keep a defined, order-scoped implementation
Whether it must launch in Phase 1
Fees & reconciliation
Include only the commercial records required to run the pilot
What the fleet needs to charge or reconcile; payment processing is separate scope
External order integrations
Keep adapter boundaries; manual entry is the Phase 1 baseline
Required providers, authorized access and rollout dates
Dispatch v1: make the offer lifecycle explicit
Proposed starting policy: offer a job to one eligible courier at a time. If rejected or expired, try the next eligible candidate; escalate unassigned work to the dispatcher. This policy is a recommendation for operations review, not a rule specified in Kamal’s message.
Step
Expected behavior
Guardrail
1 · Filter
Find couriers in the correct fleet and permitted service area, with fresh location and available capacity
Online, connected and available are different states; enforce each required condition
2 · Rank
Shortlist by distance and rank using estimated travel time to pickup where available
Define what happens when routing is unavailable; expose the fallback to the dispatcher
3 · Offer
Create a pending offer with a deadline and notify the selected courier
An offer is not a committed assignment; push receipt is not acceptance
4 · Accept
Courier submits acceptance; server checks offer validity, order state and courier capacity before committing
Use an atomic transaction, idempotency key and concurrency control; a late acceptance must not steal a reassigned job
5 · Reject / expire
Record the outcome and try the next candidate within agreed retry rules
Handle withdrawn offers separately from courier rejection or timeout
6 · Override / escalate
Dispatcher can assign or reassign permitted work and resolve unassigned jobs
Revoke obsolete offers, record the reason and inform affected clients; preserve tenant and capacity rules
Confirm the acceptance deadline, retry/escalation limits, sequential versus broadcast offers, courier workload limits and stale-location threshold. The initial capacity policy must explicitly say whether a courier can carry multiple jobs. Phase 2 scoring should reuse these offer and assignment controls.
ETA terminology: Phase 1 selection uses estimated travel time to the restaurant. A customer’s delivery ETA also includes remaining preparation, waiting/handling and travel to drop-off. Phase 2 can improve these estimates using observed history; record the estimate shown and its timestamp to evaluate accuracy later.
How information moves
When an order changes
Reliable business transactions
Restaurant, dispatcher or courierSends an authorized command over HTTPS
.NET core APIValidates permissions, order state and conflicts
Aurora PostgreSQLSaves the change and its pending event in one transaction
Outbox relay → SQS workersRetries notifications and provider synchronization safely
Live update / push notificationPrompts clients to display or fetch the committed state
The API confirms a command only after commit. Push delivery is not proof that the courier accepted a job.
When a courier moves
Frequent location telemetry
Courier app → IoT CorePublishes an authenticated MQTT location event
IoT rule → KinesisBuffers events for processing within configured retention
Tracking workerValidates age/order, updates Redis and emits live changes
SignalR gateway → permitted viewersShows the latest position and its freshness
Historical branch → S3Separate consumer; analytics can be added later
The archive is a separate branch from the stream, not a dependency of showing a live position. Routing/ETA requests are cached and throttled rather than called for every GPS ping.
Important distinction: MQTT carries location messages; SignalR updates viewing clients. MQTT can itself run over WebSockets. The separation is about workload and responsibility, not a claim that the two protocols are mutually exclusive. [1]
Collect Phase 2 evidence during Phase 1
The event timeline supports both recovery and measurement. Record the business outcome once, then derive reports from those events. GPS telemetry remains a separate stream.
Event family
Capture in Phase 1
What it supports
Request & job offers
Delivery requested; offer created, accepted, rejected, expired or revoked; assignment committed or changed
Assignment delay, acceptance rate, dispatch retries and fair-distribution analysis
Pickup & completion
Courier arrived at restaurant, picked up, optionally arrived at drop-off, and delivery confirmed
Pickup waiting, travel time, delivery duration and completion evidence
Restaurant preparation
Preparation started and food ready, where the restaurant can reliably supply them; identify actual versus estimated times
Preparation duration, delay detection and forecasting. Do not substitute request creation for cooking start
Exceptions
Cancellation, failed delivery, reassignment, unavailable courier and integration failure, with reason and actor
Completion rates, operational diagnosis and recovery
Availability & movement
Online/offline, available/busy, on-duty sessions, heartbeat freshness and permitted GPS history under an agreed retention policy; scheduled shift records when the Next workforce module is enabled
Idle time, candidate eligibility, workload analysis and route efficiency
Common fields: tenant, entity IDs, event/offer ID, actor/source, business version, server receipt time, device-observed time where needed, and reason. Validate timestamps and state transitions; offline observations cannot blindly replace current state. Track missing events and GPS gaps instead of presenting incomplete measurements as precise results.
Measure the pilot before optimizing it
Measure
Initial definition
Phase / target
Restaurant onboarding
Record onboarded restaurants and distinguish those creating real delivery requests
Phase 1: 10–20 onboarded restaurants; report actual usage
Active couriers
Couriers meeting an agreed activity definition in a defined period; report peak simultaneously connected couriers separately
Phase 1: 50–100 active couriers; window and activity definition to agree
Fleet adoption
Fleet companies onboarded, running real deliveries and continuing to use the platform across the pilot period
Phase 1 addition: agree fleet count and evaluation window
Average delivery duration
Delivered time minus delivery-request time for completed orders; separately show pickup-to-delivery duration and incomplete/cancelled counts
Phase 1 baseline; Phase 2 improvement
Courier acceptance rate
Accepted offers divided by accepted + rejected + expired valid offers; deduplicate by offer ID and exclude revoked offers
Phase 1 basic tracking; Phase 2 analysis. Report delivery/connectivity issues separately when known
Courier pickup waiting
Pickup time minus arrival-at-restaurant time, where both events are valid
Phase 1 capture; Phase 2 reduction. This can include handling time as well as restaurant delay
Delivery completion rate
Delivered orders divided by delivered + failed + cancelled orders in a consistently defined, resolved cohort; report still-open orders separately
Time eligible and available without an active assignment during the measured shift, excluding offline or stale periods
Phase 1 state capture; Phase 2 reduction
These metric definitions are proposed for agreement with operations. Keep denominators, time windows and data-quality exclusions consistent. Report averages alongside a tail measure such as the 90th percentile, sample counts and capture coverage so averages do not hide long delays or missing events.
What to deploy first
Use one repository if convenient, with four independently deployable .NET workloads. Begin with clearly separated modules inside the core application; split a module into a service only when there is a concrete scaling or ownership reason.
Deployment
Responsibility
Scale based on
Core API
Tenant access, orders, dispatch, restaurants, couriers and configuration
Request latency, concurrency and database capacity
Tracking workers
Consume Kinesis and maintain current location state
Stream lag and incoming event rate
Realtime gateway
Maintain SignalR connections and authorized live feeds
Concurrent connections and fan-out volume
Background workers
Relay outbox events and process queue-based side effects
Oldest job age, queue depth and provider limits
Size the pilot from measured concurrent usage and an agreed peak-load test; the longer-term thousands-of-couriers goal is a scale target, not a pilot traffic assumption. Basic dispatch runs in the core application with durable timers/jobs where needed. The AWS baseline uses Kinesis; Redpanda/Kafka belongs to the alternative hosting design. Kubernetes, active-active regions, Phase 2 optimization and ClickHouse are outside the initial launch baseline.
Bounded local storage, retry with idempotency keys, reconcile against server state on reconnect; no false confirmation of acceptance
Tracking pipeline lags
Stale location warning; order operations remain available if their dependencies are healthy
Alert on lag, scale consumers, replay within retention and prevent old events replacing newer positions
Redis / live connection fails
Map marked stale; order details recover from the API
Reconnect, reload snapshots, rebuild derived state and use controlled polling for order status
Provider or push service fails
Integration delay visible; existing committed jobs remain accessible
Retry asynchronously, alert and expose a manual workflow; do not assume a background courier receives a push
Database writer fails
Some commands temporarily unavailable or pending
Promote the replica, reconnect, retry safely and reconcile uncertain requests; never claim an uncommitted order succeeded
Roles, responsibilities and engineering review
This retained section describes team functions and decision handoffs. It does not assign individual features or implementation tasks; those stay in Trello.
Working functional titles from the 28 September 2026 role discussion, included as a review draft. Ahmed and Barış both contribute to strategy. These labels describe areas of contribution; detailed handoffs below are proposals for the team to correct.
Person
Working title
Scope
Technical-document responsibilities
Ahmed
Product, Strategy & Frontend
Product direction, company strategy, frontend engineering and the overall product experience.
Own the web/mobile experience, UX flows, client state, offline/pending/stale UI and frontend telemetry. Translate customer needs into product priorities and acceptance criteria; maintain the document with the team.
Kamal
Backend, Infrastructure & Reliability
Backend engineering, infrastructure, reliability and scalability.
Own backend modules, dispatch implementation, data models, tenant/security controls, cloud deployments, observability, capacity planning and recovery procedures. Bring feasibility, reliability risks and operating-cost tradeoffs into product decisions.
Barış
Business Development, Customer Relations & Strategy
Business relationships, customer development, partnerships, market strategy and growth.
Bring fleet and restaurant needs into planning, coordinate customer feedback and pilot relationships, and help validate priorities and rollout readiness with the people operating deliveries.
Operational rules—service areas, courier capacity, preparation milestones, exceptions and pilot acceptance—need review with actual fleet operators and dispatchers. Barış contributes customer and market context; this does not make him the sole source of operational rules. Agree incident coverage explicitly; backend ownership does not establish round-the-clock staffing.
How the responsibilities meet
Decision / handoff
Working arrangement for review
Product behavior and UX
Ahmed leads the product proposal; Kamal reviews backend feasibility and reliability; Barış supplies customer and market context.
API, event and realtime contracts
Ahmed and Kamal agree request/response shapes, event meanings, permissions, retries and pending/stale behavior before implementation.
Dispatch and metrics
Kamal implements the backend rules; Ahmed defines the operator experience; Barış and pilot operators validate business needs. Agree scoring, fairness and metric definitions together.
Release readiness and incidents
Ahmed checks client journeys and compatibility; Kamal checks deployment, monitoring and recovery; Barış coordinates customer readiness. Name incident responders and escalation separately.
Functional ownership
Ahmed: Product, Strategy & Frontend.
Kamal: Backend, Infrastructure & Reliability.
Barış: Business Development, Customer Relations & Strategy.
Working titles; detailed scope and shared handoffs appear above. Product, engineering and customer knowledge meet in shared decisions.
A sizing example, not a benchmark: 3,000 active couriers updating every 5 seconds produce 600 location events/second before retries. Load tests must also include reconnect bursts, multiple viewers per courier and simultaneous order actions.
Before real pilot use: demonstrate the complete request → offer → acceptance → pickup → delivery flow; rejection/expiry with reassignment; manual override; cancellation/failure; offline recovery; tenant isolation; and working alerts and backup restoration.
Before pilot expansion: demonstrate that simultaneous accept attempts cannot create conflicting assignments; late acceptance cannot reclaim reassigned work; duplicate requests cannot create duplicate orders; tracking degradation does not exhaust core API resources; and the system meets agreed latency/freshness targets under the pilot peak and reconnect bursts.
Before Phase 2 rollout: confirm usable event coverage and a stable Phase 1 baseline. Compare versioned dispatch changes with the baseline and retain a switch back to v1. Kamal’s onboarding counts are adoption targets, not a substitute for operational readiness.
Review and update this documentation
This site is now v4.4. The Notion architecture page was not updated in this review; parity with v4.4 has not been verified. These are maintained copies, not an automatic sync. Product scope belongs here; Trello remains the place for individual implementation tasks, owners and delivery evidence.
Comment in Notion or record feedback in Trello with the section or diagram name.
Keep suggested changes marked Proposed until the relevant people agree.
Update the affected text and diagram in both versions, then record the same version/date and decision.
Use Trello for implementation owners, acceptance criteria and delivery evidence.
Working titles and responsibility boundaries are open for correction. A title does not establish equity, employment terms or incident coverage.
Change log
v4.4 · 21 October 2026: Reviewed eleven additional Vimax screenshots. Extended user/assignment audit and future adjustment data; added five scoped data panels for operating policies, readiness, evidence, location integrity and planned groups. Flagged cancellation/tracking policy differences and incomplete evidence. Preserved feature priorities, diagrams, tenant/app ownership and noindex. Notion not synchronized.
v4.3 · 20 October 2026: Added a browsable MVP Data Reference after the Feature Map: eleven data areas, field requirement labels, open pilot questions and derived reporting. Preserved existing architecture, diagrams and noindex metadata. This reference does not prescribe database tables or API contracts. Notion not synchronized.
v4.2 · 15 October 2026: Added the eight-area Product Scope / Feature Map, four scope stages, Vimax evidence comparison, priority conflicts and module contracts. Preserved all four existing diagrams and the five-branch architecture; clarified shifts versus MVP availability, retained existing MVP safeguards and defined the branded-app release boundary. No infrastructure vendor or new service approved; Notion not synchronized.
v4.1 · 29 September 2026: Ahmed confirmed that each fleet owner owns its Apple and Google developer accounts. Aligned HTML and Notion. The detailed publishing and update workflow remains open.
Version / date
Change
Status
v2 · 27 September 2026
Combined Phase 1/2 roadmap, dispatch, metrics and reliability.
Architecture proposal
v3 · 28 September 2026
Notion adaptation with decision register and feedback workflow.
Review draft
v4 · 29 September 2026
Four diagrams plus functional titles, role context and shared handoffs added to HTML and Notion.