How alpadrive/app works
1. This is a React Native mobile app built with the Expo workflow. The repository is almost entirely the client-side app shell and feature screens; there is no backend code here, so the main boundary is between the mobile UI and external services.
2. App.js is the root entry point. In a repo like this, it typically owns the top-level navigation container and initial routing decisions, such as whether the user lands in auth/onboarding flows or the main vehicle dashboard.
3. The UI is organized as screen-level modules under src/screens. Each screen has its own *.js component plus a sibling styles.js, which makes the architectural boundary very clear: feature logic is scoped per screen, while layout/styling stays local to that feature.
4. The screen set suggests the product flow:
- Landing, Login, and SignUp form the user access/authentication path.
- Connect, Pairing, and Ques appear to support device/vehicle setup and onboarding, likely including QR-based pairing mentioned in the README.
- Home, Profile, Share, and Empty look like post-login app areas, with Empty likely used as a placeholder or no-data state.
- Stats is a dedicated analytics/telemetry area.
5. Stats is the most internally structured feature. It contains subcomponents for Daily, Overall, and Periodic, plus an Overall/ProgressBar.js helper. That indicates a small feature hierarchy: the stats screen composes multiple time-scope views and visualizes progress/health metrics.
6. The app’s main data flow is user-driven UI events -> screen-local logic -> network calls to the alpaDrive API server -> refreshed UI state. The README explicitly calls out normal network calls for server communication, so the mobile app is a presentation/control layer over remote vehicle and account data.
7. External integrations matter to the architecture. The README mentions Google Maps API support, so location tracking is likely rendered through a map service rather than a purely custom visualization. QR code scanning is also part of the intended pairing flow, which means the app has a hardware/device onboarding path in addition to standard auth.
8. There is no obvious global state-management directory, service layer, or backend client abstraction in the file tree. That suggests the app is organized primarily around screen components, with shared behavior likely kept minimal and co-located rather than centralized in a large domain layer.
9. Shared static resources live under src/assets, including configs.js and image assets. configs.js is the likely place for app-wide constants such as endpoints, theme values, or feature configuration, while image assets support the branded mobile UI.
10. Styling is mostly co-located per screen/component. That keeps each feature self-contained and makes it easy to map UI sections in an architecture diagram without needing a separate design-system package.
11. The repository also includes Expo/EAS configuration files (app.json, eas.json, babel.config.js), which means runtime behavior and build/deploy are handled through Expo tooling rather than custom native project setup.
12. In diagram terms, the key architectural blocks are: Expo app shell, navigation/root entry, auth/onboarding screens, vehicle control and pairing screens, stats/telemetry screens, shared assets/configuration, and external dependencies such as the API server, QR scanner flow, and Google Maps.
Main entry points: Stats.js Stats · App.js App.js · Home.js Home · Login.js Login
Components 21
Access flow
Landing, login, and sign-up screens
Pairing flow
Device and vehicle setup screens
Main app
Post-login app areas and profile views
Stats
Telemetry and analytics screens
- Stats · Telemetry and analytics hub
src/screens/Stats/Stats.js - Daily · Daily stats breakdown
src/screens/Stats/components/Daily/Daily.js - Overall · Aggregate stats summary
src/screens/Stats/components/Overall/Overall.js - Progress bar · Overall progress visualization
src/screens/Stats/components/Overall/ProgressBar.js - Periodic · Time-windowed stats breakdown
src/screens/Stats/components/Periodic/Periodic.js
Shared assets
Common config and static resources
External services
Remote APIs and third-party integrations
- API server · alpaDrive backend for account and vehicle data
- Google Maps · Location and map rendering support
- QR scan · QR-based pairing integration
Connections 25
- App.js → Landing: routes to · Initial route into access flow
- App.js → Login: routes to · Auth navigation entry
- App.js → Home: routes to · Main app entry after access
- Landing → Login: auth path · Landing leads into login
- Landing → Sign Up: auth path · Landing leads into sign-up
- Login → API server: auth call · Validates credentials against backend
- Sign Up → API server: create account · Sends registration data to backend
- Home → Connect: setup · Leads into vehicle connection flow
- Connect → Pairing: pair vehicle · Moves into pairing step
- Pairing → QR scan: scan · Uses QR-based device pairing
- Pairing → API server: register device · Sends pairing result to backend
- Connect → Ques: onboard · Collects onboarding questions
- Home → Stats: open stats · Navigates to telemetry views
- Stats → Daily: composes · Stats screen includes daily view
- Stats → Overall: composes · Stats screen includes overall view
- Stats → Periodic: composes · Stats screen includes periodic view
- Overall → Progress bar: uses · Overall view renders progress visualization
- Stats → API server: fetch stats · Loads telemetry and vehicle metrics
- Home → Google Maps: map view · Location or trip views rely on map service
- Profile → API server: profile data · Reads and updates account data
- Share → API server: share data · Coordinates sharing via backend data
- Configs → App.js: configure · Shared constants inform app startup
- Configs → Login: configure · Screen-level configuration values
- Configs → Stats: configure · Shared metric or UI settings
- Images → App.js: assets · Branded media used by the app shell