Caby Monorepo Documentation
Comprehensive setup, configuration, database initialization, and customization guide for the Caby Ride-Hailing Platform.
1. Architecture & Overview
Caby is an end-to-end, enterprise-grade on-demand taxi and ride-booking solution built on modern serverless architecture. The entire project is organized as a unified Yarn Workspaces Monorepo, sharing common state logic, Firebase schemas, and configuration files across all platforms.
1.1 Workspaces Breakdown
| Directory / Workspace | Tech Stack | Role & Responsibility |
|---|---|---|
customer-app/ |
React Native, Expo SDK 54, React 19 | Rider mobile application for booking trips, fare estimation, live vehicle tracking, chat, and card/wallet payments. |
driver-app/ |
React Native, Expo SDK 54, React 19 | Driver mobile application for accepting rides, GPS navigation, background location tracking, loud dispatch alerts, and earnings. |
web-app/ |
React 19, Vite, Material UI (MUI v5), Deck.gl | Web Administration Dashboard, Dispatcher Console, Zone/Fare Management, and public landing/marketing CMS pages. |
functions/ |
Node.js, Firebase Cloud Functions, Stripe SDK | Serverless backend triggers, payment webhooks, ride dispatch algorithms, and email notifications. |
common/ |
Redux, Redux-Thunk, Firebase SDK | Shared business logic, state reducers, actions, translation hooks, and global utilities used by all apps. |
installer/ |
Node.js scripts, JSON DB Schemas | One-click Firestore database seeding, CMS landing page deployers, language updates, and backup tools. |
1.2 System Ride Flow Architecture
- Customer Request: Rider selects pickup & destination on
customer-app. Fare is calculated using Google Maps Routes & Car Type rates. - Cloud Dispatch: Firestore triggers Firebase Cloud Functions to search for nearby online drivers within the service radius.
- Driver Alert: Driver receives real-time loud audio dispatch on
driver-appwith countdown timer to accept or reject. - Live Tracking: Both parties track live coordinates synchronized via Firestore real-time listeners and in-app chat.
- Trip Completion & Payment: Driver marks trip completed. Customer's card is charged via Stripe, or cash/wallet balance is updated. Admin commission is automatically logged.
2. System Requirements & Setup
Before installing or running any workspace, ensure your workstation meets the following prerequisites:
2.1 Required Tools
- Node.js:
v20.x.x(Recommended: Node.js LTS v20.20.2). Download Node.js v20 - Yarn Package Manager: Yarn Classic
v1.22.x. - Git: Version control tool for managing repository code.
- Firebase CLI: Firebase command line tools for deployment and authentication.
- EAS CLI: Expo Application Services CLI for compiling Android APK/AAB and iOS IPAs.
2.2 Step-by-Step CLI Setup
Open your command prompt / terminal with administrator privileges and run:
# Install Yarn globally
npm install -g yarn
# Install Firebase CLI globally
npm install -g firebase-tools
# Install Expo EAS CLI globally
npm install -g eas-cli
From the root folder of the project repository, execute:
yarn install
This command resolves and links all workspace packages (customer-app, driver-app, web-app, functions, common) in a single step.
3. Firebase Setup & Services
Firebase provides the serverless backend, real-time database, cloud functions, authentication, and file storage for Caby.
3.1 Create Firebase Project
- Go to Firebase Console and click Add Project.
- Name your project (e.g.,
caby-taxi-prod) and proceed. Enable Google Analytics if desired. - In the bottom-left corner, click Upgrade and choose the Blaze Plan.
3.2 Register Applications in Firebase
From your Firebase Project Overview dashboard, register 1 Web App and 4 Mobile Apps:
- 1. Web App: Click the Web icon (
</>), enter "Caby Web Admin", and copy the generated Firebase config keys. - 2. Customer Android App: Click Android icon, enter Package Name
com.yourcompany.caby. - 3. Customer iOS App: Click iOS icon, enter Bundle ID
com.yourcompany.caby. - 4. Driver Android App: Click Android icon, enter Package Name
com.yourcompany.cabydriver. - 5. Driver iOS App: Click iOS icon, enter Bundle ID
com.yourcompany.cabydriver.
3.3 Enable Authentication & Test Phone Numbers
- Go to Build > Authentication, click Get Started.
- In the Sign-in method tab, enable the following providers:
- Phone: Required for mobile user and driver login.
- Email/Password: Required for Admin, Dispatcher, and Web Portal logins.
- Google & Apple: (Optional / Recommended for social signups).
- Setup Bypass Test Numbers: Under Sign-in method > Phone, expand Phone numbers for testing and add:
Phone: +1 2011234567 | Verification Code: 123456 Phone: +1 2021234567 | Verification Code: 123456 Phone: +1 2031234567 | Verification Code: 123456This allows you and app reviewers to test mobile logins freely without consuming SMS quotas.
3.4 Enable Firestore Database, Storage & Hosting
- Firestore Database: Navigate to Build > Firestore Database, click Create Database, choose your server location (e.g.,
us-central1), and select Production Mode. - Cloud Storage: Navigate to Build > Storage, click Get Started, choose default bucket location, and finish.
- Firebase Hosting: Navigate to Build > Hosting, click Get Started.
3.5 Generate Private Service Account Key
The backend installer and Cloud Functions require administrator access via a private key file:
- In Firebase Console, click the Gear icon (Project Settings) > Service Accounts tab.
- Click Generate New Private Key and download the JSON file.
- Rename the file to
service-account.jsonand place it in the root of your project directory (or insidefunctions/as configured).
4. Expo & EAS Cloud Build
Expo Application Services (EAS) handles cloud builds and stores cryptographic signing credentials for both iOS and Android apps.
4.1 Create & Link Expo Project
- Register an account on expo.dev.
- On your Expo dashboard, click Create a Project and name it
caby. - Both Customer and Driver apps share this same project. Copy the Owner, Slug, and Project ID (UUID).
4.2 Generate Firebase CI Token for EAS
To let EAS build servers download your project configs securely, generate a CI token:
# Run in terminal
firebase login:ci
Copy the output token. Then go to your project on expo.dev > Settings > Environment Variables / Secrets, and create a secret named FIREBASE_TOKEN with this token value.
5. Google Maps Platform Setup
Google Maps is critical for geocoding, autocomplete search, route polylines, real-time map rendering, and driver distance matrices.
5.1 Enable the 7 Required Google Maps APIs
Go to Google Cloud Console, select your Firebase project, and enable these 7 APIs in APIs & Services > Library:
- Maps SDK for Android (Renders Android map view)
- Maps SDK for iOS (Renders iOS map view)
- Maps JavaScript API (Renders Web Admin & Landing Page maps)
- Places API (New) (Search autocomplete and place details)
- Geocoding API (Coordinate to address conversion)
- Routes API / Directions API (Trip routing, turn-by-turn polyline, and distance)
- Distance Matrix API (Calculates distance from multiple drivers to pickup point)
5.2 Create & Restrict 6 API Keys
In APIs & Services > Credentials, create 6 separate API keys to protect against quota theft:
| Key Name | Used By | Recommended Restriction |
|---|---|---|
Web App Key |
Web Admin Portal | HTTP referrers (e.g., https://yourdomain.com/*, http://localhost:3000/*) |
Server Key |
Firebase Functions | API restriction (Places, Geocoding, Routes, Distance Matrix) |
Android Customer Key |
Customer App (Android) | Android apps (Package com.yourcompany.caby + SHA-1 Fingerprint) |
Android Driver Key |
Driver App (Android) | Android apps (Package com.yourcompany.cabydriver + SHA-1 Fingerprint) |
iOS Customer Key |
Customer App (iOS) | iOS apps (Bundle ID com.yourcompany.caby) |
iOS Driver Key |
Driver App (iOS) | iOS apps (Bundle ID com.yourcompany.cabydriver) |
6. Configuration Files (JSON)
All core settings are centralized inside functions/config/. Configure these files before deploying:
6.1 functions/config/common.json (Backend & Master Admin)
{
"firebaseProjectId": "YOUR_FIREBASE_PROJECT_ID",
"functionsRegion": "us-central1",
"googleApplicationCredentials": "../service-account.json",
"expo_owner": "YOUR_EXPO_USERNAME",
"expo_slug": "YOUR_EXPO_PROJECT_SLUG",
"expo_project_id": "YOUR_EXPO_PROJECT_UUID",
"admin_email": "admin@yourdomain.com",
"admin_password": "YOUR_ADMIN_PASSWORD",
"demo_numbers": [
"+12011234567",
"+12021234567",
"+12031234567",
"+12041234567"
],
"demo_otp": "123456"
}
6.2 functions/config/customer.json (Customer Mobile App)
{
"app_name": "Caby",
"app_description": "Caby customer app",
"app_identifier": "com.yourcompany.caby",
"ios_app_version": "1.0.0",
"ios_build_number": "1",
"android_app_version": "1.0.0",
"android_version_code": 1,
"googleApiKeys": {
"ios": "YOUR_IOS_CUSTOMER_MAPS_KEY",
"android": "YOUR_ANDROID_CUSTOMER_MAPS_KEY",
"server": "YOUR_SERVER_MAPS_KEY"
}
}
6.3 functions/config/driver.json (Driver Mobile App)
{
"app_name": "Caby Driver",
"app_description": "Caby driver app",
"app_identifier": "com.yourcompany.cabydriver",
"ios_app_identifier": "com.yourcompany.cabydriver",
"ios_app_version": "1.0.0",
"ios_build_number": "1",
"android_app_version": "1.0.0",
"android_version_code": 1,
"googleApiKeys": {
"ios": "YOUR_IOS_DRIVER_MAPS_KEY",
"android": "YOUR_ANDROID_DRIVER_MAPS_KEY",
"server": "YOUR_SERVER_MAPS_KEY"
}
}
6.4 functions/config/web.json (Web Admin Dashboard)
{
"app_name": "Caby Admin",
"app_description": "Caby admin panel",
"googleApiKeys": {
"web": "YOUR_WEB_MAPS_KEY",
"server": "YOUR_SERVER_MAPS_KEY"
}
}
7. DB Seeding & Master Setup
After setting up your JSON configs and service-account.json, initialize your Firestore database with default master tables:
# Populate default collections and create Master Admin user
node installer/index.js initialize
This script seeds vehicle categories (Sedan, SUV, Bike, Mini), cancellation reasons, promo templates, language translations, and creates the default Administrator user using credentials from common.json.
7.1 First Time Admin Dashboard Setup
- Open the Web Portal at
http://localhost:3000or your live hosted domain. - Login using your
admin_emailandadmin_password. - Navigate to Cars / Car Types: Configure base fares, per KM rates, waiting charges, and admin commission percentage.
- Navigate to Service Locations / Zones: Set up your operating cities and geo-fenced boundaries.
- Navigate to Driver Documents: Configure required driver onboarding documents (Driving License, National ID, Vehicle Registration).
8. Payments & Wallet System
Caby supports Stripe for direct credit/debit card processing, in-app customer wallets, and cash on delivery.
8.1 Stripe Gateway Configuration
- Log into your Stripe Dashboard at dashboard.stripe.com.
- Copy your Publishable Key (
pk_live_...) and Secret Key (sk_live_...). - In Caby Web Admin Dashboard, navigate to App Settings > Payment Settings.
- Enable Stripe, paste the Publishable Key & Secret Key, and save.
- Set your default Currency Code (e.g.,
USD,EUR,GBP,PKR) and currency symbol.
8.2 In-App Wallets & Driver Payouts
- Customer Wallet: Riders can top-up their balance using saved cards and pay for rides automatically.
- Driver Wallet: Ride fares are credited to the driver wallet minus company commission.
- Withdrawal Requests: Drivers submit withdrawal requests from their app. Admins review and approve payouts in Finance > Withdrawals.
9. Full Customization Guide (Web, Customer, Driver)
This section provides a complete, organized reference for white-labeling and rebranding every element of the Caby platform (Logos, Color Palettes, Alert Sounds, Fonts, and Screen Pages) across the Web Portal, Customer Mobile App, and Driver Mobile App.
9.1 Quick Customization Reference Table
| Component / Asset | Target Workspace | Exact File Path | What It Controls |
|---|---|---|---|
| Web Header & Admin Logo | web-app/ |
src/assets/logo_admin.png |
Top navigation bar brand logo in Admin and Public Portal. |
| Web Footer Logo & Favicon | web-app/ |
src/assets/logo_footer.png & public/favicon.ico |
Browser tab icon and footer branding. |
| Web Theme & Colors | web-app/ |
src/muiAppTheme.js |
Primary brand colors, buttons, card borders, and Material UI styles. |
| Web Landing & Public Pages | web-app/ |
src/views/public/ & src/marketing/ |
Landing page hero banner, About, Services, FAQ, Contact, and Privacy pages. |
| Customer App Icons & Splash | customer-app/ |
assets/images/logo_android.png, splash.png |
Rider mobile app launcher icon and startup loading splash graphic. |
| Customer App Theme Colors | customer-app/ |
src/theme/colors.js |
Primary accent color, ride booking button gradients, card backgrounds. |
| Customer App Screens | customer-app/ |
src/screens/MapScreen.js, BookedCabScreen.js |
Main booking map, search autocomplete, live trip tracking, and user profile. |
| Driver App Icons & Splash | driver-app/ |
assets/images/logo_android.png, splash.png |
Driver mobile app launcher icon and launch splash screen. |
| Driver Dispatch Audio Ringtone | driver-app/ |
assets/sounds/ride_alert.wav |
Loud dispatch ringtone played during incoming ride requests. |
| Driver App Theme Colors | driver-app/ |
src/theme/colors.js |
Driver duty toggle switch, earnings card highlights, and header themes. |
| Driver App Screens | driver-app/ |
src/screens/BookedCabScreen.js, DriverIncomeScreen.js |
Live trip navigation, daily earnings dashboard, and document uploads. |
9.2 Web App Customization (Web Portal & Admin Panel)
The Web workspace includes both the public-facing landing portal and the protected Administrator/Dispatcher dashboards.
A. Logos & Graphical Assets
- Admin Navbar Logo: Replace
web-app/src/assets/logo_admin.png(Transparent PNG, recommended height: 48px to 60px). - Footer Logo: Replace
web-app/src/assets/logo_footer.png(Transparent PNG for dark footer backgrounds). - Browser Favicon & Apple Touch Icon: Replace
web-app/public/favicon.ico(32x32) andweb-app/public/apple-icon.png(192x192). - Vehicle Category Map Markers: Replace vehicle icons in
web-app/src/assets/(car.png,car_onduty.png,car_offduty.png,bike.png,auto.png).
B. Colors, Themes & Typography
Edit web-app/src/muiAppTheme.js to adjust the Material UI styling palette:
// web-app/src/muiAppTheme.js
export const colors = {
primary: "#ffcc33", // Main taxi brand color
primaryDark: "#e6b800", // Darker shade for hover states
secondary: "#24292e", // Secondary accent color
screenBackground: "#f4f6f9", // Dashboard background color
cardBackground: "#ffffff",// Surface card color
textPrimary: "#1f2937", // Primary typography color
headerBackground: "#111827"// Top navigation bar color
};
C. Public Landing & Informational Pages
All front-facing pages are located in web-app/src/views/public/ and can be edited directly to match your company's copy:
AboutPage.js: Company background, mission statement, and statistics counter.ServicesPage.js: Overview of ride tiers (Economy, Sedan, SUV, Package Delivery, Rentals).SafetyForDriversPage.js: Driver safety protocols, emergency guidelines, and verification policy.BecomeDriverPage.js: Driver recruitment page and onboarding requirements.HowItWorksPage.js: Step-by-step passenger booking walkthrough.FaqPage.js: Frequently asked questions for both riders and drivers.ContactPage.js: Support contact form, office address, and customer care email.TermsPage.js&PrivacyPage.js: Legal terms of service and privacy policies.
D. Admin Dashboard Views & Lists
web-app/src/views/Dashboard.js: Master KPI dashboard displaying active drivers, total revenue, completed bookings, and live heatmaps.web-app/src/views/Bookings.js: Real-time booking history, dispatcher assign modal, and trip status controls.web-app/src/views/Drivers.js: Driver approvals, license verification, and suspension controls.web-app/src/views/CarTypes.js: Fare matrix (Base fare, Per KM, Per Minute, Surge pricing).
9.3 Customer App (User App) Customization
The Customer App provides riders with intuitive ride booking, instant fare estimates, live driver tracking, and digital payments.
A. App Icons & Launch Splash Screen
- Directory Path:
customer-app/assets/images/ - Android App Icon:
logo_android.png(512 x 512 px, square transparent PNG). - iOS App Icon:
logo_ios.png(1024 x 1024 px, square solid background PNG). - Launch Splash Screen:
splash.png(1242 x 2436 px, high-resolution portrait graphic). - Push Notification Icon:
notification_icon.png(White silhouette on transparent background for Android status bar).
B. Color Palette & UI Tokens
Edit customer-app/src/theme/colors.js to update the color palette across all rider screens:
// customer-app/src/theme/colors.js
export const colors = {
PRIMARY: "#ffcc33", // Main theme color (Buttons, highlights, badges)
PRIMARY_DARK: "#e6b800", // Pressed state color
SECONDARY: "#1e293b", // Dark accent color
BACKGROUND: "#ffffff", // Screen background color
CARD_BG: "#f8fafc", // Vehicle card background
TEXT_MAIN: "#0f172a", // Main heading typography
TEXT_MUTED: "#64748b", // Subtitles and hints
SUCCESS: "#10b981", // Completed / Confirmed status green
DANGER: "#ef4444" // Cancelled / Alert status red
};
C. Key Customer Screens
MapScreen.js: Main interactive map interface for selecting pickup and dropoff points.BookedCabScreen.js: Live ride tracking screen showing driver location, route polyline, ETA, OTP code, and Emergency SOS button.SearchScreen.js&SearchLocationScreen.js: Places API location search autocomplete.RideDetails.js&RideListScreen.js: Past ride history, invoice breakdown, and receipts.CustomerRatingScreen.js: Star ratings and driver review modal upon trip completion.WalletDetails.js&PaymentDetails.js: Digital wallet balance, top-up modal, and saved credit cards.OnlineChat.js: Real-time messaging screen between passenger and assigned driver.
9.4 Driver App Customization
The Driver App is designed for high performance with loud audio dispatches, background location broadcasting, and daily revenue statistics.
A. App Icons & Launch Splash
- Directory Path:
driver-app/assets/images/ - Android Icon:
logo_android.png(512 x 512 px). - iOS Icon:
logo_ios.png(1024 x 1024 px). - Launch Splash Graphic:
splash.png(1242 x 2436 px).
B. Dispatch Ringtones & Audio Alerts
When a customer requests a ride nearby, the Driver App rings loudly to notify the driver even if the app is in the background:
- Audio File Location:
driver-app/assets/sounds/ride_alert.wav - Customization: Replace
ride_alert.wavwith any.wavor.mp3sound file of your choice (keep the filenameride_alert.wav).
C. Driver Colors & Theme
Edit driver-app/src/theme/colors.js to adjust driver UI elements:
// driver-app/src/theme/colors.js
export const colors = {
PRIMARY: "#ffcc33", // Driver theme accent
PRIMARY_DARK: "#e6b800", // Darker accent
ONLINE_GREEN: "#22c55e", // "Online / On Duty" active switch green
OFFLINE_RED: "#ef4444", // "Offline" inactive switch red
BACKGROUND: "#ffffff", // Screen background
CARD_BG: "#f8fafc", // Duty card background
TEXT_MAIN: "#0f172a" // Text color
};
D. Key Driver Screens
BookedCabScreen.js: Active dispatch screen with accept/reject countdown timer, turn-by-turn map navigation, and customer phone/chat buttons.DriverTrips.js: Active bookings list and ride request management.DriverIncomeScreen.js: Detailed earnings dashboard showing daily, weekly, and monthly net payouts.DocumentUploadScreen.js: Onboarding screen where new drivers upload driving licenses, ID cards, and vehicle registration papers.DriverVehicleHubScreen.js&CarsScreen.js: Vehicle make, model, license plate, and assigned car management.WithdrawMoney.js: Driver bank account withdrawal requests.
10. Web Admin & CMS Portal
The Web workspace contains the full Admin Console, Dispatcher interface, and public marketing landing pages.
10.1 Local Development
# Start Vite development server
yarn web
10.2 Deploying to Firebase Hosting
# Build and deploy Web Hosting only
yarn web:deploy
# Deploy complete backend (Cloud Functions, Firestore Rules, Storage, and Hosting)
yarn deploy
10.3 CMS Landing Page Customization
Landing page text, hero banners, app download badges, and footer links can be customized in web-app/src/marketing/ or deployed via node installer/deployCmsLanding.js.
11. Customer Mobile App
The Customer App allows riders to book rides, schedule trips, track drivers, and pay securely.
11.1 Running Locally
# Start Metro Dev Server for Customer App
yarn app:customer
11.2 Customizing Branding & Theme
- App Icons & Splash: Replace files in
customer-app/assets/images/(icon.png,logo_android.png,logo_ios.png,splash.png). - Color Palette: Edit
customer-app/src/theme/colors.jsto adjust primary accent colors (e.g.,#ffcc33), background colors, and button styles. - Main Map Interface:
customer-app/src/screens/MapScreen.jsandcustomer-app/src/screens/BookedCabScreen.js.
12. Driver Mobile App
The Driver App provides turn-by-turn navigation, background location broadcasting, dispatch alerts, and earnings analytics.
12.1 Running Locally
# Start Metro Dev Server for Driver App
yarn app:driver
12.2 Customizing Alerts & Ringtones
- Dispatch Audio: Replace the dispatch ringtone wav file in
driver-app/assets/sounds/ride_alert.wavwith your custom chime. - Driver Screens:
BookedCabScreen.js: Active ride execution & navigation screen.DriverTrips.js: Trip history & assigned bookings.DriverIncomeScreen.js: Daily, weekly, and monthly earnings breakdown.DocumentUploadScreen.js: License and vehicle document verification.
13. Production Build & Release
Generate standalone installable binaries and store-ready releases using Expo EAS CLI directly from the root directory:
13.1 Android Builds
# 1. Build Standalone Installable APK (for testing & distribution)
yarn app:build-android-apk # Customer App APK
yarn app:driver:build-android-apk # Driver App APK
# 2. Build Production AAB (for Google Play Console submission)
yarn app:build-android # Customer App AAB
yarn app:driver:build-android # Driver App AAB
13.2 iOS Builds
# 1. Build iOS Simulator / Dev Client
yarn app:build-dev-client # Customer App Dev Client
yarn app:driver:build-dev-client # Driver App Dev Client
# 2. Build Production iOS IPA (for Apple TestFlight / App Store Connect)
yarn app:build-ios # Customer App IPA
yarn app:driver:build-ios # Driver App IPA
13.3 Automated Store Submission
yarn app:submit # Submit Customer App to Stores
yarn app:driver:submit # Submit Driver App to Stores
14. Troubleshooting & FAQ
Solution: Ensure your Google Cloud Project has Billing enabled. Verify that all 7 required APIs (especially Places API (New), Geocoding API, and Routes API) are enabled. Check that your API key restrictions match your domain name or Android package name and SHA-1 fingerprint.
Solution: For initial testing, add test phone numbers (e.g. +1 2011234567 with code 123456) in Firebase Console under Authentication > Sign-in method > Phone > Phone numbers for testing. For production SMS, ensure Firebase Blaze plan has sufficient SMS quotas.
Solution: We have pre-configured cross-env FUNCTIONS_DISCOVERY_TIMEOUT=120 in root package.json. If your internet connection is slow, run yarn deploy:functions directly.
Solution: Login to the Web Admin Portal, go to App Settings > Global Settings to set your currency symbol, code, and default language. You can also run node installer/index.js override-language to batch update language packs.
15. Help, Support & Changelog
Need customization, branding services, or help with installation? Contact our dedicated support engineering team:
- Support Email: info@bays.pk
- Author: Bays.pk
- Response Time: Within 24-48 business hours
Changelog
Version 1.0.0 (Initial Release)
- Modern Monorepo with React 19, Expo SDK 54, and React Native 0.81.
- Full-featured Customer and Driver mobile applications.
- Real-time tracking, live GPS polyline routes, and loud audio dispatching.
- Stripe saved card payments, in-app wallets, and driver commission splits.
- Responsive React Admin dashboard with heatmaps, dispatcher console, and CMS landing page.
- One-click database initialization and automated EAS build pipelines.