How madtechsolutions2026/ride-for-you-app works
Ride For You is an EV rental prototype with a wired OTP identity flow and broader rider/admin rental operations. A rider requests and verifies an OTP, receives tokens, then the app loads their profile; the mobile client attaches access tokens and refreshes expired sessions. Admin screens support operational domains through the backend API. Rental, KYC, payments, support, and fleet-related capabilities are present in the repository, though the README explicitly describes much of the rider booking experience as static UI. Backend route and database details beyond cited excerpts are represented only where README or SOURCE INDEX evidence supports them.
Main entry points: app.ts API assembly · App.tsx Admin routing · client.ts API client · rental.controller.ts Rental operations
Components 34
Rider mobile app
- App navigation
mobile/App.tsx - OTP screens
mobile/src/screens/RequestOtpScreen.tsx - Profile and session
mobile/src/screens/ProfileScreen.tsx - API client
mobile/src/api/client.ts - Token storage
mobile/src/api/tokenStore.ts - Rental screens
mobile/src/screens/HomeScreen.tsx
Admin console
- Admin routing
admin/src/App.tsx - Admin auth
admin/src/context/AuthContext.tsx - Admin API client
admin/src/api/client.ts - Operations console
admin/src/pages/Overview.tsx - KYC review
admin/src/pages/KycReview.tsx - Service recovery
admin/src/pages/ServiceRecovery.tsx
Backend API
- API assembly
backend/src/app.ts - Auth routes
backend/src/routes/auth.routes.ts - OTP and sessions
backend/src/controllers/auth.controller.ts - Token guard
backend/src/middleware/auth.ts - Rental routes
backend/src/routes/rental.routes.ts - Rental operations
backend/src/controllers/rental.controller.ts - Rides and damage
backend/src/controllers/ride.controller.ts - KYC workflow
backend/src/controllers/kyc.controller.ts - Admin routes
backend/src/routes/admin.routes.ts - Fleet recovery
backend/src/controllers/ops.controller.ts - Rider support
backend/src/controllers/support.controller.ts
Backend services and data
- Wallet ledger
backend/src/services/wallet.ts - Rent collections
backend/src/services/collections.ts - Weekly billing
backend/src/services/weeklyBilling.ts - Notifications
backend/src/utils/notifications.ts - File uploads
backend/src/utils/uploads.ts - Object storage
backend/src/utils/r2.ts - Cache
backend/src/utils/cache.ts - Application database
backend/src/utils/prisma.ts
Other components
- Rider
- Admin operator
- Expo push service
Connections 42
- Rider → OTP screens: enters phone and code
- OTP screens → API client: requests authentication
- App navigation → API client: pings health
mobile/App.tsx - App navigation → OTP screens: routes to
mobile/App.tsx - App navigation → Profile and session: routes after login
mobile/App.tsx - API client → Token storage: reads and refreshes tokens
mobile/src/api/client.ts - API client → API assembly: calls API
- Profile and session → API client: loads profile
mobile/src/screens/ProfileScreen.tsx - Rider → Rental screens: uses rental features
- Admin operator → Admin routing: uses console
admin/src/App.tsx - Admin routing → Admin auth: checks identity
admin/src/App.tsx - Admin routing → Operations console: routes to operations
admin/src/App.tsx - Admin routing → KYC review: routes to review
admin/src/App.tsx - Admin routing → Service recovery: routes to recovery
admin/src/App.tsx - Admin auth → Admin API client: uses API client
admin/src/context/AuthContext.tsx - KYC review → Admin API client: calls API
admin/src/pages/KycReview.tsx - Service recovery → Admin API client: calls API
admin/src/pages/ServiceRecovery.tsx - Admin API client → API assembly: calls API
- API assembly → Auth routes: mounts routes
backend/src/app.ts - API assembly → Rental routes: mounts routes
backend/src/app.ts - API assembly → Admin routes: mounts routes
backend/src/app.ts - Auth routes → OTP and sessions: dispatches requests
- OTP and sessions → Application database: reads and writes sessions
- Rental routes → Rental operations: dispatches requests
backend/src/routes/rental.routes.ts - Rental routes → Rides and damage: dispatches ride requests
backend/src/routes/rental.routes.ts - Admin routes → KYC workflow: routes review calls
backend/src/routes/admin.routes.ts - Admin routes → Fleet recovery: routes operations
backend/src/routes/admin.routes.ts - Admin routes → Rider support: routes ticket calls
backend/src/routes/admin.routes.ts - Token guard → Application database: loads account
backend/src/middleware/auth.ts - Token guard → Cache: reads and caches account
backend/src/middleware/auth.ts - Rental operations → Wallet ledger: debits wallet
backend/src/controllers/rental.controller.ts - Rental operations → Rent collections: settles dunning
backend/src/controllers/rental.controller.ts - Fleet recovery → Rent collections: marks recovery
backend/src/controllers/ops.controller.ts - Fleet recovery → Notifications: sends rider notices
backend/src/controllers/ops.controller.ts - KYC workflow → Object storage: stores documents
backend/src/controllers/kyc.controller.ts - KYC workflow → Cache: invalidates cache
backend/src/controllers/kyc.controller.ts - Rides and damage → File uploads: uploads damage photos
backend/src/controllers/ride.controller.ts - File uploads → Object storage: stores objects
backend/src/utils/uploads.ts - Rental operations → Notifications: sends rider notices
backend/src/controllers/rental.controller.ts - API assembly → Weekly billing: starts billing
backend/src/app.ts - Notifications → Application database: records notifications
backend/src/utils/notifications.ts - Notifications → Expo push service: delivers push
backend/src/utils/notifications.ts