Installation Guide
This guide covers everything you need to set up the Rodando Driver application for development and production deployment.Prerequisites
Before you begin, ensure you have the following installed on your system:Node.js
Version: 18.x or higherDownload Node.js
npm
Version: 9.x or higherComes bundled with Node.js
Angular CLI
Version: 18.2.0
Ionic CLI
Version: Latest
Mobile Development Prerequisites
For building mobile apps, you’ll also need:- Android
- iOS
- Android Studio (latest stable version)
- Java Development Kit (JDK) 17 or higher
- Android SDK (API level 33 or higher)
- Gradle (comes with Android Studio)
Step 1: Clone or Download the Project
Step 2: Install Dependencies
Install all required npm packages:Core Framework Dependencies
Core Framework Dependencies
Mobile Platform Packages
Mobile Platform Packages
State Management
State Management
Maps and Geolocation
Maps and Geolocation
Real-time Communication
Real-time Communication
Security
Security
Step 3: Environment Configuration
Configure your environment variables for development and production.Development Environment
Editsrc/environments/environment.ts:
Production Environment
Editsrc/environments/environment.prod.ts:
Required API Keys
Get a Mapbox Access Token
- Sign up at mapbox.com
- Navigate to Account → Access Tokens
- Create a new token with
styles:readandfonts:readscopes - Copy the token to
environment.mapbox.accessToken
Get a Google Maps API Key
- Go to Google Cloud Console
- Enable Maps JavaScript API and Places API
- Create credentials → API Key
- Add the key with
&libraries=placessuffix
Step 4: Run the Application
Development Server
Start the development server with live reload:- Angular:
http://localhost:4200 - Ionic:
http://localhost:8100
The Ionic server provides additional features like device emulation and live reload for mobile testing.
Build for Production
Create an optimized production build:www/ directory. The build process:
- Minifies JavaScript and CSS
- Optimizes images and assets
- Applies tree-shaking to remove unused code
- Uses
environment.prod.tsconfiguration
angular.json:
Step 5: Capacitor Setup for Mobile
Capacitor bridges your web app to native mobile platforms.Initialize Capacitor
Capacitor is pre-configured in this project. Verify the configuration incapacitor.config.ts:
Add Mobile Platforms
- Android
- iOS
android/app/src/main/AndroidManifest.xml, ensure these permissions:Sync Changes to Mobile
Whenever you update the web app, sync changes:Step 6: Run on Mobile Device
Using Android Studio
Connect device or start emulator
- Physical device: Enable USB debugging in Developer Options
- Emulator: Create an AVD (Android Virtual Device) in AVD Manager
Using Xcode
Configure signing
- Select the App target
- Go to Signing & Capabilities
- Select your development team
- Xcode will automatically manage provisioning profiles
Live Reload on Device
For faster development, use live reload:Testing
Unit Tests
Run unit tests with Karma:karma.conf.js:
Linting
Check code quality:.eslintrc.json:
Troubleshooting
npm install fails with dependency conflicts
npm install fails with dependency conflicts
Try using Or clear the cache:
--legacy-peer-deps:Capacitor sync fails
Capacitor sync fails
Ensure you’ve built the web app first:Check that
www/ directory exists and contains built files.Android build fails with Gradle errors
Android build fails with Gradle errors
Update Gradle in And in
android/build.gradle:android/gradle/wrapper/gradle-wrapper.properties:iOS build fails with CocoaPods errors
iOS build fails with CocoaPods errors
Map doesn't render
Map doesn't render
Verify:
- Mapbox access token is valid in
environment.ts - Internet connection is active
- No browser console errors (check DevTools)
src/app/features/tabs/map/map.component.ts:WebSocket connection fails
WebSocket connection fails
Check:
- Backend server is running
environment.wsBasepoints to correct WebSocket URL- CORS is configured on backend to allow WebSocket connections
src/app/core/services/socket/driver-ws.service.ts:Build Scripts Reference
Available npm scripts frompackage.json:
npm start
Start development server on
http://localhost:4200npm run build
Build production bundle to
www/npm test
Run unit tests with Karma
npm run lint
Check code quality with ESLint
Next Steps
Quickstart Guide
Learn how to use the app from a driver’s perspective
Authentication
Deep dive into auth flows and token management
State Management
Understand NgRx stores and facades
WebSocket Events
Real-time trip updates and messaging
API Reference
Complete API endpoint documentation
Deployment
Deploy to Google Play and App Store
Additional Resources
- Angular Documentation
- Ionic Framework Docs
- Capacitor Docs
- NgRx Documentation
- Mapbox GL JS
- Socket.IO Client
For project-specific questions or issues, please contact the development team or open an issue in the project repository.