非機能要件 Non-functional requirements
Parky モバイルアプリのパフォーマンス・可用性・スケーラビリティ・セキュリティ・プライバシー・運用保守に関する要件を整理します。 リリース時(東京23区・想定同時利用 5,000 ユーザー)を基準とし、段階的スケーリングを前提とします。
This document organizes requirements for the Parky mobile app covering performance, availability, scalability, security, privacy, and operations / maintenance. The baseline is at release (Tokyo 23 wards, expected concurrent users of 5,000), with progressive scaling assumed.
10.1 パフォーマンス 10.1 Performance
| 指標Metric | 目標Target | 計測方法Measurement method |
|---|---|---|
| アプリコールドスタートApp cold start | P95 < 2.5 秒s | Firebase Performance Monitoring |
| ホーム画面 TTIHome screen TTI | P95 < 3.0 秒s | 同上Same as above |
| 周辺駐車場検索 (RPC)Nearby parking search (RPC) | P95 < 300ms | Supabase Logs |
| 料金シミュレーション(ローカル)Fee simulation (local) | P99 < 16ms(60fps維持) (60fps maintained) | ベンチテストBenchmark |
| 地図レンダリングMap rendering | 60fps を維持60fps maintained | Flutter DevTools |
| Push 受信から通知表示From push receipt to display | 5 秒以内s or less | FCM ログ + アプリログFCM logs + app logs |
| バッテリー消費(駐車中 Live Activity)Battery consumption (in-parking Live Activity) | 1時間あたり < 2%< 2% per hour | 端末計測On-device measurement |
| データ通信量(1セッション)Data traffic (per session) | < 500KB(画像除く) (excluding images) | ネットワークプロファイルNetwork profile |
10.2 可用性 10.2 Availability
- 目標SLA:99.9%(月次ダウンタイム 43分以内)
- SLA target: 99.9% (monthly downtime 43 minutes or less)
- 依存サービス:Supabase(マネージド SLA に依存)、FCM、Mapbox、R2
- Dependent services: Supabase (depend on managed SLA), FCM, Mapbox, R2
- オフライン動作:
- 駐車中セッションは通信が途切れても計時を継続
- 直近の検索結果・保存駐車場・コードマスターはローカルキャッシュから表示
- レビュー投稿・メモ編集・既読更新等の書込はオフラインキューに蓄積し、復帰時に順次送信
- Offline behavior:
- In-parking sessions continue timing even if connectivity drops
- Recent search results, saved lots, and the code master are shown from local cache
- Writes such as review posts, memo edits, and read-state updates accumulate in an offline queue and are sent sequentially on recovery
- 障害時フォールバック:
- Mapbox 障害 → OSM タイル or スタティックマップに切替(将来)
- AI検索 障害 → 通常検索にフォールバック、エラートースト表示
- IAP 検証障害 → 自動リトライ、24時間以上失敗時はユーザー通知
- Failure fallback:
- Mapbox failure → switch to OSM tiles or static map (future)
- AI search failure → fall back to regular search, show error toast
- IAP verification failure → auto retry, user notification on failure 24 hours or more
- メンテナンス告知:メンテナンス時間帯に起動した場合、エラー画面にメンテナンス情報を表示
- Maintenance announcement: When launched during a maintenance time window, display maintenance info on the error screen
10.3 スケーラビリティ 10.3 Scalability
| 指標Metric | リリースRelease | 6ヶ月後6 months later | スケール戦略Scaling strategy |
|---|---|---|---|
| MAU | 10K | 100K | Supabase プラン引き上げ / Read ReplicaSupabase plan upgrade / Read Replica |
| 同時接続Concurrent connections | 5K | 30K | Realtime プラン引き上げRealtime plan upgrade |
| 駐車場件数Parking lot count | 20K | 100K | PostGIS GIST + cluster によるマップ集約PostGIS GIST + cluster-based map clustering |
| セッション/日Sessions/day | 5K | 50K | パーティショニング(月次)Partitioning (monthly) |
| 通知送信/日Notifications/day | 20K | 200K | FCM バッチ API 利用Use FCM batch API |
| 画像総量Total image storage | 50GB | 500GB | Cloudflare R2 階層、サムネイル自動生成Cloudflare R2 tiering, auto thumbnail generation |
DBスケール戦略 DB scaling strategy
parking_sessions,user_activity_logsは月次パーティショニング(pg_partman)parking_sessions,user_activity_logsuse monthly partitioning (pg_partman)- 集計系クエリは Materialized View(管理者ポータルの既存
revenue_monthly_summaryパターンを踏襲) - Aggregation queries use Materialized Views (follow the existing
revenue_monthly_summarypattern in the admin portal) - Read Replica は管理者ポータル専用にルーティング(モバイルは Primary 直結)
- Read Replica is routed dedicated to the admin portal (mobile uses direct connection to Primary)
10.4 セキュリティ 10.4 Security
認証・認可 Authentication & authorization
- Supabase Auth による JWT(アクセストークン 1h、リフレッシュ 30日)
- JWT via Supabase Auth (access token 1h, refresh 30 days)
- リフレッシュトークンは
flutter_secure_storage(Keychain / Keystore)で保護 - Refresh token is protected via
flutter_secure_storage(Keychain / Keystore) - 全テーブルに RLS を設定し、「自分の行のみ操作可能」を原則とする
- Set up RLS on all tables, with the principle that "Only own rows are operable"
- Cloudflare Workers は JWT を検証し、
auth.uid()を必ず使う(引数での user_id 指定は禁止) - Cloudflare Workers verify JWT and always use
auth.uid()(specifying user_id via arguments is forbidden) - 生体認証によるアプリロック(オプション)
- Biometric app lock (optional)
通信 Communication
- 全通信 TLS 1.2 以上(HTTP 拒否)
- All traffic TLS 1.2 or higher (HTTP rejected)
- 証明書ピンニング(将来検討、リリース時は未導入)
- Certificate pinning (future consideration, not introduced at release)
- Mapbox / FCM は公式 SDK 利用、内部APIキーはビルド時に難読化
- Mapbox / FCM use official SDK, internal API keys are obfuscated at build time
データ保護 Data protection
- 端末上の個人情報は SecureStorage 以外に保存しない
- On-device personal info is not stored elsewhere than SecureStorage
- デバッグビルドでは本番 API キーを埋め込まない(flavor 分離)
- Do not embed production API keys in debug builds (flavor separation)
- アプリ内キャッシュは退会時に全削除
- In-app cache is fully wiped on withdrawal
- クラッシュレポートでの PII 送信を抑制(メール等は匿名化)
- PII transmission in crash reports is suppressed (emails etc. are anonymized)
改ざん防止 Tamper prevention
- 料金確定は必ずサーバー RPC で行う(クライアント値は参考値)
- Fee confirmation is always via server RPC (client value is reference only)
- IAP レシートは必ずサーバー検証
- IAP receipts are always server-verified
- Root 化・Jailbreak 検知(警告表示のみ、利用制限は行わない)
- Root / Jailbreak detection (warning only, no usage restrictions)
OWASP Mobile Top 10 対応 OWASP Mobile Top 10 Coverage
| 項目Item | 対応Coverage |
|---|---|
| M1: 不適切な認証Insecure authentication | Supabase Auth + JWT、生体認証オプションSupabase Auth + JWT, biometric optional |
| M2: セキュアでないデータ保存Insecure data storage | SecureStorage 以外への PII 保存禁止PII storage outside SecureStorage is forbidden |
| M3: 安全でない通信Insecure communication | TLS 強制、公式 SDK 利用TLS enforced, use official SDK |
| M4: 認可不備Insufficient authorization | RLS で全アクセス制御RLS for all access control |
| M5: 暗号の不備Weak cryptography | OS 標準の Keychain / Keystore 利用Use OS-standard Keychain / Keystore |
| M6: 不適切な入力検証Poor input validation | クライアントとサーバー両側で検証Validate on both client and server sides |
| M7: コード品質Code quality | Dart analyzer + CI |
| M8: 改ざんTampering | サーバー側で金額・状態確定Server confirms amounts and state |
| M9: リバースエンジニアリングReverse engineering | Proguard / R8, Flutter obfuscate |
| M10: 拡張機能の悪用Extension abuse | Deep Link パラメータを全てバリデーションAll Deep Link parameters validated |
10.5 プライバシー 10.5 Privacy
- 位置情報:
- 使用中のみ取得を基本とし、駐車中 Live Activity 実行時のみ Always 権限を要求
- GPS 記録(駐車開始位置)は駐車セッションと紐付けて保存、退会時は匿名化
- Location:
- Fetch only while in use as baseline; request Always permission only during in-parking Live Activity execution
- GPS records (parking start location) are stored associated with parking sessions, anonymized on withdrawal
- 同意管理:
- 初回起動時にプライバシーポリシー・利用規約への同意
- 分析イベント送信の ON/OFF をユーザーが設定可能(GA4/Sentry)
- Consent management:
- On first launch, consent to privacy policy and terms of service
- Analytics event sending ON/OFF is configurable by users (GA4/Sentry)
- 退会:
- ユーザー操作で退会実行 →
withdraw_accountRPC - 個人情報(
display_name,email,avatar_url)は即時匿名化 - 駐車履歴・レビューは統計用として残るが、ユーザー特定情報は除去
- SecureStorage とローカルキャッシュは全削除
- ユーザー操作で退会実行 →
- Withdrawal:
- Execute withdrawal via user operation →
withdraw_accountRPC - Personal info (
display_name,email,avatar_url) is immediately anonymized - Parking history and reviews are retained as statistics, but personally identifying info is removed
- SecureStorage and local cache are fully deleted
- Execute withdrawal via user operation →
- 法令対応:個人情報保護法、必要に応じ GDPR / CCPA 対応(将来)
- Legal compliance: Japan's APPI; as needed, GDPR / CCPA coverage (future)
- 未成年:利用規約で13歳未満の利用を禁止、保護者同意を求める
- Minors: Via terms of service, users under 13 are prohibited and parental consent is required
10.6 運用 / 保守 10.6 Operations / maintenance
リリースサイクル Release cycle
- マスターブランチ:本番リリース。保護ルール+PR 必須
- master branch: production release. Branch protection + PR required
- dev ブランチ:ステージング配信(TestFlight / Google Play Internal Testing)
- dev branch: staging distribution (TestFlight / Google Play Internal Testing)
- リリース頻度:2週間スプリント、月1回ストアリリース
- Release cadence: 2-week sprint, monthly store release
- Flutter バージョン追従:LTS ベース
- Flutter version updates: LTS-based
リモート設定 / フィーチャーフラグ Remote config / feature flags
- Firebase Remote Config or
app_configテーブルで以下を管理:- AI検索の有効化
- 広告表示の有効化
- 検索半径のデフォルト値
- 通知種別のデフォルト設定
- メンテナンスモードフラグ
- Firebase Remote Config or the
app_configtable manages the following:- AI search enablement
- Ad display enablement
- Search radius default value
- Notification type default settings
- Maintenance mode flag
- 最低サポートバージョン:アプリ起動時にチェックし、古ければアップデート強制
- Minimum supported version: checked on app boot, force update if outdated
モニタリング Monitoring
- クラッシュフリー率 >= 99.5% を目標
- Crash-free rate >= 99.5% as target
- Sentry / Firebase Crashlytics にアラート設定
- Alert configured on Sentry / Firebase Crashlytics
- 主要 KPI(MAU、DAU、駐車セッション数、レビュー数)を BI ダッシュボードで可視化
- Key KPIs (MAU, DAU, parking session count, review count) visualized in BI dashboard
- 通知配信失敗率 >= 5% でアラート
- Alert when notification delivery failure rate >= 5%
ログ保存ポリシー Log retention policy
| ログ種別Log type | 保存期間Retention | 保存先Store |
|---|---|---|
ユーザー行動ログUser activity logs (user_activity_logs) |
2年 → 集計化2 years → aggregated | PostgreSQL |
| 駐車セッションParking sessions | 無期限(ユーザー資産)Indefinite (user asset) | PostgreSQL |
| Push 配信ログPush delivery logs | 6 ヶ月months | user_notifications |
| クラッシュCrash | Sentry 既定(90日)Sentry default (90 days) | Sentry |
| APIログAPI logs | Supabase 既定Supabase default | Supabase Logs |
| 監査ログ(管理者操作)Audit logs (admin actions) | 5 年years | 管理者ポータル側In the admin portal |
サポート体制 Support setup
- アプリ内サポート →
support_tickets→ 管理者ポータルで一元対応 - In-app support →
support_tickets→ handled centrally in the admin portal - FAQ・ポリシー・規約は CMS またはメディア機能で管理
- FAQ, policy, and terms are managed via CMS or the media feature
- 重大障害時は管理者からのお知らせ通知(
system_announcement)で全ユーザーに周知 - During severe incidents, notify all users via admin announcement notification (
system_announcement)
本仕様書のステータス:
本書は Parky仕様書.xlsx の §1〜§2.2 に記載された確定情報をベースに、
§3〜§10 の未記載部分を管理者ポータル仕様・Supabase スキーマ・一般的モバイルアーキテクチャから整合的に補完したものです。
§3以降の仕様は今後の設計確定に応じて改訂されます。
Document status:
This document is based on the confirmed content in §1–§2.2 of Parky仕様書.xlsx,
with unwritten sections from §3–§10 complementarily derived from the admin portal specs, Supabase schema, and general mobile architecture.
Subsequent specs from §3 onward will be revised as design is finalized.