MotorSignal-App/docs/FEATURE_REPORT.md

478 lines
35 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# MotorSignal Platform — Comprehensive Feature Report
**Document Version:** 1.0.0
**Date:** October 1, 2026
**Auditor / Architect:** Antigravity Autonomous Engineering & QA Suite
**Target Release:** `v1.0.2` (Build 102) | Mobile APK: `app.motorsignal.motorcycle` | Web: `https://motorsignal.app`
---
## 1. Executive Summary & Platform Overview
**MotorSignal** is an advanced motorcycle telemetry acquisition, ride analytics, tactical navigation, and social squad platform. It provides high-frequency edge sensor acquisition (20 Hz / 50 ms), offline-first local persistence, tactical group ride radar, community feeds, and web-based fleet and operations management.
```mermaid
graph TD
subgraph MobileEdge [Mobile Edge Subsystem (Pixel 8 Pro / Android 14)]
Sensors[20 Hz GNSS & 6-Axis IMU] --> SensorFusion[SensorFusionService (Kalman)]
SensorFusion --> Telemetry[TelemetryService (20 Hz Acquisition)]
Telemetry --> RideStateMachine[RideStateMachine (3.0 MPH Gate)]
RideStateMachine --> DriftDB[(Local Drift SQLite Schema 7)]
DriftDB --> SyncOutbox[SyncManager & SyncOutbox]
end
subgraph CloudStorage [Cloud Telemetry Pipeline]
SyncOutbox --> R2[Cloudflare R2 (Binary Bundles)]
SyncOutbox --> Firestore[(Cloud Firestore Metadata)]
end
subgraph WebOperations [Web Platform (Next.js 14 & FastAPI)]
WebVisitor[Public Website & Showcase]
RiderPortal[Rider Portal & Canvas Replay]
AdminConsole[Ops Console /admin (SRE & CMS)]
FastAPI[Backend REST API (FastAPI & PostgreSQL)]
end
Firestore --> RiderPortal
FastAPI --> AdminConsole
```
### Platform Inventory & Implementation Scorecard
The platform encompasses **77 defined features across mobile, web, backend, and hardware**.
> [!NOTE] Resolved Architecture Milestone — Web Founder Portal 100% Operational
> In earlier versions of the Founder Portal, 6 management tools in `founder-sidebar.tsx` were tagged with `[SOON]` badges and disabled (Members, Routes, Wall, Chat, Stats, Moderation). All 6 core modules have now been fully implemented, integrated with Cloud Firestore, validated across Vitest component test suites (165/165 passing), and wired to operational Next.js App Router endpoints with zero disabled navigation stubs remaining.
| Subsystem | Total Items | Fully Implemented & Verified | Partially Implemented | Unimplemented Stubs (`[SOON]`) | Hardware Boundary | Verified Full Rate |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: |
| **Mobile Application Screens (`lib/`)** | 32 | **31** | **1** | 0 | 0 | **96.9%** |
| **Website Pages & Portal Tools (`website/`)** | 30 | **29** | **1** | **0** | 0 | **96.7%** |
| **Backend API & Ops Services (`backend/`)** | 12 | **11** | **1** | 0 | 0 | **91.7%** |
| **Hardware & Peripheral Links** | 3 | 0 | 0 | 0 | **3** | **Hardware Boundary** |
| **TOTAL PLATFORM** | **77** | **71** | **3** | **0** | **3** | **92.2% Full / 3.9% Partial / 3.9% HW** |
---
## 2. Subsystem 1: Cockpit & Real-Time Telemetry
The mobile cockpit is designed specifically for motorcycle operation: high-contrast AMOLED dark backgrounds, glove-friendly tap targets ($\ge 48$ dp), minimal cognitive overhead, and orientation-aware layouts.
```mermaid
flowchart LR
A[Cockpit Screen] --> B[Minimal HUD]
A --> C[Sport Cockpit]
A --> D[Touring Cockpit]
B --> E[96pt Speedometer, Fix Status, Elapsed Timer]
C --> F[Dual-Axis G-Meter, Peak Lean Indicator, Launch Button]
D --> G[Live Vector Map Pane, Compass Heading, Road Alerts]
```
### Feature Specifications
| Feature ID | Screen / Component | Implementation Details | Verified Status |
| :--- | :--- | :--- | :---: |
| **DASH-01** | Minimal Cockpit (`/`) | 96pt digital speed readout, elapsed ride timer, trip odometer, 2D/3D GPS fix badge, Standby/Recording status chip. AMOLED pure black (`#070A0F`) power-saving background. | **VERIFIED PASS** |
| **DASH-02** | Sport Cockpit (`/`) | Dual-axis G-force meter (0.5G inner / 1.0G outer friction circle), real-time banking motorcycle silhouette with peak left and right lean angle memory, quick launch mode button. | **VERIFIED PASS** |
| **DASH-03** | Touring Cockpit (`/`) | Embedded vector map pane, digital compass heading, elevation gain, moving time, trip A odometer, average speed, road alert ticker strip. | **VERIFIED PASS** |
| **DASH-04** | Session Recording Start | `RideStateMachine` transition to `RideState.riding`. Pulsing red `● RECORDING` badge, wake-lock engagement, and 20 Hz telemetry acquisition start. | **VERIFIED PASS** |
| **DASH-05** | Session Recording Stop | Flushes telemetry buffer to SQLite, updates ride summary statistics, returns status to `● STANDBY`, and triggers background sync. | **VERIFIED PASS** *(DEFECT-01 remediated)* |
| **LIFE-01** | Pause & Resume Controls | Pauses sample collection without terminating ride identity. Excludes stationary pauses from average speed and handling metrics. | **VERIFIED PASS** |
| **FUSION-01**| Sensor Fusion Engine | Authoritative 20 Hz / 50 ms acquisition. Kalman-filtered orientation, pitch, roll, lateral G, and longitudinal G computation. | **VERIFIED PASS** *(FROZEN boundary)* |
---
## 3. Subsystem 2: Performance Launch & Timing
Draggy-style precision acceleration and quarter-mile timing splits designed for track days, closed courses, and performance tuning.
```mermaid
sequenceDiagram
participant Rider
participant LaunchScreen as PerformanceLaunchScreen
participant GPS as High-Rate GPS/IMU
participant StateMachine as PerformanceLaunchStateMachine
Rider->>LaunchScreen: Select Launch Mode (0-60 / 0-100)
LaunchScreen->>GPS: Verify Slope (<= +-1%) & Accuracy (<= +-2 ft)
LaunchScreen-->>Rider: Display ARMED (Green Light Ready)
Rider->>GPS: Throttle Applied (Speed > 0.5 MPH)
GPS->>StateMachine: Auto-Start Triggered (0.00s)
GPS->>StateMachine: Record 30 MPH, 60 MPH, 100 MPH Splits
StateMachine-->>LaunchScreen: Render Real-Time Curve & Peak G
StateMachine-->>Rider: Display Final Splits & DA Correction
```
### Feature Specifications
| Feature ID | Screen / Component | Implementation Details | Verified Status |
| :--- | :--- | :--- | :---: |
| **PERF-01** | Launch Mode Screen (`/launch`) | Supports 0–60 MPH, 0–100 MPH, 1/4 mile, and 60–130 MPH timing splits. Features auto-start acceleration threshold gate and pre-launch environmental verification. | **VERIFIED PASS** |
| **PERF-02** | Launch Curve & Density Altitude | Interactive Speed vs. Time curve chart with longitudinal G-trace overlay, touch scrubber, peak G readout, and barometric Density Altitude (DA) calculation with horsepower loss/gain advisory. | **VERIFIED PASS** |
| **PERF-03** | Standalone & In-Ride Performance | Timing runs can be triggered independently from `/launch` or executed seamlessly during an active background recording ride session. | **VERIFIED PASS** |
---
## 4. Subsystem 3: Tactical Live Map & Swarm Road Alerts
Real-time situational awareness engine integrating offline-cached vector tiles, user hazard reports, and police/radar warnings.
```mermaid
flowchart TD
UserTap[Rider Taps Floating 'REPORT' Button] --> Modal[QuickSwarmReportModal Opened]
Modal --> Select[Select Hazard: Gravel / Police / Hazard / Debris]
Select --> PreCapture[Pre-capture Providers & Services]
PreCapture --> Dismiss[Dismiss Bottom Sheet Immediately]
Dismiss --> AsyncGPS[Acquire High-Accuracy GPS Coordinates]
AsyncGPS --> LocalPersist[Store Alert in SwarmRoadAlertService Cache]
AsyncGPS --> AudioAlert[Announce Audio TTS Alert: 'Road hazard ahead']
AsyncGPS --> CanvasMarker[Render Circular Amber Beacon ⚠️ on Live Map]
AsyncGPS --> CloudWrite[Post Alert to Cloud Firestore]
```
### Feature Specifications
| Feature ID | Screen / Component | Implementation Details | Verified Status |
| :--- | :--- | :--- | :---: |
| **MAP-01** | Tactical Live Map (`/map`) | Vector map engine with blue directional rider chevron, dynamic road labels, twisty road highlighting, and dark cockpit theme. | **VERIFIED PASS** |
| **MAP-02** | Tactical Layers Drawer | 3 selectable base map styles (`Tactical Dark`, `Satellite 4K`, `3D Topo Elevation`), 4 tactical HUD toggles (`Police & Radar Traps`, `Group Ride Pack Blips`, `Twisty Curvature`, `Offline Cached Mode`), and quick-filter chips (`Gas`, `Twisty Passes`, `Scenic Rest`, `Repair`). | **VERIFIED PASS** |
| **MAP-03** | Swarm Road Hazard Submission | 1-tap hazard reporting from floating action button. Pre-captures providers before modal dismissal to prevent widget disposal exceptions. | **VERIFIED PASS** *(DEFECT-03 remediated)* |
| **ALERT-01**| Audio Road Warnings | Text-to-speech voice announcements (`"Road hazard ahead"`, `"Police reported 0.5 miles"`) with automatic lean-angle interlock (>15° lean suppresses non-critical audio). | **VERIFIED PASS** |
---
## 5. Subsystem 4: Virtual Garage & Maintenance Tracking
Fleet and motorcycle stable management integrated with the NHTSA global vehicle database and service interval schedules.
### Feature Specifications
| Feature ID | Screen / Component | Implementation Details | Verified Status |
| :--- | :--- | :--- | :---: |
| **GAR-01** | NHTSA Manufacturer Lookup | Real-time queried vehicle database filtered by manufacturer (e.g. Yamaha Motor Corp, Ducati, BMW, Honda). | **VERIFIED PASS** |
| **GAR-02** | Model & Variant Selection | Dynamic 4-step selection: Year $\rightarrow$ Make $\rightarrow$ Model $\rightarrow$ Trim / Variant (e.g. 2027 Yamaha MT-07 SP / Performance). | **VERIFIED PASS** |
| **GAR-03** | Garage Stable & Photo Attribution | Active motorcycle selection badge, cumulative odometer tracking, and sanitized plain-text photo attribution stripped of HTML markup. | **VERIFIED PASS** *(DEFECT-02 remediated)* |
| **GAR-04** | Maintenance Interval Countdown | Automatic odometer countdown progress bars for critical motorcycle maintenance: Engine Oil & Filter, Drive Chain Service, Tire Wear, and Brake Fluid. | **VERIFIED PASS** |
| **GAR-05** | Service History Log | `+ Log Service` modal allowing riders to log maintenance records, notes, and mileage. Persists without modifying frozen Drift Schema 7. | **VERIFIED PASS** |
| **VIN-01** | OCR / Camera VIN Scanner | Camera-based barcode and OCR scanner for instant motorcycle VIN decoding. *(Manual dropdown selection is fully functional).* | **PARTIALLY IMPLEMENTED** *(Roadmap)* |
---
## 6. Subsystem 5: Community Social Feed & Kudos
A dedicated social experience tailored for motorcycle riders, canyon carvers, and pack squadrons.
### Feature Specifications
| Feature ID | Screen / Component | Implementation Details | Verified Status |
| :--- | :--- | :--- | :---: |
| **SOC-01** | Canyon & Squad Feed (`/social/feed`) | Community ride cards featuring custom vector route painter (`_FeedRoutePainter`) with cyan path, amber sweep, apex degree badges, and 2x2 telemetry summary. | **VERIFIED PASS** |
| **SOC-02** | Fist Bump Kudos Reaction | Glove-friendly 1-tap reaction counter with optimistic UI updates (42 $\rightarrow$ 43), cyan glow animation, and persistent local state. | **VERIFIED PASS** |
| **SOC-03** | Rider Comments Drawer | Threaded discussion bottom sheet drawer with comment composer, optimistic posting, and navigation persistence. | **VERIFIED PASS** |
| **SOC-04** | Telemetry Waveform Inspector | Interactive modal displaying high-frequency telemetry waveforms (speed, lean angle, longitudinal/lateral G) with touch scrubbers. | **VERIFIED PASS** |
| **SOC-05** | Social Hub Navigation (`/social`) | Central hub providing navigation tiles to Rider Profile, Friends Roster, Clubs Directory, and Group Rides Hub. | **VERIFIED PASS** |
| **SOC-06** | Clubs Access Barrier | Unauthenticated guest riders tapping Clubs are safely stopped at an authentication barrier modal. | **VERIFIED PASS** |
| **SOC-07** | Group Rides Access Barrier | Unauthenticated guest riders tapping Group Rides are safely stopped at an authentication barrier modal. | **VERIFIED PASS** |
---
## 7. Subsystem 6: Curvy Route Planning & Twistiness Analysis
Algorithmic routing designed specifically for motorcyclists seeking twisty roads, elevation changes, and mountain passes.
### Feature Specifications
| Feature ID | Screen / Component | Implementation Details | Verified Status |
| :--- | :--- | :--- | :---: |
| **ROUT-01** | Curviness Priority Routing | Multi-tier routing priority: `Standard`, `Curvy`, and `Extreme Passes`. Generates cross-section elevation profiles and corner count breakdowns. | **VERIFIED PASS** |
| **ROUT-02** | Corner Twistiness Grading | Analyzes route geometry to classify corners into Sweepers ($>60$ MPH), Bends ($30–60$ MPH), and Hairpins ($<30$ MPH). | **VERIFIED PASS** |
| **ROUT-03** | Navigation App Handoff | 1-click external route export and handoff to Google Maps, Apple Maps, Waze, and GPX 1.1 file export. | **VERIFIED PASS** |
---
## 8. Subsystem 7: Activity History, Forensic Replay & Exports
Forensic data analysis and export tools for riders, track coaches, and safety analysts.
```mermaid
flowchart LR
A[Recorded Ride in SQLite] --> B[Ride Detail Screen]
B --> C[GPX 1.1 Export]
B --> D[20 Hz CSV Export]
B --> E[20 Hz Interactive Replay]
C --> F[GPS Coordinates + Elevation + Time]
D --> G[Full Telemetry: Speed, Lean, G-Forces, Heading]
E --> H[Multi-Color Heatmap: Yellow <20 deg, Cyan 20-35 deg, Red >35 deg]
E --> I[Interactive Apex Breakdown Table: Grade A+ to D]
```
### Feature Specifications
| Feature ID | Screen / Component | Implementation Details | Verified Status |
| :--- | :--- | :--- | :---: |
| **ACT-01** | Personal Records & Trophies | Trophy showcases for All-Time Top Speed, 0–60 Launch, Max Left Lean, Max Right Lean, and Longest Ride. | **VERIFIED PASS** |
| **ACT-02** | Ride History Feed | Comprehensive ride log with route preview thumbnails, motorcycle tag, distance, duration, top speed, and sync indicators. | **VERIFIED PASS** |
| **ACT-03** | Ride Detail Telemetry View | Comprehensive summary stats, peak handling dynamics, elevation gain, GPX export button, and Replay CTA. | **VERIFIED PASS** |
| **ACT-04** | Forensic GPX & CSV Export | Extracted `ride_1.gpx` (224 KB, 7,159 lines GPX 1.1 with IMU extensions). CSV export is an entitled Pro feature (`MotorSignalFeature.csvExport`). | **VERIFIED PASS** |
| **ACT-05** | 20 Hz Interactive Replay | Multi-color lean angle route heatmaps, interactive corner entry/apex/exit breakdown table, speed retention grading (`A+` to `D`), and tap-to-seek apex navigation. | **VERIFIED PASS** |
---
## 9. Subsystem 8: Multi-Role Clubs & Group Rides
Squad formation, pack management, and role-based access control for motorcycle clubs and weekend pack rides.
### Organizational Ranks & Permission Matrix (`WEB-13`)
The web platform features an interactive 4-tier organizational hierarchy builder and permission matrix:
1. **Executive Command**: President, Vice President (Full administrative and club disband authority).
2. **Leadership & Admin**: Road Captain, Tail Gunner, Road Marshal (Ride staging, pace control, pack safety).
3. **Tactical Operations**: Treasurer, Secretary (Roster management, dues, applications).
4. **Squad Formation**: Full Member, Prospect (Pack ride participation, wall discussions).
```
Permission Matrix:
├── planRides: Executive, Road Captain, Road Marshal
├── manageApplications: Executive, Secretary
├── postAnnouncements: Executive, Leadership
├── moderateWall: Executive, Road Captain, Road Marshal
├── manageRoster: Executive, Secretary, Treasurer
└── editProfile: Executive Command only
```
### Feature Specifications
| Feature ID | Screen / Component | Implementation Details | Verified Status |
| :--- | :--- | :--- | :---: |
| **GRP-01** | Group Rides Hub (`/group-rides`) | Active pack rides list, join code entry modal, staging location, route link, and pace tier badge. | **VERIFIED PASS** |
| **GRP-02** | Create Group Ride | Staging address, departure time, pace selection (`Scenic`, `Paced`, `Spirited`, `Track Pace`), and rider limit. | **VERIFIED PASS** |
| **GRP-03** | Group Ride Live Radar | Fullscreen radar canvas with moving pack blips, lead/sweep distance delta, and pack proximity indicators. | **VERIFIED PASS** |
| **CLUB-01** | Clubs Directory (`/clubs`) | Searchable directory with riding style filter chips, chapter region, member counts, and Join Request modal. | **VERIFIED PASS** |
| **CLUB-02** | Create Motorcycle Club | Unique club slug validator, monogram crest, chapter region, privacy policy, and founder assignment. | **VERIFIED PASS** |
| **CLUB-03** | Club Wall & Discussion Feed | 3-tab layout (`Overview`, `Club Wall`, `Roster`), pinned announcements, discussion threads, and officer badges. | **VERIFIED PASS** |
| **CLB-01** | Multi-Role Contract Enforcement | Organizer, Club Admin, Participant, and Ineligible role enforcement verified across 17/17 isolated Firebase rules checks. | **VERIFIED PASS** |
---
## 10. Subsystem 9: Web Platform & Rider Portal (`https://motorsignal.app`)
Modern Next.js 14 web platform deployed live at `https://motorsignal.app` (`89.31.239.10`), verified with Chromium DevTools MCP.
### Feature Specifications
| Feature ID | Route | Implementation Details | Verified Status |
| :--- | :--- | :--- | :---: |
| **WEB-01** | `GET /` (Homepage) | Hero HUD mockup (54° Lean, 158 MPH, +1.82G), interactive Laguna Seca lap delta selector, metric counters, conversion CTA. | **VERIFIED PASS** |
| **WEB-02** | `GET /features` | High-fidelity technical diagrams, 20 Hz Kalman vs 1 Hz GPS comparison, SOS crash simulator (+4.8G impact test), engine gauges. | **VERIFIED PASS** |
| **WEB-03** | `GET /pricing` | 3-tier matrix (Free, Pro, Founder), interactive monthly/annual billing toggle ($10/mo annual vs $14/mo monthly), feature comparison table. | **VERIFIED PASS** *(Payment gateway in progress)* |
| **WEB-04** | `GET /download` | Download Hub with dynamic client OS detection, SHA-256 verification checksum box with copy tooltip, instant QR code generator, and sideloading steps. | **VERIFIED PASS** |
| **WEB-05** | `GET /group-rides` | Public group rides showcase with interactive pace filtering pills (`Track Pace`, `Spirited`, `Scenic`). | **VERIFIED PASS** |
| **WEB-06** | `GET /group-rides/showcase`| Fullscreen radar simulation canvas, moving rider blips, pack roster, lead telemetry gauge, simulation scrubber. | **VERIFIED PASS** |
| **WEB-07** | `GET /group-rides/manage` | Authenticated Organizer Console: hosted rides stats, upcoming/completed filter tabs, route attachment. | **VERIFIED PASS** |
| **WEB-08** | `GET /clubs` | Public clubs directory cards, riding discipline filters, founder portal entry point. | **VERIFIED PASS** |
| **WEB-09** | `GET /clubs/manage` | Club Founder Hub: officer command overview, club switcher, and pending applications shortcut. | **VERIFIED PASS** |
| **WEB-10** | `GET /clubs/[id]/manage` | Club Founder Overview: member stats, staged rides, and recent activity log stream. | **VERIFIED PASS** |
| **WEB-11** | `GET /clubs/[id]/manage/profile` | Club Branding Editor: crest uploader, cover banner, tagline, markdown bio, location. | **VERIFIED PASS** |
| **WEB-12** | `GET /clubs/[id]/manage/applications` | Applications Queue: applicant review, questionnaire answers, accept/decline actions. | **VERIFIED PASS** |
| **WEB-13** | `GET /clubs/[id]/manage/ranks-roles` | Interactive visual 4-tier organizational hierarchy tree with rank node selection, member assignment, and 6-privilege permission matrix. | **VERIFIED PASS** |
| **WEB-14** | `GET /clubs/[id]/manage/rides` | Club Rides Schedule: scheduled pack rides calendar, attendance logs, lead/sweep assignments. | **VERIFIED PASS** |
| **WEB-15** | `GET /clubs/[id]/manage/settings` | Club Governance: privacy toggles, join codes, ownership transfer, disband club danger zone. | **VERIFIED PASS** |
| **WEB-16** | `GET /clubs/[id]/manage/members` | **Members Roster Management**: Searchable member roster table, role badges, display rank editor modal, and member removal lifecycle with atomic count updates. | **VERIFIED PASS** |
| **WEB-17** | `GET /clubs/[id]/manage/routes` | **Club Curated Routes**: Interactive route catalog with elevation profiles, curvature ratings, distance metrics, GPX export, and Curate Route modal. | **VERIFIED PASS** |
| **WEB-18** | `GET /clubs/[id]/manage/wall` | **Club Discussion Wall**: Real-time announcement pins, discussion posts, comment threads, kudos reactions, and moderation deletion. | **VERIFIED PASS** |
| **WEB-19** | `GET /clubs/[id]/manage/chat` | **Club Live Chat**: Real-time squad messaging rooms (`#general-squad`, `#officers-lounge`, `#road-intel`), rank badges, and officer authorization barriers. | **VERIFIED PASS** |
| **WEB-20** | `GET /clubs/[id]/manage/stats` | **Club Analytics & Stats**: Aggregate club mileage, ride attendance distributions, pace breakdown, and active roster metrics. | **VERIFIED PASS** |
| **WEB-21** | `GET /clubs/[id]/manage/moderation` | **Club Moderation**: Multi-area review dashboard (Applications queue, Wall discussion triage, Member roster audit) with role gating. | **VERIFIED PASS** |
| **WEB-22** | `GET /forgot-password` | 2-step cryptographic password recovery workflow: registered email input $\rightarrow$ 6-digit OTP verification challenge $\rightarrow$ password reset. | **VERIFIED PASS** |
| **WEB-23** | `GET /verify-email` | 6-digit segmented numeric OTP input with auto-advance, backspace navigation, paste handling, and 60-second resend countdown timer. | **VERIFIED PASS** |
| **WEB-24** | `GET /account` | Rider Portal with 1-click GPX and 20 Hz CSV export buttons, and in-browser interactive canvas telemetry replay player. | **VERIFIED PASS** |
---
## 11. Subsystem 10: Operations Console & SRE Management (`/admin`)
Privileged administrative control center for infrastructure health, systemd service management, customer support, and dynamic website CMS.
```mermaid
graph TD
Admin[Operator / Owner Login] --> AuthBarrier{Role Check: owner/operator?}
AuthBarrier -- Denied --> Redirect[HTTP 307 Redirect to /login]
AuthBarrier -- Allowed --> OpsConsole[Operations Console /admin]
OpsConsole --> TabOverview[Overview: Health, Backlog, Access Events]
OpsConsole --> TabInfra[Infrastructure: Dual Speedtest & Systemd Logs]
OpsConsole --> TabSupport[Support Center: Pre-filled Ticket Creator]
OpsConsole --> TabCMS[Website CMS: Documents, Preview, Rollback]
OpsConsole --> TabAudit[Audit Logging: Immutable Administrative Events]
```
### Feature Specifications
| Feature ID | Screen / Component | Implementation Details | Verified Status |
| :--- | :--- | :--- | :---: |
| **OPS-01** | Access Barrier & Security | Hard HTTP 307 redirect for unauthenticated requests. Enforces `owner` and `operator` role requirements via session tokens. | **VERIFIED PASS** |
| **OPS-02** | Dual Speedtest Subsystem | Tabbed speedtest interface supporting both **Client $\rightarrow$ Server** (browser to MotorSignal host) and **Server $\rightarrow$ External** (MotorSignal server to upstream internet). | **VERIFIED PASS** *(6/6 tests passing)* |
| **OPS-03** | Support Center Ticket Creation | Ticket creation modal with pre-filled operator email, category/severity bounds validation, and automated audit event generation. | **VERIFIED PASS** *(8/8 tests passing)* |
| **OPS-04** | Website CMS & Revision Rollback | Document editor for public website content, draft preview, published revision history, and 1-click revision rollback. | **VERIFIED PASS** *(44/44 tests passing)* |
| **OPS-05** | Real-Time Systemd Journal Viewer | Live stream of `motorsignal-website` and `motorsignal-api` systemd service journals with log level filtering. | **VERIFIED PASS** |
---
## 12. Subsystem 11: Backend API & Persistence Pipeline
The backend architecture couples an offline-first mobile database with scalable cloud storage:
```
Telemetry Data Flow:
1. Edge Recording: 20 Hz IMU/GPS stored in Drift SQLite (motorsignal.sqlite)
2. Queue Durability: SyncOutbox maintains durable queue with exponential backoff
3. Binary Telemetry Bundle: Uploaded to Cloudflare R2 object storage
4. Metadata & Social Links: Synced to Google Cloud Firestore (demo-motorsignal-qa / prod)
5. Backend REST API: FastAPI service running on Python 3.12 with PostgreSQL
```
### Feature Specifications
| Feature ID | Service / Component | Implementation Details | Verified Status |
| :--- | :--- | :--- | :---: |
| **API-01** | Authentication & Sessions | Cookie + Bearer JWT authentication, password hashing with bcrypt, session revocation, and Firebase token exchange. | **VERIFIED PASS** |
| **API-02** | Vehicles & Garage REST API | Full CRUD endpoints (`GET/POST/PATCH/DELETE /api/v1/vehicles`) with user isolation. | **VERIFIED PASS** |
| **API-03** | Rides Ingestion & Telemetry | Endpoints for ride summaries and high-frequency binary telemetry chunk uploads to Cloudflare R2. | **VERIFIED PASS** |
| **API-04** | Operations & Audit Logging | Endpoints for infrastructure metrics, audit events, support tickets, and CMS documents. | **VERIFIED PASS** |
---
## 13. Complete Feature Implementation Catalog (71 Items)
| # | Item Code | Subsystem | Feature Description | Status |
| :---: | :--- | :--- | :--- | :---: |
| 1 | `MOB-01` | Mobile Cockpit | Minimal HUD Speedometer (96pt, GPS fix, timer) | **VERIFIED** |
| 2 | `MOB-02` | Mobile Cockpit | Sport Cockpit (G-meter, Lean silhouette, Peak L/R) | **VERIFIED** |
| 3 | `MOB-03` | Mobile Cockpit | Touring Cockpit (Map pane, Compass, Alerts) | **VERIFIED** |
| 4 | `MOB-04` | Mobile Cockpit | Active Recording State (20 Hz acquisition, wake lock) | **VERIFIED** |
| 5 | `MOB-05` | Mobile Map | Tactical Vector Live Map & Rider Beacon | **VERIFIED** |
| 6 | `MOB-06` | Mobile Map | Tactical Layers Bottom Sheet & Overrides Drawer | **VERIFIED** |
| 7 | `MOB-07` | Mobile Map | Road Alert Overlay Banner & Swarm Warnings | **VERIFIED** |
| 8 | `MOB-08` | Mobile Perf | Performance Launch Screen (0-60, 0-100, 1/4 mile) | **VERIFIED** |
| 9 | `MOB-09` | Mobile Perf | Speed Curve Graph & Density Altitude Calculator | **VERIFIED** |
| 10 | `MOB-10` | Mobile Activity | Activity Rides Feed & Route Thumbnails | **VERIFIED** |
| 11 | `MOB-11` | Mobile Activity | All-Time Personal Records Trophies | **VERIFIED** |
| 12 | `MOB-12` | Mobile History | Ride Detail View & Handling Metrics | **VERIFIED** |
| 13 | `MOB-13` | Mobile History | 20 Hz Forensic Replay & Apex Grading | **VERIFIED** |
| 14 | `MOB-14` | Mobile Garage | Virtual Garage Motorcycle Stable | **VERIFIED** |
| 15 | `MOB-15` | Mobile Garage | Add Motorcycle Wizard (Dropdown Lookup) | **VERIFIED** |
| 16 | `MOB-16` | Mobile Garage | Maintenance Interval Due Tracking & Service Logs | **VERIFIED** |
| 17 | `MOB-17` | Mobile Routes | Curvy Route Twistiness Selector & Elevation Chart | **VERIFIED** |
| 18 | `MOB-18` | Mobile Routes | Route Detail & Navigation App Handoff | **VERIFIED** |
| 19 | `MOB-19` | Mobile Social | Canyon & Squad Feed with Route Track Painter | **VERIFIED** |
| 20 | `MOB-20` | Mobile Social | Rider Profile Screen & Bio | **VERIFIED** |
| 21 | `MOB-21` | Mobile Social | Friends Roster & Requests | **VERIFIED** |
| 22 | `MOB-22` | Mobile Clubs | Clubs Hub & Search Directory | **VERIFIED** |
| 23 | `MOB-23` | Mobile Clubs | Create Motorcycle Club Wizard | **VERIFIED** |
| 24 | `MOB-24` | Mobile Clubs | Club Wall Discussion Feed & Member Roster | **VERIFIED** |
| 25 | `MOB-25` | Mobile Group Rides | Group Rides Hub & Staging List | **VERIFIED** |
| 26 | `MOB-26` | Mobile Group Rides | Create Group Ride Form & Pace Selection | **VERIFIED** |
| 27 | `MOB-27` | Mobile Group Rides | Group Ride Briefing & Stage Progression | **VERIFIED** |
| 28 | `MOB-28` | Mobile Group Rides | Live Group Ride Radar Simulation | **VERIFIED** |
| 29 | `MOB-29` | Mobile Pro | Pro Subscription Paywall & Feature Catalog | **VERIFIED** |
| 30 | `MOB-30` | Mobile Settings | App Settings (Units, Audio, Calibration) | **VERIFIED** |
| 31 | `MOB-31` | Mobile Settings | Account & Cloud Identity Screen | **VERIFIED** |
| 32 | `MOB-32` | Mobile Diagnostics | Real-Time Sensor Stream & Constellation Diagnostics | **VERIFIED** |
| 33 | `WEB-01` | Website Public | Homepage with Hero HUD & Interactive Lap Deltas | **VERIFIED** |
| 34 | `WEB-02` | Website Public | Features Tour & Interactive SOS Crash Simulator | **VERIFIED** |
| 35 | `WEB-03` | Website Public | Pricing Matrix with Dynamic Annual/Monthly Billing | **VERIFIED** |
| 36 | `WEB-04` | Website Public | Download Hub (OS Detection, Checksum, QR Code) | **VERIFIED** |
| 37 | `WEB-05` | Website Public | Public Group Rides Showcase & Pace Filtering | **VERIFIED** |
| 38 | `WEB-06` | Website Public | Radar Simulation Canvas & Moving Pack Blips | **VERIFIED** |
| 39 | `WEB-07` | Website Portal | Organizer Group Rides Console | **VERIFIED** |
| 40 | `WEB-08` | Website Public | Public Clubs Directory | **VERIFIED** |
| 41 | `WEB-09` | Website Portal | Club Management Founder Portal | **VERIFIED** |
| 42 | `WEB-10` | Website Portal | Club Dashboard & Activity Stream | **VERIFIED** |
| 43 | `WEB-11` | Website Portal | Club Profile & Crest Customizer | **VERIFIED** |
| 44 | `WEB-12` | Website Portal | Club Membership Application Review | **VERIFIED** |
| 45 | `WEB-13` | Website Portal | 4-Tier Visual Hierarchy Builder & RBAC Matrix | **VERIFIED** |
| 46 | `WEB-14` | Website Portal | Club Rides Schedule & Attendance Logs | **VERIFIED** |
| 47 | `WEB-15` | Website Portal | Club Settings & Danger Zone | **VERIFIED** |
| 48 | `WEB-16` | Website Public | Support Center & Knowledge Base | **VERIFIED** |
| 49 | `WEB-17` | Website Legal | Privacy Policy & 20 Hz Anonymization Disclaimers | **VERIFIED** |
| 50 | `WEB-18` | Website Legal | Terms of Service & Track Indemnity | **VERIFIED** |
| 51 | `WEB-19` | Website Auth | Sign-In Screen with Email/Password & Google Auth | **VERIFIED** |
| 52 | `WEB-20` | Website Auth | Registration Screen with Password Strength Meter | **VERIFIED** |
| 53 | `WEB-21` | Website Auth | 2-Step Cryptographic Password Recovery | **VERIFIED** |
| 54 | `WEB-22` | Website Auth | 6-Digit Segmented OTP Email Verification | **VERIFIED** |
| 55 | `WEB-23` | Website Portal | Rider Portal & In-Browser Canvas Telemetry Replay | **VERIFIED** |
| 56 | `WEB-24` | Website Admin | Operations Console (`/admin`) Base & Auth Guard | **VERIFIED** |
| 57 | `OPS-01` | Ops Console | SRE Overview Dashboard & Subsystem Health Cards | **VERIFIED** |
| 58 | `OPS-02` | Ops Console | Dual Speedtest (Client->Server & Server->External) | **VERIFIED** |
| 59 | `OPS-03` | Ops Console | Support Center Ticket Creator with Operator Email | **VERIFIED** |
| 60 | `OPS-04` | Ops Console | Website CMS Revisions & 1-Click Rollback | **VERIFIED** |
| 61 | `OPS-05` | Ops Console | Live Systemd Journal Logs Viewer | **VERIFIED** |
| 62 | `API-01` | Backend REST | Authentication, JWT Sessions & Firebase Linking | **VERIFIED** |
| 63 | `API-02` | Backend REST | Vehicle Stable CRUD Endpoints | **VERIFIED** |
| 64 | `API-03` | Backend REST | Rides & Binary Telemetry Ingestion Endpoints | **VERIFIED** |
| 65 | `API-04` | Backend REST | Operations Infrastructure & Audit Logging Endpoints | **VERIFIED** |
| 66 | `API-05` | Backend REST | Support Tickets & CMS Document Endpoints | **VERIFIED** |
| 67 | `VIN-01` | Mobile Garage | Camera Barcode / OCR VIN Scanner | **PARTIAL** |
| 68 | `BILL-01`| Website Billing | Web Stripe Checkout & Webhook Handler | **PARTIAL** |
| 69 | `EMAIL-01`| Backend Comms | Live Transactional SMTP / Resend Email Dispatcher | **PARTIAL** |
| 70 | `HW-01` | Hardware Link | Bluetooth OBD-II CAN-Bus Engine Data Link | **HARDWARE REQ** |
| 71 | `HW-02` | Hardware Link | Off-Grid Peer-to-Peer BLE Mesh Pack Radar | **HARDWARE REQ** |
| 72 | `WEB-16` | Website Portal | Club Management: Members Roster (`/clubs/[id]/manage/members`) | **VERIFIED** |
| 73 | `WEB-17` | Website Portal | Club Management: Curated Routes (`/clubs/[id]/manage/routes`) | **VERIFIED** |
| 74 | `WEB-18` | Website Portal | Club Management: Discussion Wall (`/clubs/[id]/manage/wall`) | **VERIFIED** |
| 75 | `WEB-19` | Website Portal | Club Management: Squad Live Chat (`/clubs/[id]/manage/chat`) | **VERIFIED** |
| 76 | `WEB-20` | Website Portal | Club Management: Pack Analytics & Stats (`/clubs/[id]/manage/stats`) | **VERIFIED** |
| 77 | `WEB-21` | Website Portal | Club Management: Moderation Queue (`/clubs/[id]/manage/moderation`) | **VERIFIED** |
---
## 14. Remaining Scope & Recommended Implementation Roadmap
```mermaid
flowchart TD
subgraph S1 [Phase 1 COMPLETE: Web Founder Portal Full Suite]
FP1["Members Roster: /clubs/[id]/manage/members (VERIFIED)"]
FP2["Club Wall: /clubs/[id]/manage/wall (VERIFIED)"]
FP3["Club Routes: /clubs/[id]/manage/routes (VERIFIED)"]
FP4["Club Chat: /clubs/[id]/manage/chat (VERIFIED)"]
FP5["Club Stats: /clubs/[id]/manage/stats (VERIFIED)"]
FP6["Club Moderation: /clubs/[id]/manage/moderation (VERIFIED)"]
end
subgraph S2 [Priority 1: Web Monetization & Payment Gateways]
W1["WEB-03 / BILL-01: Stripe Checkout Integration"]
W2["POST /api/v1/billing/create-checkout-session"]
W3["Stripe Webhook Listener for Pro Entitlement Activation"]
end
subgraph S3 [Priority 2: Live Communications & Real-Time SMTP]
G2["EMAIL-01: Resend / SendGrid Live Transactional Email Transport"]
G3["Real-time WebSocket / FCM Push Notifications for Pack Alerts"]
end
subgraph S4 [Priority 3: Mobile Hardware & Camera Tooling]
M1["MOB-15 / VIN-01: ML Kit Camera OCR VIN Scanner"]
H1["HW-01: Bluetooth ELM327 OBD-II CAN-Bus ECU Link"]
H2["HW-02: Off-Grid Peer-to-Peer BLE Mesh Pack Radar"]
end
S1 --> S2 --> S3 --> S4
```
1. **Phase 1 Complete: Web Founder Portal Core & Advanced Modules (100% Operational)**:
- `Members` (`/clubs/[id]/manage/members`): Searchable roster, officer rank editor, member removal with atomic count updates.
- `Wall` (`/clubs/[id]/manage/wall`): Announcement pinning, discussion posts, threaded replies, and kudos reactions.
- `Routes` (`/clubs/[id]/manage/routes`): Curated club route catalog, GPX download, elevation/curvature badges, and route curation modal.
- `Chat` (`/clubs/[id]/manage/chat`): Real-time squad messaging rooms (`#general-squad`, `#officers-lounge`, `#road-intel`) with role access control.
- `Stats` (`/clubs/[id]/manage/stats`): Real-time metrics on member roster, confirmed ride attendance, and pace breakdown.
- `Moderation` (`/clubs/[id]/manage/moderation`): Unified moderation hub across applications, discussion wall posts, and roster management.
- All `[SOON]` navigation badges and disabled attributes removed from `founder-sidebar.tsx`.
2. **Priority 1: Web Stripe Payment Gateway (`WEB-03` / `BILL-01`)**:
- Integrate Stripe Elements on `/pricing` to allow web riders to subscribe to MotorSignal Pro via credit card.
- Implement `POST /api/v1/billing/create-checkout-session` and Stripe webhook listener in FastAPI backend.
3. **Priority 2: Live Transactional Email Transport (`EMAIL-01`)**:
- Wire live transactional SMTP or Resend API provider for OTP verification and password reset emails in production.
4. **Priority 3: Camera OCR VIN Scanner (`MOB-15` / `VIN-01`)**:
- Integrate Google ML Kit Text Recognition in Flutter for instant motorcycle VIN barcode scanning.
5. **Priority 4: Physical Hardware Road Validation (`HW-01`..`04`)**:
- Implement Bluetooth ELM327 protocol parser for real-time engine RPM, gear selection, and throttle position.
- Implement BLE peripheral and central profiles for off-grid pack radar (`RAD-01`).