Prerequisites
Before you begin, ensure you have:- Node.js (v16 or higher recommended)
- npm or yarn package manager
- Ionic CLI installed globally
- Git for cloning the repository
Install Ionic CLI
If you don’t have Ionic CLI installed, install it globally:Verify the installation:
Clone and Install Dependencies
Clone the repository and install all dependencies:This will install all dependencies from
package.json, including:- Angular 18.2
- Ionic 8.4
- Capacitor 7.4
- NgRx 18.1
- Mapbox GL 3.15
- Socket.io Client 4.8
Configure Environment
The app uses environment files for configuration. The default development configuration is in
src/environments/environment.ts:src/environments/environment.ts
The default
apiUrl uses 10.0.2.2 which is the Android emulator’s alias for localhost. If running on iOS simulator or web browser, change this to http://localhost:3000/api.Required Configuration
Mapbox Access Token: ReplaceYOUR_MAPBOX_TOKEN_HERE with your Mapbox token:- Create a free account at mapbox.com
- Get your access token from your account page
- Update
environment.mapbox.accessToken
apiUrl and wsBase if needed.Run the Development Server
Start the Ionic development server:Or use the Angular CLI directly:The app will open automatically in your default browser at
http://localhost:8100.The
ionic serve command provides live reload - any changes you make to the source code will automatically refresh the browser.Verify the Installation
Once the app is running, you should see:- Login Screen - The authentication page at
/auth/login - No Console Errors - Check browser DevTools for any configuration issues
- Map Loading - If Mapbox is configured correctly, maps should render properly
Test Authentication
The app uses a dual authentication flow:- Mobile Session: Stores refresh token in device secure storage
- Web Session: Uses HTTP-only cookies for token management
ionic serve), the app defaults to web session mode.
You’ll need valid credentials from your backend API to log in. The app expects a
passenger user type and will validate against the passenger_app audience.Project Structure Overview
Development Scripts
The following npm scripts are available:| Command | Description |
|---|---|
npm start | Start development server (same as ng serve) |
npm run build | Build production bundle |
npm test | Run unit tests with Karma |
npm run lint | Run ESLint on TypeScript and HTML files |
npm run watch | Build in watch mode for development |
The project uses
@ionic/angular-toolkit which provides additional Ionic-specific build optimizations and schematics.Common Development Tasks
Adding a New Page
Adding a Service
Using Path Aliases
The project has@/* configured as an alias for src/*:
Troubleshooting
Port Already in Use
If port 8100 is already in use:Mapbox Not Loading
Check:- Your Mapbox access token is valid
- The token is correctly set in
environment.ts - Check browser console for CORS or API errors
WebSocket Connection Failed
Ensure:- Your backend WebSocket server is running at the configured
wsBaseURL - The URL uses
ws://(notwss://) for local development - Check that the backend is accessible from your device/emulator
Android Emulator Cannot Reach localhost
The Android emulator uses10.0.2.2 to access the host machine’s localhost. If your backend is on localhost:3000, the emulator should use:
http://localhost:3000/api instead.
Next Steps
Now that you have the app running:Full Installation Guide
Detailed setup with platform-specific requirements
Authentication
Learn about login flow and session management
Trip Booking
Understand how passengers request rides
State Management
Explore NgRx Signals architecture