Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
translate ▾

Modern-Apps.git / fooddelivery / AGENTS.md

AGENTS.md4.8 KiBRenderedCodeRaw
1# AGENTS.md — fooddelivery/ (':fooddelivery')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `fooddelivery/` + allowed shared modules. Do not root-scan.
4
5_Install: ./install fooddelivery (dev by default)._
6- Gradle: :fooddelivery / dir: fooddelivery/
7- Package roots present: ui, data, platform, intents, notifications
8- Entry files: MainActivity.kt + FoodDeliveryApplication.kt + platform/AppInit.kt + Route.kt + Navigation.kt (tab routes + detail/dialog routes)
9- Deps: :library:image, :library:map, :library:network
10- Metadata: metadata_data/fooddelivery.md (present)
11- Rust: no / screenshotTest: yes
12
13## Overview
14**Purpose:** US-only food-delivery client — restaurant browse, cart + Stripe checkout (pickup/delivery, tips, promos), live order tracking, deals/loyalty. Requires internet throughout.
15**Key features:**
16- Home/deals → restaurant → cart → checkout → success flow with modifier dialogs and totals; account addresses/auth/profile
17- `data/CartStore` + `AddressStore` client state over `api/BitesApi`; order tracking in `notifications/` (live update + foreground tracking service)
18- Assistant order lookup via `intents/OrderLookupIntent` (+ `ipc/OrderLookupContract`)
19**Architecture / data-flow:** `ui/` flow screens → `platform/AppInit`-wired state (`data/CartStore`) → `api/BitesApi` backend; tracking runs in `notifications/OrderTrackingService` independent of the UI process.
20**Entry points + reading order:** `FoodDeliveryApplication.kt` → `platform/AppInit.kt` → `MainActivity.kt` → `ui/HomeScreen.kt` → `ui/RestaurantScreen.kt` → `ui/CartScreen.kt` → `ui/CheckoutScreen.kt` → `api/BitesApi.kt`.
21**Gotchas:**
22- `api/` and `ipc/` are NOT closed package roots — don't add more files there
23- Payment data goes straight to Stripe tokenization — card numbers must never hit app state or logs
24- Tracking must survive the app being killed; keep it in the service, not the ViewModel
25
26## Key files
27### Root + platform/ — app init + entry (no Route.kt)
28- com/vayunmathur/fooddelivery/FoodDeliveryApplication.kt
29- com/vayunmathur/fooddelivery/MainActivity.kt
30- com/vayunmathur/fooddelivery/platform/AppInit.kt
31### api/ — backend client
32- com/vayunmathur/fooddelivery/api/BitesApi.kt
33### data/ — cart, addresses, models
34- com/vayunmathur/fooddelivery/data/CartStore.kt
35- com/vayunmathur/fooddelivery/data/AddressStore.kt
36- com/vayunmathur/fooddelivery/data/Models.kt
37### intents/ + ipc/ — assistant lookup contract
38- com/vayunmathur/fooddelivery/intents/OrderLookupIntent.kt
39- com/vayunmathur/fooddelivery/ipc/OrderLookupContract.kt
40### notifications/ — live tracking
41- com/vayunmathur/fooddelivery/notifications/OrderTrackingService.kt
42- com/vayunmathur/fooddelivery/notifications/OrderLiveUpdate.kt
43### ui/ — browse, cart, checkout, orders, account
44- com/vayunmathur/fooddelivery/ui/HomeScreen.kt
45- com/vayunmathur/fooddelivery/ui/DealsScreen.kt
46- com/vayunmathur/fooddelivery/ui/RestaurantScreen.kt
47- com/vayunmathur/fooddelivery/ui/RestaurantSections.kt
48- com/vayunmathur/fooddelivery/ui/dialogs/ModifierDialog.kt
49- com/vayunmathur/fooddelivery/ui/CartScreen.kt
50- com/vayunmathur/fooddelivery/ui/CheckoutScreen.kt
51- com/vayunmathur/fooddelivery/ui/CheckoutSections.kt
52- com/vayunmathur/fooddelivery/ui/CheckoutTotals.kt
53- com/vayunmathur/fooddelivery/ui/CheckoutSuccess.kt
54- com/vayunmathur/fooddelivery/ui/OrdersScreen.kt
55- com/vayunmathur/fooddelivery/ui/OrdersScreenSection.kt
56- com/vayunmathur/fooddelivery/ui/OrderTrackingScreen.kt
57- com/vayunmathur/fooddelivery/ui/AccountScreen.kt
58- com/vayunmathur/fooddelivery/ui/AccountAuth.kt
59- com/vayunmathur/fooddelivery/ui/AccountProfile.kt
60- com/vayunmathur/fooddelivery/ui/AccountAddresses.kt
61- com/vayunmathur/fooddelivery/ui/AddressFormCard.kt
62- com/vayunmathur/fooddelivery/ui/OrderTrackingContent.kt
63- com/vayunmathur/fooddelivery/ui/DialogEntries.kt
64- com/vayunmathur/fooddelivery/ui/dialogs/EditProfileDialog.kt
65- com/vayunmathur/fooddelivery/ui/dialogs/DeleteAccountDialog.kt
66- com/vayunmathur/fooddelivery/ui/dialogs/OrderFeedbackDialog.kt
67- com/vayunmathur.fooddelivery/ui/dialogs/PendingCartDialog.kt
68
69## Screenshot coverage + dialog routes
70Dialogs are `Route` destinations (`EditProfileDialog`, `DeleteAccountDialog`, `ModifierPickerDialog`, `PendingCartDialog`, `OrderFeedbackDialog` — `DialogPage()` entries in `ui/DialogEntries.kt`, identity in route args, results via `RESULT_*` keys), never `show…`/pending-target state in a screen. Each route has a capture in `src/screenshotTest` named `<n>-<route-key>`; the fatal `RouteScreenshotCoverage` lint enforces route→capture mapping. Menu search lives in the restaurant scaffold's `search` slot, not in the menu list.
71
72## Verify (this module only)
73```
74./gradlew :fooddelivery:compileDevKotlin
75./gradlew :fooddelivery:lint
76./gradlew :fooddelivery:checkMetadata
77```