01 - Getting Started

Everything you need to clone the repo, install dependencies, and run the app locally for the first time.

Prerequisites

ToolVersionWhy
Flutter SDK3.2+App framework
Dart3.xComes with Flutter
ChromeLatestFastest way to run the app (web build)
Android StudioLatestAndroid emulator + SDK (optional)
Xcode15+iOS simulator (macOS only, optional)
VS CodeLatestRecommended IDE with Flutter extension
.NET 8 SDK8.0+To run the backend in parallel
PostgreSQL14+Backend database

Verify Flutter is installed:

BashVerify Flutter installation
# Windows
C:\flutter\bin\flutter doctor

# Expected output includes:
# [✓] Flutter (Channel stable, 3.x.x)
# [✓] Chrome - develop for the web
# [✓] Android toolchain (if you want Android builds)

Step 1 - Clone the Repo

BashClone and enter folder
git clone <repo-url> D:\MO_Project\ekyc
cd D:\MO_Project\ekyc\flutter_app

Step 2 - Install Dependencies

Bashflutter pub get
C:\flutter\bin\flutter pub get

This downloads all packages listed in pubspec.yaml: http, shared_preferences, lottie, flutter_svg, google_fonts, razorpay_flutter, webview_flutter, image_picker, and more.

Step 3 - Start the Backend

The Flutter app talks to the .NET 8 backend. You must start the backend first, or the app will fail at Stage 0 (session init).

BashRun backend in a separate terminal
cd D:\MO_Project\ekyc\backend\src\MO.Ekyc.Api
dotnet run

# Listens on http://localhost:5000
# Swagger: http://localhost:5000/swagger
# Hangfire: http://localhost:5000/hangfire
Make sure PostgreSQL is running

The backend connects to postgres://localhost:5432/ekyc3 by default. Check backend/src/MO.Ekyc.Api/appsettings.Development.json for the connection string.

Step 4 - Run the Flutter App on Web

Web is the fastest way to iterate. No emulator, no plugin issues.

BashRun on Chrome
cd D:\MO_Project\ekyc\flutter_app
C:\flutter\bin\flutter run -d chrome --web-port 8080

The app opens at http://localhost:8080. You should see Stage 0 (arrival) briefly, then Stage 1 (registration).

Use the fixed OTP 1234

In dev mode the backend has GlobalMockEnabled: true. All OTPs (mobile and email) are fixed at 1234. See 02 - Mock Mode for details.

Step 5 - Environment Flag

The app reads an ENV flag at build time to select the backend URL. Default is dev.

flutter_app/lib/config/api_config.dartDart
static const _env = String.fromEnvironment('ENV', defaultValue: 'dev');

static String get baseUrl {
  switch (_env) {
    case 'prod': return 'https://ekyc.motilaloswal.com';
    case 'uat':  return 'https://ekycuat.motilaloswaluat.com';
    default:    return 'http://localhost:5000';
  }
}
CommandEnvironmentBase URL
flutter run -d chromedev (default)http://localhost:5000
flutter run -d chrome --dart-define=ENV=uatuathttps://ekycuat.motilaloswaluat.com
flutter run -d chrome --dart-define=ENV=prodprodhttps://ekyc.motilaloswal.com

Running on Android

BashAndroid emulator / device
# List available devices
C:\flutter\bin\flutter devices

# Run on emulator/device
C:\flutter\bin\flutter run

# Build release APK
C:\flutter\bin\flutter build apk --release --dart-define=ENV=prod

# Build App Bundle for Play Store
C:\flutter\bin\flutter build appbundle --release --dart-define=ENV=prod
Android emulator gotcha

Android emulator can't reach localhost - it has to be 10.0.2.2. If you run the app on Android while hitting a local backend, you'll need to temporarily change the dev base URL in api_config.dart. Or run against UAT: --dart-define=ENV=uat.

Running on iOS (macOS only)

BashiOS simulator / device
# Install CocoaPods dependencies first
cd ios
pod install
cd ..

# Run on simulator
flutter run -d ios

# Build IPA for TestFlight
flutter build ipa --release --dart-define=ENV=prod

Troubleshooting

`flutter pub get` fails

App shows "No internet connection" at Stage 0

Port 8080 already in use

Stuck at Stage 0 loading spinner

See 10 - Debugging for a full checklist.

Backend handler for Stage 0
  • Controller: backend/src/MO.Ekyc.Api/Controllers/Common/ArrivalController.cs
  • Service: backend/src/MO.Ekyc.Infrastructure/Services/Common/ArrivalService.cs
  • Backend docs (pending) - placeholder