feat(setup): phase 1 — project initialization - #50
Conversation
Bootstrap monorepo toolchain for 004-mostro-p2p-client: - Directory structure: lib/features/ (12 feature dirs), lib/core/, lib/shared/, rust/src/ (7 module stubs), assets/data/, assets/images/ - rust/Cargo.toml: nostr-sdk 0.44, mostro-core 0.8, flutter_rust_bridge 2.11.1, sqlx, bip32/bip39, chacha20poly1305 with native/WASM feature gates - pubspec.yaml v2.0.0+1: flutter_riverpod, go_router, sembast, introduction_screen, flutter_secure_storage, mobile_scanner, qr_flutter - Linting: .clippy.toml, strict analysis_options.yaml, .githooks/pre-commit - assets/data/fiat.json: 153 ISO 4217 currencies with flag emojis - lib/l10n/: skeleton ARB files for EN, ES, IT, FR, DE - assets/images/: placeholder walkthrough images wt-1.png through wt-6.png Checkpoint: flutter pub get, cargo build, flutter analyze all pass.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds project scaffolding: Rust crate and modules, Clippy and pre-commit checks, expanded Flutter deps and assets (fiat.json), multi-language Flutter localizations (DE/EN/ES/FR/IT) with generated delegates/implementations, analyzer/linter tweaks, macOS plugin registration, and task checklist updates. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as BuildContext
participant Localizations as AppLocalizations.of()
participant Delegate as _AppLocalizationsDelegate
participant Lookup as lookupAppLocalizations()
participant Impl as AppLocalizationsEn/De/Es/Fr/It
UI->>Localizations: AppLocalizations.of(context)
Localizations->>Delegate: delegate.load(locale)
Delegate->>Lookup: lookupAppLocalizations(locale)
alt supported languageCode
Lookup->>Impl: instantiate concrete locale
Impl-->>Lookup: return instance
else unsupported
Lookup->>Lookup: throw FlutterError
end
Lookup-->>Delegate: locale instance
Delegate-->>Localizations: provide localization
Localizations-->>UI: localized getters available
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (4)
analysis_options.yaml (1)
19-21: Remove the globalinvalid_annotation_target: ignoreand exclude generated l10n files.The l10n generated code in
lib/l10n/already contains// ignore_for_file: type=lintdirectives, making the global suppression at Line 21 redundant. Addlib/l10n/**to theanalyzer.excludesection instead to maintain clean suppression without masking legitimate annotation errors in hand-written code.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@analysis_options.yaml` around lines 19 - 21, Remove the global suppression by deleting the "invalid_annotation_target: ignore" entry and instead add the generated localization folder to the analyzer exclusions by adding "lib/l10n/**" under the "analyzer.exclude" section so generated l10n files remain ignored while hand-written code still gets proper annotation diagnostics; update analysis_options.yaml to remove the global rule and include the "analyzer.exclude: lib/l10n/**" entry.rust/src/api/mod.rs (1)
1-1: Add one minimal bridge symbol tocrate::apito smoke-test end-to-end binding generation.
rust/src/api/mod.rsis configured as theflutter_rust_bridge.yamlentrypoint (rust_input: "crate::api") but currently exports no public functions or types. Without at least one public API symbol, the bootstrap does not validate that Rust-to-Dart binding generation works. A tinypub fn ping()or similar would turn the bridge setup into a real smoke test.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@rust/src/api/mod.rs` at line 1, Add a minimal public bridge symbol in crate::api so the flutter_rust_bridge entrypoint validates binding generation: implement a public function named ping (e.g., pub fn ping() -> String) inside rust/src/api/mod.rs that returns a small sentinel like "pong" to serve as a smoke-test for Rust-to-Dart bindings.rust/src/lib.rs (1)
6-12: Consider reducing early public API surface.
If these modules are internal for now, preferpub(crate) moduntil their external API is intentional and stable.Suggested refactor
-pub mod api; -pub mod crypto; -pub mod db; -pub mod mostro; -pub mod nostr; -pub mod nwc; -pub mod queue; +pub(crate) mod api; +pub(crate) mod crypto; +pub(crate) mod db; +pub(crate) mod mostro; +pub(crate) mod nostr; +pub(crate) mod nwc; +pub(crate) mod queue;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@rust/src/lib.rs` around lines 6 - 12, The top-level modules (api, crypto, db, mostro, nostr, nwc, queue) are exported publicly but appear to be internal; change their declarations from `pub mod` to `pub(crate) mod` (e.g., `pub(crate) mod api`, `pub(crate) mod db`, etc.) so the crate exposes a smaller, intentional public API surface; after this change, update any external uses that relied on these modules (or re-export specific types/functions from lib.rs when you want a stable public API).lib/l10n/app_localizations.dart (1)
99-105: Avoid duplicating supported locale definitions.
Line 160 hardcodes language codes already defined insupportedLocales(Line 99). Using one source of truth prevents drift when adding locales.♻️ Proposed refactor
`@override` - bool isSupported(Locale locale) => - <String>['de', 'en', 'es', 'fr', 'it'].contains(locale.languageCode); + bool isSupported(Locale locale) => AppLocalizations.supportedLocales.any( + (Locale supportedLocale) => + supportedLocale.languageCode == locale.languageCode, + );Also applies to: 160-161
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/l10n/app_localizations.dart` around lines 99 - 105, There are duplicate locale definitions: the static const List<Locale> supportedLocales is the source of truth but the language codes are hardcoded again later; remove the duplicate hardcoded list and instead derive the language-code list from supportedLocales (or add a single shared constant like supportedLanguageCodes derived from supportedLocales) so both places reference the same data; update the other usage to read from that derived list rather than repeating the literals, keeping references to supportedLocales (and the new supportedLanguageCodes if you add it) to locate where to change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.githooks/pre-commit:
- Around line 6-10: The pre-commit hook currently runs only linting in the rust
directory (the line with (cd rust && cargo clippy -- -D warnings 2>&1)); add
Rust tests by running cargo test before cargo clippy so regressions are caught
locally. Replace the single clippy invocation with a combined command that runs
cargo test && cargo clippy inside the rust dir (preserving the existing
stdout/stderr redirection and exit behavior) so the hook fails if tests or
clippy fail.
In `@assets/data/fiat.json`:
- Around line 55-121: The fiat.json dataset contains outdated/withdrawn ISO 4217
codes (e.g., "HRK" and "SLL"); update the currency list by replacing deprecated
codes with current ISO 4217 entries from an authoritative source (e.g., ISO or a
maintained central bank/currency registry) and remove legacy entries such as
"HRK" and "SLL" from the array; then add an automated validation step (unit test
or CI check) that loads fiat.json and verifies every "code" value against a
canonical list (a checked-in JSON or a small helper function like
validateCurrencyCodes or a test named test_fiat_codes_are_current) so future
drift is detected and PRs fail when deprecated codes are reintroduced.
In `@rust/Cargo.toml`:
- Around line 39-48: Add an explicit wasm target validation step to the
build/CI: run `cargo check --target wasm32-unknown-unknown` after the native
build to ensure the wasm-specific dependency graph (the
`[target.'cfg(target_arch = "wasm32")'.dependencies]` entries including
`wasm-bindgen-futures`, `indexed_db_futures`, and the wasm `reqwest` feature
set) is exercised and errors surface early; update the project's CI/build script
to invoke this command (or equivalent cargo invocation) so wasm-only resolver
issues are caught before merging.
---
Nitpick comments:
In `@analysis_options.yaml`:
- Around line 19-21: Remove the global suppression by deleting the
"invalid_annotation_target: ignore" entry and instead add the generated
localization folder to the analyzer exclusions by adding "lib/l10n/**" under the
"analyzer.exclude" section so generated l10n files remain ignored while
hand-written code still gets proper annotation diagnostics; update
analysis_options.yaml to remove the global rule and include the
"analyzer.exclude: lib/l10n/**" entry.
In `@lib/l10n/app_localizations.dart`:
- Around line 99-105: There are duplicate locale definitions: the static const
List<Locale> supportedLocales is the source of truth but the language codes are
hardcoded again later; remove the duplicate hardcoded list and instead derive
the language-code list from supportedLocales (or add a single shared constant
like supportedLanguageCodes derived from supportedLocales) so both places
reference the same data; update the other usage to read from that derived list
rather than repeating the literals, keeping references to supportedLocales (and
the new supportedLanguageCodes if you add it) to locate where to change.
In `@rust/src/api/mod.rs`:
- Line 1: Add a minimal public bridge symbol in crate::api so the
flutter_rust_bridge entrypoint validates binding generation: implement a public
function named ping (e.g., pub fn ping() -> String) inside rust/src/api/mod.rs
that returns a small sentinel like "pong" to serve as a smoke-test for
Rust-to-Dart bindings.
In `@rust/src/lib.rs`:
- Around line 6-12: The top-level modules (api, crypto, db, mostro, nostr, nwc,
queue) are exported publicly but appear to be internal; change their
declarations from `pub mod` to `pub(crate) mod` (e.g., `pub(crate) mod api`,
`pub(crate) mod db`, etc.) so the crate exposes a smaller, intentional public
API surface; after this change, update any external uses that relied on these
modules (or re-export specific types/functions from lib.rs when you want a
stable public API).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 473e88c4-4035-4c67-b4bc-e7be40adf968
⛔ Files ignored due to path filters (7)
assets/images/wt-1.pngis excluded by!**/*.pngassets/images/wt-2.pngis excluded by!**/*.pngassets/images/wt-3.pngis excluded by!**/*.pngassets/images/wt-4.pngis excluded by!**/*.pngassets/images/wt-5.pngis excluded by!**/*.pngassets/images/wt-6.pngis excluded by!**/*.pngrust/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (27)
.clippy.toml.githooks/pre-commitanalysis_options.yamlassets/data/fiat.jsonlib/l10n/app_de.arblib/l10n/app_en.arblib/l10n/app_es.arblib/l10n/app_fr.arblib/l10n/app_it.arblib/l10n/app_localizations.dartlib/l10n/app_localizations_de.dartlib/l10n/app_localizations_en.dartlib/l10n/app_localizations_es.dartlib/l10n/app_localizations_fr.dartlib/l10n/app_localizations_it.dartmacos/Flutter/GeneratedPluginRegistrant.swiftpubspec.yamlrust/Cargo.tomlrust/src/api/mod.rsrust/src/crypto/mod.rsrust/src/db/mod.rsrust/src/lib.rsrust/src/mostro/mod.rsrust/src/nostr/mod.rsrust/src/nwc/mod.rsrust/src/queue/mod.rsspecs/004-mostro-p2p-client/tasks.md
| {"code": "HRK", "name": "Croatian Kuna", "flag": "🇭🇷"}, | ||
| {"code": "HTG", "name": "Haitian Gourde", "flag": "🇭🇹"}, | ||
| {"code": "HUF", "name": "Hungarian Forint", "flag": "🇭🇺"}, | ||
| {"code": "IDR", "name": "Indonesian Rupiah", "flag": "🇮🇩"}, | ||
| {"code": "ILS", "name": "Israeli New Shekel", "flag": "🇮🇱"}, | ||
| {"code": "INR", "name": "Indian Rupee", "flag": "🇮🇳"}, | ||
| {"code": "IQD", "name": "Iraqi Dinar", "flag": "🇮🇶"}, | ||
| {"code": "IRR", "name": "Iranian Rial", "flag": "🇮🇷"}, | ||
| {"code": "ISK", "name": "Icelandic Króna", "flag": "🇮🇸"}, | ||
| {"code": "JMD", "name": "Jamaican Dollar", "flag": "🇯🇲"}, | ||
| {"code": "JOD", "name": "Jordanian Dinar", "flag": "🇯🇴"}, | ||
| {"code": "JPY", "name": "Japanese Yen", "flag": "🇯🇵"}, | ||
| {"code": "KES", "name": "Kenyan Shilling", "flag": "🇰🇪"}, | ||
| {"code": "KGS", "name": "Kyrgystani Som", "flag": "🇰🇬"}, | ||
| {"code": "KHR", "name": "Cambodian Riel", "flag": "🇰🇭"}, | ||
| {"code": "KMF", "name": "Comorian Franc", "flag": "🇰🇲"}, | ||
| {"code": "KPW", "name": "North Korean Won", "flag": "🇰🇵"}, | ||
| {"code": "KRW", "name": "South Korean Won", "flag": "🇰🇷"}, | ||
| {"code": "KWD", "name": "Kuwaiti Dinar", "flag": "🇰🇼"}, | ||
| {"code": "KYD", "name": "Cayman Islands Dollar", "flag": "🇰🇾"}, | ||
| {"code": "KZT", "name": "Kazakhstani Tenge", "flag": "🇰🇿"}, | ||
| {"code": "LAK", "name": "Lao Kip", "flag": "🇱🇦"}, | ||
| {"code": "LBP", "name": "Lebanese Pound", "flag": "🇱🇧"}, | ||
| {"code": "LKR", "name": "Sri Lankan Rupee", "flag": "🇱🇰"}, | ||
| {"code": "LRD", "name": "Liberian Dollar", "flag": "🇱🇷"}, | ||
| {"code": "LSL", "name": "Lesotho Loti", "flag": "🇱🇸"}, | ||
| {"code": "LYD", "name": "Libyan Dinar", "flag": "🇱🇾"}, | ||
| {"code": "MAD", "name": "Moroccan Dirham", "flag": "🇲🇦"}, | ||
| {"code": "MDL", "name": "Moldovan Leu", "flag": "🇲🇩"}, | ||
| {"code": "MGA", "name": "Malagasy Ariary", "flag": "🇲🇬"}, | ||
| {"code": "MKD", "name": "Macedonian Denar", "flag": "🇲🇰"}, | ||
| {"code": "MMK", "name": "Myanmar Kyat", "flag": "🇲🇲"}, | ||
| {"code": "MNT", "name": "Mongolian Tögrög", "flag": "🇲🇳"}, | ||
| {"code": "MOP", "name": "Macanese Pataca", "flag": "🇲🇴"}, | ||
| {"code": "MRU", "name": "Mauritanian Ouguiya", "flag": "🇲🇷"}, | ||
| {"code": "MUR", "name": "Mauritian Rupee", "flag": "🇲🇺"}, | ||
| {"code": "MVR", "name": "Maldivian Rufiyaa", "flag": "🇲🇻"}, | ||
| {"code": "MWK", "name": "Malawian Kwacha", "flag": "🇲🇼"}, | ||
| {"code": "MXN", "name": "Mexican Peso", "flag": "🇲🇽"}, | ||
| {"code": "MYR", "name": "Malaysian Ringgit", "flag": "🇲🇾"}, | ||
| {"code": "MZN", "name": "Mozambican Metical", "flag": "🇲🇿"}, | ||
| {"code": "NAD", "name": "Namibian Dollar", "flag": "🇳🇦"}, | ||
| {"code": "NGN", "name": "Nigerian Naira", "flag": "🇳🇬"}, | ||
| {"code": "NIO", "name": "Nicaraguan Córdoba", "flag": "🇳🇮"}, | ||
| {"code": "NOK", "name": "Norwegian Krone", "flag": "🇳🇴"}, | ||
| {"code": "NPR", "name": "Nepalese Rupee", "flag": "🇳🇵"}, | ||
| {"code": "NZD", "name": "New Zealand Dollar", "flag": "🇳🇿"}, | ||
| {"code": "OMR", "name": "Omani Rial", "flag": "🇴🇲"}, | ||
| {"code": "PAB", "name": "Panamanian Balboa", "flag": "🇵🇦"}, | ||
| {"code": "PEN", "name": "Peruvian Sol", "flag": "🇵🇪"}, | ||
| {"code": "PGK", "name": "Papua New Guinean Kina", "flag": "🇵🇬"}, | ||
| {"code": "PHP", "name": "Philippine Peso", "flag": "🇵🇭"}, | ||
| {"code": "PKR", "name": "Pakistani Rupee", "flag": "🇵🇰"}, | ||
| {"code": "PLN", "name": "Polish Zloty", "flag": "🇵🇱"}, | ||
| {"code": "PYG", "name": "Paraguayan Guaraní", "flag": "🇵🇾"}, | ||
| {"code": "QAR", "name": "Qatari Riyal", "flag": "🇶🇦"}, | ||
| {"code": "RON", "name": "Romanian Leu", "flag": "🇷🇴"}, | ||
| {"code": "RSD", "name": "Serbian Dinar", "flag": "🇷🇸"}, | ||
| {"code": "RUB", "name": "Russian Ruble", "flag": "🇷🇺"}, | ||
| {"code": "RWF", "name": "Rwandan Franc", "flag": "🇷🇼"}, | ||
| {"code": "SAR", "name": "Saudi Riyal", "flag": "🇸🇦"}, | ||
| {"code": "SBD", "name": "Solomon Islands Dollar", "flag": "🇸🇧"}, | ||
| {"code": "SCR", "name": "Seychellois Rupee", "flag": "🇸🇨"}, | ||
| {"code": "SDG", "name": "Sudanese Pound", "flag": "🇸🇩"}, | ||
| {"code": "SEK", "name": "Swedish Krona", "flag": "🇸🇪"}, | ||
| {"code": "SGD", "name": "Singapore Dollar", "flag": "🇸🇬"}, | ||
| {"code": "SLL", "name": "Sierra Leonean Leone", "flag": "🇸🇱"}, |
There was a problem hiding this comment.
Currency dataset includes outdated ISO codes.
Line 55 (HRK) and Line 121 (SLL) are legacy codes; keeping withdrawn/replaced entries in a list described as ISO 4217 introduces data correctness risk for selection, validation, and integrations.
Please refresh this file from a current canonical source and add a validation step/test to prevent drift.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@assets/data/fiat.json` around lines 55 - 121, The fiat.json dataset contains
outdated/withdrawn ISO 4217 codes (e.g., "HRK" and "SLL"); update the currency
list by replacing deprecated codes with current ISO 4217 entries from an
authoritative source (e.g., ISO or a maintained central bank/currency registry)
and remove legacy entries such as "HRK" and "SLL" from the array; then add an
automated validation step (unit test or CI check) that loads fiat.json and
verifies every "code" value against a canonical list (a checked-in JSON or a
small helper function like validateCurrencyCodes or a test named
test_fiat_codes_are_current) so future drift is detected and PRs fail when
deprecated codes are reintroduced.
There was a problem hiding this comment.
Fixed in commit 029a6dc — removed HRK (Croatian Kuna, replaced by EUR in 2023) and SLL (Sierra Leonean Leone, replaced by SLE). Dataset now has 148 currencies.
There was a problem hiding this comment.
Skipped: comment is from another GitHub bot.
| [target.'cfg(not(target_arch = "wasm32"))'.dependencies] | ||
| tokio = { version = "1", features = ["rt-multi-thread", "macros"] } | ||
| sqlx = { version = "0.8", features = ["sqlite", "runtime-tokio", "macros", "migrate"] } | ||
| reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "json"] } | ||
|
|
||
| # WASM-only: IndexedDB + wasm async executor | ||
| [target.'cfg(target_arch = "wasm32")'.dependencies] | ||
| wasm-bindgen-futures = "0.4" | ||
| indexed_db_futures = "0.4" | ||
| reqwest = { version = "0.12", default-features = false, features = ["json"] } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Target-specific dependency sections =="
sed -n '38,48p' rust/Cargo.toml
echo
echo "== Existing wasm CI coverage =="
rg -n --hidden -S 'wasm32-unknown-unknown|cargo (check|build).*wasm32|rustup target add wasm32-unknown-unknown' . || trueRepository: MostroP2P/app
Length of output: 1286
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Searching for CI workflow files =="
find . -type f \( -name "*.yml" -o -name "*.yaml" \) -path "*/.github/workflows/*" -o -name ".gitlab-ci.yml" -o -name "*.circleci*" 2>/dev/null | head -20
echo
echo "== Checking git ls-files for CI config patterns =="
git ls-files | grep -E '(\.github/workflows|\.gitlab-ci|circleci|\.travis)' || echo "No CI files found via git ls-files"
echo
echo "== Searching all workflow files for wasm references =="
find . -type f \( -name "*.yml" -o -name "*.yaml" \) 2>/dev/null | xargs grep -l "wasm32\|wasm-pack\|flutter_rust_bridge" 2>/dev/null || echo "No wasm references in workflow files"Repository: MostroP2P/app
Length of output: 408
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== flutter_rust_bridge.yaml content =="
cat flutter_rust_bridge.yaml 2>/dev/null || echo "File not found"
echo
echo "== Checking rust_builder/cargokit for wasm build references =="
find rust_builder/cargokit -type f -name "*.yaml" -o -name "*.yml" -o -name "*.sh" 2>/dev/null | xargs grep -l "wasm\|target" 2>/dev/null | head -5
echo
echo "== Check if pubspec.yaml mentions wasm build =="
grep -A5 -B5 "wasm\|rust.*target" pubspec.yaml 2>/dev/null || echo "No wasm refs in pubspec.yaml"Repository: MostroP2P/app
Length of output: 532
Add explicit wasm target validation to your build process.
The wasm-specific dependencies on lines 45–48 are never exercised by a normal native cargo build. Without validation, a broken wasm resolver graph can merge unnoticed. Add a cargo check --target wasm32-unknown-unknown step to catch cross-target issues early, especially once rust/src/db begins depending on these crates.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@rust/Cargo.toml` around lines 39 - 48, Add an explicit wasm target validation
step to the build/CI: run `cargo check --target wasm32-unknown-unknown` after
the native build to ensure the wasm-specific dependency graph (the
`[target.'cfg(target_arch = "wasm32")'.dependencies]` entries including
`wasm-bindgen-futures`, `indexed_db_futures`, and the wasm `reqwest` feature
set) is exercised and errors surface early; update the project's CI/build script
to invoke this command (or equivalent cargo invocation) so wasm-only resolver
issues are caught before merging.
There was a problem hiding this comment.
Fixed in commit 029a6dc — added cargo check --target wasm32-unknown-unknown to the pre-commit hook so wasm-specific dependency issues are caught before merging.
There was a problem hiding this comment.
Skipped: comment is from another GitHub bot.
- pre-commit: add cargo test before clippy + wasm32 target check - fiat.json: remove obsolete ISO codes HRK and SLL
Bootstrap monorepo toolchain for 004-mostro-p2p-client:
Checkpoint: flutter pub get, cargo build, flutter analyze all pass.
Summary by CodeRabbit
New Features
Chores