Code structure
All Ridy client applications — including:
- Rider App (
apps/rider-frontend/) - Driver App (
apps/driver-frontend/) - Partnership App (
apps/partnership-frontend/, if licensed)
— are built using a consistent, feature-based clean architecture that ensures modularity, scalability, and easy onboarding for developers.
🧱 Project Architecture
Each app shares a similar folder layout under lib/, based on the clean architecture principles:
plaintext
lib/
├── core/ # App-wide utilities, constants, theme, routing
│ ├── graphql/ # GraphQL client setup and queries
│ ├── components/ # Reusable widgets (buttons, inputs, etc.)
│ └── env.dart # Environment config
├── features/
│ ├── auth/
│ │ ├── domain/ # Use cases and interfaces
│ │ ├── data/ # Repositories, datasources
│ │ └── presentation/ # Widgets, screens, UI logic
│ ├── booking/
│ ├── wallet/
│ └── ...other features
└── main.dart # App entry point and DI bootstrapmain.dartbootstraps the app, sets the theme, loads env vars, and initializes routing viaauto_route.- Screens and logic are grouped by domain in the
features/folder. - Dependencies are injected using
get_itandinjectable.
🌍 Localization & Translation
Localization is handled using:
plaintext
libs/flutter_localizations/- Uses
.arbfiles to support 32 languages (mostly machine-translated) - Implements standard Flutter localization patterns
- Easily extendable with manual translations
Includes:
- Language support
- Country Codes definitions
- ARB-based string extraction via
flutter_gen
⚙️ State Management & Code Generation
Ridy uses modern, maintainable tooling to reduce boilerplate:
| Tool | Purpose |
|---|---|
injectable | Dependency injection with get_it |
auto_route | Strongly typed routing and guards |
freezed | Immutable data classes and unions |
flutter_gen | Auto-generated assets and localization |
graphql_codegen | Type-safe GraphQL query integration |
These tools are deeply integrated and make the apps easier to maintain and scale.
All code generation is handled via
build_runner, which you can trigger with:
bash
flutter pub run build_runner build --delete-conflicting-outputs📦 Shared Packages
All frontend apps rely on shared local libraries, imported using relative paths:
| Library | Purpose |
|---|---|
libs/flutter_common | Shared UI components, and layout utilities |
libs/flutter_localizations | Translations and localization utilities |
