Skip to content

interchained/rideFlow

Repository files navigation

πŸš— RideFlow

Better rides, better pay.

An open-source ride-sharing platform where drivers keep 82% of every fare.

Real GPS. Real maps. Real transparency. Built for iOS, Android, and the web from a single codebase.


License Platform Expo React Native Driver Share


Welcome screen Rider map Admin dashboard

✨ Why RideFlow?

Most ride-hailing apps hide how the money is split. RideFlow does the opposite β€” every fare is transparent, and drivers keep 82% by default (the platform fee is fully configurable from the admin panel). It ships with three real, role-aware experiences and uses native device capabilities instead of mock data.

  • πŸ—ΊοΈ Real maps & GPS β€” react-native-maps on mobile, Leaflet/OpenStreetMap on web, live location via expo-location.
  • πŸ’Έ Transparent compensation β€” riders, drivers, and admins all see exactly how a fare breaks down.
  • πŸ‘₯ Three real roles β€” riders ride, drivers drive and ride, admins run the whole platform.
  • ⭐ Ratings & reviews β€” star ratings with private, admin-only review notes.
  • 🧱 One codebase, three targets β€” iOS, Android, and web from a single Expo project.
  • πŸ’Ύ Durable by default β€” Redis with append-only-file persistence; data survives restarts.

πŸ“± Screens

The rider experience

Riders get a clean, map-first interface: see nearby drivers, drop a pin, and book a ride.

Welcome / role selection Rider map and ride request

The driver experience

Drivers see today's earnings, go online with one tap, and β€” crucially β€” see exactly what share of every fare they keep.

Driver dashboard and earnings

The admin control center

A hidden super-admin panel (revealed via a 5-tap on the version label) with platform revenue, live fleet stats, ride history, user management, and a fully configurable fare engine.

Admin overview All rides with reviews User management Fare configuration

Secure access

Role-aware login, with administration access kept out of the way of everyday users.

Admin login

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Expo / React Native app     β”‚  REST   β”‚      Express.js backend       β”‚
β”‚   (iOS Β· Android Β· Web)       β”‚ ◄─────► β”‚      (TypeScript, tsx)        β”‚
β”‚                               β”‚  JSON   β”‚                               β”‚
β”‚  β€’ Expo Router (file routes)  β”‚         β”‚  β€’ Auth, rides, fares, events β”‚
β”‚  β€’ React Query (server state) β”‚         β”‚  β€’ Static landing page        β”‚
β”‚  β€’ React Context (auth)       β”‚         β”‚            β”‚                  β”‚
β”‚  β€’ AsyncStorage (persistence) β”‚         β”‚            β–Ό                  β”‚
β”‚  β€’ react-native-maps / Leafletβ”‚         β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚   β”‚  Redis (AOF persist)β”‚      β”‚
                                          β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
                                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Frontend keeps as much logic as possible client-side; the backend is a thin persistence + API layer.
  • Backend auto-starts a local Redis instance with AOF persistence on boot β€” no separate DB to provision in dev.

🧰 Tech Stack

Layer Technology
App framework Expo SDK 54 Β· React Native 0.81 Β· React 19
Routing Expo Router (file-based)
Server state TanStack React Query
Local state React Context + AsyncStorage
Maps react-native-maps (mobile) Β· Leaflet + OpenStreetMap (web)
Location expo-location (native) Β· Web Geolocation API
Backend Express 5 Β· TypeScript Β· tsx
Data store Redis (ioredis) with append-only-file persistence
Validation Zod + shared schema (shared/schema.ts)
Typography Inter (Google Fonts)

πŸš€ Getting Started

Prerequisites

  • Node.js 20+
  • Redis available on your machine (the backend will auto-start redis-server on 127.0.0.1:6379 if it's installed and on your PATH)
  • Expo Go app on your phone (optional, for testing on a physical device)

1. Install dependencies

npm install

2. Configure environment

cp .env.example .env
# Edit .env if you need to change the port or backend URL.

3. Start the backend

npm run server:dev

The Express server boots on port 5000, starts Redis, and seeds the admin account on first run.

4. Start the app

In a second terminal:

npm run expo:dev
  • Press w to open the web app, or
  • Scan the QR code with Expo Go to run it on your phone.

The frontend talks to the backend via EXPO_PUBLIC_DOMAIN (default localhost:5000). When testing on a physical device, set it to your machine's LAN address, e.g. EXPO_PUBLIC_DOMAIN=192.168.1.20:5000.


πŸ” Default Credentials

On first boot the backend seeds a single super-admin account:

Role Username Password
Admin admin admin123

Change this immediately for any real deployment. Riders and drivers register themselves through the app's sign-up flow.

To reach the admin login: on the welcome screen, tap the version label (v1.0) five times to reveal the hidden admin entry.


πŸ‘₯ Role Hierarchy

  • Riders β€” ride only. Map, booking, live tracking, and post-ride reviews.
  • Drivers β€” drive and ride. Earnings dashboard, online/offline toggle, ride acceptance & navigation, plus a one-tap switch into rider mode.
  • Admins β€” full platform control: stats, ride oversight, user management (suspend/delete), and the fare engine. Admins can also view the platform as a driver or rider.

πŸ’΅ Fare & Compensation

Fares are computed from a configurable model (editable live in Admin β†’ Settings):

Parameter Default
Base fare $2.50
Per mile $1.75
Per minute $0.35
Minimum fare $5.00
Driver share 82%
Surge pricing Toggle

The remaining 18% is the platform fee β€” change the Driver Share % to whatever your business model requires.


πŸ“‚ Project Structure

rideflow/
β”œβ”€β”€ app/                  # Expo Router screens (file-based routing)
β”‚   β”œβ”€β”€ index.tsx         # Welcome / role selection (hidden admin 5-tap)
β”‚   β”œβ”€β”€ login.tsx         # Role-aware login
β”‚   β”œβ”€β”€ register.tsx      # Registration
β”‚   β”œβ”€β”€ rider.tsx         # Rider interface (map, booking, tracking)
β”‚   β”œβ”€β”€ driver.tsx        # Driver dashboard (earnings, rides, navigation)
β”‚   └── admin.tsx         # Admin control center
β”œβ”€β”€ components/           # Shared UI (maps, modals, error boundary, ...)
β”œβ”€β”€ constants/            # Theme colors
β”œβ”€β”€ lib/                  # Auth context + API/query client
β”œβ”€β”€ server/
β”‚   β”œβ”€β”€ index.ts          # Express bootstrap + CORS
β”‚   β”œβ”€β”€ routes.ts         # All REST endpoints
β”‚   β”œβ”€β”€ storage.ts        # Redis-backed storage (IStorage)
β”‚   └── templates/        # Static landing page
β”œβ”€β”€ shared/
β”‚   └── schema.ts         # Shared types & Zod validation
β”œβ”€β”€ docs/screenshots/     # README imagery
β”œβ”€β”€ .env.example
└── LICENSE               # GPLv3

πŸ›°οΈ API Reference

Auth

  • POST /api/auth/register Β· POST /api/auth/login

Users

  • GET /api/user/:id
  • PUT /api/user/:id/location Β· PUT /api/user/:id/online
  • GET /api/drivers/nearby?lat=&lng=&radius=

Rides

  • POST /api/rides Β· GET /api/rides/:id
  • PUT /api/rides/:id/accept Β· PUT /api/rides/:id/status
  • GET /api/rides/rider/:id Β· GET /api/rides/driver/:id
  • GET /api/rides/rider/:id/active Β· GET /api/rides/driver/:id/active
  • GET /api/rides/available
  • GET /api/fare/estimate

Events

  • GET /api/events/:userId Β· PUT /api/events/:eventId/read

Admin

  • GET /api/admin/stats Β· GET /api/admin/rides Β· GET /api/admin/users

🀝 Contributing

Contributions are welcome! Please open an issue to discuss substantial changes before submitting a pull request. By contributing, you agree your contributions will be licensed under the GPLv3.


πŸ“„ License

RideFlow is released under the GNU General Public License v3.0 (or later). See LICENSE for the full text.

You are free to use, study, share, and modify this software. If you distribute it or a derivative β€” including over a network as part of a larger work β€” you must keep it under the same license and make your source available.


Built with Expo, Express, and a belief that drivers deserve a bigger slice. πŸš—πŸ’š

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors