|
| 1 | +# UniqueDingKitchen Agent Notes |
| 2 | + |
| 3 | +## Project Scope |
| 4 | + |
| 5 | +- Flutter Web ordering app. |
| 6 | +- Menu/recommendation are data-driven from markdown-like sources. |
| 7 | +- Recommendation can be generated by Python script with OpenAI-compatible API. |
| 8 | + |
| 9 | +## Key Files |
| 10 | + |
| 11 | +- App entry: |
| 12 | + - `lib/main.dart` |
| 13 | + - `lib/app.dart` |
| 14 | +- Main UI: |
| 15 | + - `lib/views/ordering_view.dart` |
| 16 | +- Data loading/parsing: |
| 17 | + - `lib/services/menu_repository.dart` |
| 18 | + - `lib/services/markdown_menu_parser.dart` |
| 19 | + - `lib/services/runtime_config.dart` |
| 20 | + - `lib/services/trillium_menu_parser.dart` |
| 21 | +- Script: |
| 22 | + - `scripts/generate_recommendation.py` |
| 23 | +- Tooling: |
| 24 | + - `tools/branding/generate_logo_candidates_v4.py` |
| 25 | +- Runtime/deploy: |
| 26 | + - `docker/entrypoint.sh` |
| 27 | + - `docker-compose.yaml` |
| 28 | + - `deploy/docker-compose.example.yaml` |
| 29 | + |
| 30 | +## Runtime Config (from `public/runtime_config.json`) |
| 31 | + |
| 32 | +- `site_name` |
| 33 | +- `MENU_SOURCE`: `local` or `trillium` |
| 34 | +- `TRILLIUM_URL` |
| 35 | +- `TRILLIUM_TITLE` |
| 36 | + |
| 37 | +Lowercase compatibility keys still parsed: |
| 38 | + |
| 39 | +- `menu_source`, `trillium_url`, `trillium_title` |
| 40 | + |
| 41 | +## Menu Source Modes |
| 42 | + |
| 43 | +- `MENU_SOURCE=local` |
| 44 | + - Read menu from local public markdown (`public/menu.md` path candidates). |
| 45 | +- `MENU_SOURCE=trillium` |
| 46 | + - Fetch HTML from `TRILLIUM_URL` |
| 47 | + - Extract article section by `TRILLIUM_TITLE` |
| 48 | + - Parse table rows -> convert to markdown table -> reuse parser. |
| 49 | + |
| 50 | +## Markdown Parser |
| 51 | + |
| 52 | +`lib/services/markdown_menu_parser.dart` supports both: |
| 53 | + |
| 54 | +- List rows (`- 名称 | 描述 | 口味 | 小料`) |
| 55 | +- Table rows (`| 名称 | 描述 | 口味 | 小料 |`) |
| 56 | + |
| 57 | +Mixed format in one category is supported. |
| 58 | + |
| 59 | +## Localization Rule |
| 60 | + |
| 61 | +- Any UI text change must keep the same semantic meaning across all supported locales. |
| 62 | +- When updating user-facing copy, update `app_zh.arb`, `app_en.arb`, `app_ja.arb`, `app_ko.arb`, and the generated localization Dart files in the same change. |
| 63 | + |
| 64 | +## Recommendation Script |
| 65 | + |
| 66 | +`scripts/generate_recommendation.py`: |
| 67 | + |
| 68 | +- Inputs: |
| 69 | + - `OPENAI_BASE_URL` / `BASE_URL` |
| 70 | + - `OPENAI_API_KEY` / `API_KEY` |
| 71 | + - `OPENAI_MODEL` / `MODEL` |
| 72 | +- Path defaults: |
| 73 | + - base dir from `PUBLIC_DIR` (default `web/public`) |
| 74 | + - output from `RECOMMEND_FILE` or `${PUBLIC_DIR}/recommend.md` |
| 75 | +- Writes via temp file then atomic replace. |
| 76 | + |
| 77 | +`tools/branding/generate_logo_candidates_v4.py`: |
| 78 | + |
| 79 | +- Generates batch SVG logo candidates for design exploration. |
| 80 | +- Not used by app runtime, Docker startup, or deploy flow. |
| 81 | + |
| 82 | +## Docker Env Highlights |
| 83 | + |
| 84 | +- `SITE_NAME` |
| 85 | +- `OPENAI_BASE_URL` |
| 86 | +- `OPENAI_API_KEY` |
| 87 | +- `OPENAI_MODEL` |
| 88 | +- `MENU_SOURCE` |
| 89 | +- `TRILLIUM_URL` |
| 90 | +- `TRILLIUM_TITLE` |
| 91 | +- `RECOMMEND_CRON_SCHEDULE` |
| 92 | + |
| 93 | +## Common Commands |
| 94 | + |
| 95 | +- `flutter analyze` |
| 96 | +- `flutter test` |
| 97 | +- `flutter build web --wasm --no-source-maps --no-web-resources-cdn --no-wasm-dry-run` |
| 98 | +- `python3 scripts/generate_recommendation.py` |
| 99 | + |
| 100 | +## Current UI Notes |
| 101 | + |
| 102 | +- Bottom bar is floating and blurred. |
| 103 | +- Selected dishes popup and order summary list include category grouping headers. |
0 commit comments