https://github.com/maximcoding/driver-shield-mobile
DriveShield mobile app + design reference โ converting the design demo into React Native
https://github.com/maximcoding/driver-shield-mobile
Last synced: 12 days ago
JSON representation
DriveShield mobile app + design reference โ converting the design demo into React Native
- Host: GitHub
- URL: https://github.com/maximcoding/driver-shield-mobile
- Owner: maximcoding
- Created: 2026-06-17T08:22:51.000Z (20 days ago)
- Default Branch: main
- Last Pushed: 2026-06-17T08:46:40.000Z (20 days ago)
- Last Synced: 2026-06-17T10:22:47.034Z (20 days ago)
- Language: JavaScript
- Size: 3.4 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DriveShield Mobile
**Tamper-proof drive recording that protects drivers when it matters most.**
## ๐ก The idea
DriveShield is a mobile app that produces **tamper-proof evidence of how a driver actually drove**.
When a driver turns **Protection ON**, the app records GPS + speed telemetry for the trip, scores
how complete that recording was (**coverage**), and generates an immutable **verdict** โ e.g.
"No speeding events found (High coverage)". If a dispute arises (an insurer, employer, or
authority claims the driver was speeding), the driver can run an **Evidence Check** for a vehicle
and date/time and get a clear, verifiable answer backed by a session hash. The driver is protected
**only by what was actually monitored** โ no guessing, no smoothing, no after-the-fact edits.
## โจ Features
**Product**
- ๐ก๏ธ **Protection toggle** โ start/stop tamper-proof recording per trip
- ๐ **Drive sessions** โ GPS + speed telemetry captured while protection is ON
- ๐ **Coverage scoring** โ HIGH / MEDIUM / LOW / NOT_MONITORED based on data completeness
- โ๏ธ **Verdicts** โ immutable, canonical results (speeding / no speeding / insufficient coverage)
- ๐ **Evidence Check** โ query by vehicle + date/time โ matched session and verdict
- ๐งพ **Trip history & details** โ sessions, segments, gap intervals, event details
- ๐ **Vehicles** โ add/edit/select default vehicle
- ๐ณ **Subscription** โ paywall, free trial, checkout, invoices, manage plan
- ๐ **Evidence integrity** โ finalized sessions are immutable; SHA-256 session hash
**Engineering foundation** (from [react-native-bare-starter](https://github.com/maximcoding/react-native-bare-starter))
- ๐งฑ Bare React Native 0.82 (no Expo) + React 19, **strict TypeScript**
- ๐งญ React Navigation 7 โ stacks, tabs, modals
- ๐ฆ TanStack Query 5 โ caching, retries, persistence
- ๐ชถ Zustand 5 โ light, hook-based state
- โก MMKV 4.3 storage via Nitro Modules (offline-first)
- ๐ก Offline-ready โ query persistence, queue/replay, transport offline mode
- ๐ Pluggable transport โ REST / GraphQL / WebSocket / Firebase adapters
- ๐จ Theming โ light/dark with semantic tokens + `useTheme()`
- ๐ i18next 25 โ typed translations (EN/DE/RU) via `useT()`
- ๐ผ๏ธ SVG icons via `npm run gen:icons`; BootSplash 6
- ๐งช Biome 2, Jest 29, Maestro E2E
This repository contains the DriveShield **mobile frontend** and its **design reference**. The
current goal is to **convert the design demo into the React Native app** โ building real screens
on top of the existing foundation (theme tokens, UI kit, navigation shell).
> **Built on:** the React Native app in `client/DriveShield` is built on top of the
> [**react-native-bare-starter**](https://github.com/maximcoding/react-native-bare-starter)
> template (bare RN 0.82, TypeScript, React Navigation 7, TanStack Query, Zustand, MMKV,
> offline-ready transport, theming, i18next, Biome/Jest). Extend that foundation โ do not rebuild
> theme, navigation, state, or folder structure from scratch. See the starter's README for the
> full architecture and conventions.
## Repository layout
```
driver-shield-mobile/
โโโ client/ # React Native mobile app (bare workflow, TypeScript)
โ โโโ AGENTS.md # โ READ FIRST before any client work
โ โโโ DriveShield/ # The RN project
โโโ uix-design/ # React + Vite design demo = visual source of truth
โโโ AGENTS.md # Design system rules
โโโ demo/ # Runnable demo (all screens, UI kit, tokens)
โโโ src/ # theme/, ui/, screens/, data/
```
## The task
Convert the `uix-design` demo screens into real React Native screens in `client/DriveShield`.
- **`uix-design`** is the **design source of truth** โ every screen, the UI kit, tokens, and
states already exist there as a runnable React/Vite demo.
- **`client/DriveShield`** is the **target** โ a React Native starter with theme tokens, a shared
UI Kit, an i18n setup, and a navigation shell already in place. Screens are currently
placeholders.
Your job is to implement the real screens in the client so the mobile app matches the demo.
**Deliverable: a fully clickable prototype.** No real backend in this phase โ the whole app must
be **clickable, with working navigation and changing states, fully driven by mock data** behind a
service layer that mimics backend integration (loading/empty/error/content included). It should
feel indistinguishable from the finished app, except the data is mocked โ so when the real API
arrives, only the mock layer is swapped and screens/navigation stay untouched.
๐ **Start here: [BUILD_GUIDE.md](BUILD_GUIDE.md)** โ step-by-step instructions for reusing the
design system, tokens, theme, and UI Kit so the app looks and behaves exactly like the demo,
including token/component mapping tables and a per-screen Definition of Done.
### Ground rules (see `client/AGENTS.md` for the full list)
1. **Tokens only** for styling โ no raw hex/rgb, no magic spacing/size/radius values.
2. **i18n for all visible text** โ no hardcoded strings in JSX.
3. **No duplicate UI** โ repeated UI becomes a shared component/variant.
4. **Alias imports only** (`@/features/...`, `@/shared/...`, `@/navigation/...`, `@/i18n/...`) โ no `../../../`.
5. **Strict TypeScript** โ no `any`.
6. **No new dependencies** without approval.
7. **`uix-design` is the visual reference** โ the mobile app must match the demo.
8. After each phase: run iOS, run Android, run lint, commit a checkpoint.
## Getting started
### Design demo (React + Vite)
```bash
cd uix-design/demo
npm install
npm run dev # http://localhost:5173
```
### Mobile app (React Native)
```bash
cd client/DriveShield
cp .env.example .env # fill in values
npm install
npx pod-install ios # iOS only (macOS)
npm start # Metro bundler
npm run ios # build + run on iOS simulator
npm run android # build + run on Android emulator
npm run lint # Biome
npm test # Jest
```
> **Note:** `.env` is gitignored. Use `.env.example` as the template. Never commit secrets.
## Mobile stack
- React Native 0.82 + React 19, TypeScript (strict)
- Navigation: React Navigation 7 (native-stack + bottom-tabs)
- State/data: Zustand + TanStack Query, MMKV (offline-first)
- Theme + i18n: custom token theme + i18next (EN/DE/RU)
- Reanimated 4, Gesture Handler, SVG, Vector Icons
- Tooling: Biome, Jest, Husky
## React Native project structure (`client/DriveShield`)
Feature-first architecture inherited from the boilerplate. **Build new screens inside
`src/features//screens/` and shared UI inside `src/shared/components/ui/` โ do not
introduce a new architecture.**
```
client/DriveShield/
โโโ App.tsx # Root: providers (theme, query, i18n, nav)
โโโ index.js # RN entry point
โโโ app.json # App name / config
โโโ babel.config.js # Babel + module-resolver (@/ aliases)
โโโ metro.config.js # Metro + SVG transformer
โโโ tsconfig.json # Strict TS + path aliases
โโโ biome.json # Lint/format config
โโโ jest.config.js # Test config
โโโ .env.example # Env template (copy โ .env, gitignored)
โ
โโโ android/ # Native Android project (Gradle)
โโโ ios/ # Native iOS project (Xcode workspace, Podfile)
โโโ assets/ # Fonts, images, bootsplash logo
โโโ maestro/ # E2E smoke flows (iOS + Android)
โโโ scripts/ # Icon/bootsplash/env generators
โ
โโโ src/
โโโ config/ # App constants + feature flags
โ
โโโ features/ # โญ Feature-first โ each feature is self-contained
โ โโโ auth/ # sign-in / phone / OTP / terms
โ โ โโโ api/ # request builders
โ โ โโโ hooks/ # feature hooks (queries/mutations)
โ โ โโโ screens/ # โญ screens go here
โ โ โโโ services/ # feature service layer
โ โ โโโ types/ # feature TypeScript types
โ โโโ home/ # home / feed / session entry
โ โโโ settings/ # settings + reusable settings rows
โ โ โโโ components/ # feature-local components
โ โ โโโ screens/
โ โโโ user/ # profile / me
โ
โโโ navigation/ # React Navigation setup
โ โโโ root/ # root navigator + param lists
โ โโโ tabs/ # bottom tab bar (the "Dock")
โ โโโ helpers/ # typed navigation helpers
โ โโโ persistence/ # nav state persistence
โ โโโ routes.ts # route name constants
โ
โโโ i18n/ # i18next setup
โ โโโ locales/ # en / de / ru translation files
โ โโโ useT.ts # typed translation hook
โ
โโโ session/ # Drive-session domain (protection/telemetry)
โ
โโโ shared/ # โญ Cross-feature building blocks
โโโ components/ui/ # โญ shared UI Kit (Button, Card, Sheets, โฆ)
โโโ hooks/ # generic hooks (useForm, useDebouncedValue, โฆ)
โโโ stores/ # Zustand global stores
โโโ theme/ # โญ design system
โ โโโ tokens/ # brand, spacing, radius, typography, elevation, fonts
โ โโโ light.ts # light theme
โ โโโ dark.ts # dark theme
โ โโโ ThemeProvider.tsx
โ โโโ useTheme.ts # useTheme() hook โ theme.colors / spacing / radius / typography
โโโ services/ # infra
โ โโโ api/ # http client, query layer, offline, transport adapters
โ โโโ storage/ # MMKV wrapper
โ โโโ monitoring/ # error/perf hooks
โโโ types/ # shared types
โโโ utils/ # helpers (platform, formatting, โฆ)
```
**Where things go**
- New screen โ `src/features//screens/MyScreen.tsx`
- Reused UI (used by 2+ screens) โ `src/shared/components/ui/`
- Colors / spacing / radius / fonts โ `src/shared/theme/` (tokens + `light.ts`/`dark.ts`)
- Visible text โ `src/i18n/locales/` (use `useT()`)
- Routes โ `src/navigation/`
- Import with aliases only: `@/features/...`, `@/shared/...`, `@/navigation/...`, `@/i18n/...`
## Design demo stack
- React 18 + Vite 5 (JSX), Framer Motion
- Custom design system โ tokens (`T`, `L`) + hand-built UI kit (no UI library)