Architecture Overview
Rodando Passenger is an Ionic Angular mobile application built with modern standalone components, reactive state management using NgRx Signals, and a feature-based modular architecture.Technology Stack
Framework
Angular 18+ with standalone components
UI Framework
Ionic 8+ for cross-platform mobile UI
State Management
NgRx Signals (Store + Facade pattern)
Platform
iOS & Android via Capacitor
Project Structure
The application follows a feature-based architecture organized into clear, modular directories:Standalone Components: The app uses Angular’s standalone component architecture, eliminating the need for NgModules and enabling more granular code splitting.
Architectural Patterns
1. Store + Facade Pattern
The application implements a Store + Facade pattern for state management:- Store
- Facade
Store holds the reactive state using Angular signals:
- Defines state interface and initial state
- Provides computed selectors
- Exposes mutation methods
- Location:
src/app/store/*/(e.g.,auth.store.ts)
2. Dependency Injection
All services and stores use Angular’sprovidedIn: 'root' pattern for singleton instances:
src/app/store/auth/auth.store.ts
3. Lazy Loading
All feature modules are lazy-loaded using dynamic imports:src/app/app.routes.ts (excerpt)
Core Services Architecture
Thecore/ directory contains singleton services organized by responsibility:
HTTP Services (core/services/http/)
HTTP Services (core/services/http/)
AuthService- Authentication endpoints (/auth/login, /auth/refresh)TripsApiService- Trip management endpointsMapboxPlacesService- Geocoding and place searchSecureStorageService- Encrypted storage for sensitive data
HttpClient and return RxJS observables.Guards (core/guards/)
Guards (core/guards/)
authGuardWithRefresh- Protects private routes, attempts token refreshauthGuardWithRefreshChild- Protects child routesguestGuard- Blocks authenticated users from auth pages
Providers (core/providers/)
Providers (core/providers/)
LocationProvider- GPS/location tracking abstraction- Handles permissions, accuracy, and platform differences
Component Architecture
Standalone Components
All components are standalone and explicitly declare their dependencies:Example Component
Component-Store Interaction
Components inject Facades (not stores directly) to maintain separation of concerns:Data Flow
- Component injects Facade
- Facade orchestrates Store + Services
- Service returns Observable data
- Facade updates Store state
- Store signals propagate to Component
This unidirectional data flow ensures predictable state updates and easier debugging.
Platform Considerations
Web vs Mobile Detection
The app detects platform to handle cookie-based (web) vs token-based (mobile) authentication:src/app/store/auth/auth.facade.ts:41-48
Secure Storage
Sensitive data (refresh tokens) are stored usingSecureStorageService:
- Web: Uses encrypted localStorage
- Mobile: Uses native secure keychain/keystore
Next Steps
State Management
Learn about NgRx Signals, Store/Facade patterns, and effects
Routing
Explore route configuration, guards, and lazy loading
Layouts
Understand layout components and navigation structure
API Integration
Connect to backend services and handle responses