Skip to content

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 bootstrap
  • main.dart bootstraps the app, sets the theme, loads env vars, and initializes routing via auto_route.
  • Screens and logic are grouped by domain in the features/ folder.
  • Dependencies are injected using get_it and injectable.

🌍 Localization & Translation

Localization is handled using:

plaintext
libs/flutter_localizations/
  • Uses .arb files 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:

ToolPurpose
injectableDependency injection with get_it
auto_routeStrongly typed routing and guards
freezedImmutable data classes and unions
flutter_genAuto-generated assets and localization
graphql_codegenType-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:

LibraryPurpose
libs/flutter_commonShared UI components, and layout utilities
libs/flutter_localizationsTranslations and localization utilities