Skip to content

VVK027/metro_city_pulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Metro City Pulse

A cross-platform Flutter app for real-time smart city monitoring and traffic incident management. Metro City Pulse gives operators a unified view of city incidents on an interactive map, operational statistics, CCTV-backed alerts, and user settings β€” optimized for mobile, tablet, and desktop layouts.

Features

  • Interactive map dashboard β€” Google Maps view of incidents across Bengaluru with marker filtering, severity legend, custom info windows, zoom controls, and periodic data refresh.
  • Stats overview β€” Summary cards (total cases, new alerts, open cases, total videos), embedded map section, and recent alerts.
  • Alerts workspace β€” Filterable alert list with confidence scoring, date-range selection, tabbed case status, and CCTV video playback.
  • Responsive shell β€” Side navigation on tablet/desktop; drawer + bottom navigation on mobile. Layout adapts via a custom AppResponsive breakpoint system.
  • Authentication flow β€” Login, signup, and forgot-password screens wired to Firebase Auth (requires Firebase project setup).
  • Localization β€” English and Spanish via ARB translation files with runtime locale switching.
  • Theming β€” Light and dark mode with persisted user preference.
  • Connectivity awareness β€” Offline detection using connectivity_plus with a dedicated no-internet screen.

Preview

metro_city_pulse_preview

Tech Stack

Category Packages
Framework Flutter (SDK ^3.10.9)
State management Riverpod (hooks_riverpod, riverpod_annotation, code generation)
Navigation GoRouter
Maps google_maps_flutter, google_maps_cluster_manager_2
Auth firebase_core, firebase_auth, msal_auth / msal_js (MSAL not yet integrated)
Media video_player
Storage shared_preferences
UI flutter_svg, syncfusion_flutter_datepicker, Poppins font
Networking connectivity_plus
Serialization json_annotation / json_serializable

Project Structure

The codebase follows Clean Architecture:

lib/
β”œβ”€β”€ core/                 # App bootstrap, routing, themes, providers, constants, utils
β”‚   β”œβ”€β”€ config/           # Environment configuration (prod/stage/dev/test)
β”‚   β”œβ”€β”€ router/           # GoRouter setup and route constants
β”‚   β”œβ”€β”€ provider/         # Global Riverpod providers (theme, locale, repositories)
β”‚   └── themes/           # Light/dark theme definitions and assets
β”œβ”€β”€ data/                 # Models, local/remote data sources, repository implementations
β”‚   β”œβ”€β”€ data_source/
β”‚   β”‚   β”œβ”€β”€ local/        # SharedPreferences / local DB
β”‚   β”‚   └── remote/       # REST API service and endpoints
β”‚   β”œβ”€β”€ models/
β”‚   └── repositories/
β”œβ”€β”€ domain/               # Entities, repository contracts, use cases
β”œβ”€β”€ presentation/         # Screens, widgets, feature-specific providers
β”‚   β”œβ”€β”€ screens/
β”‚   β”‚   β”œβ”€β”€ home/         # App shell (side menu, bottom nav)
β”‚   β”‚   β”œβ”€β”€ maps/         # Map dashboard
β”‚   β”‚   β”œβ”€β”€ dashboard/    # Stats screen
β”‚   β”‚   β”œβ”€β”€ alerts/       # Alerts list and video panel
β”‚   β”‚   β”œβ”€β”€ login/        # Auth screens
β”‚   β”‚   β”œβ”€β”€ profile/
β”‚   β”‚   └── settings/
β”‚   └── widgets/          # Shared UI components
└── main.dart             # Entry point

Screens & Navigation

Route Screen Description
/ Login Landing / sign-in with responsive split layout
/login Login Email & password authentication
/signup Signup New user registration
/forgotPassword Forgot Password Password reset flow
/home Home Main shell with map, stats, alerts, and chat nav items
/profile Profile User profile details
/settings Settings Language and theme preferences

Inside /home, navigation works as follows:

Nav item Screen Notes
Dashboard CustomMapScreen Full-screen Google Maps incident view
Stats DashboardScreen KPI cards, map section, recent alerts
Alerts AlertsScreen Alert list + CCTV video player
Chat AI β€” Placeholder in bottom nav (not yet implemented)

Data Sources

Map and alert data currently loads from bundled sample JSON:

  • assets/json/maps_sample_data.json β€” incident records for Bengaluru locations

The MapRepository is structured to swap this for a REST API call once backend endpoints are configured in lib/core/config/environment.dart and lib/data/data_source/remote/endpoints.dart.

Getting Started

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/VK027/metro_city_pulse.git
    cd metro_city_pulse
  2. Install dependencies

    flutter pub get
  3. Generate code

    Riverpod and JSON serialization rely on build_runner:

    dart run build_runner build --delete-conflicting-outputs
  4. Configure Google Maps

    Add your API key to the platform manifests:

    • Android β€” android/app/src/main/AndroidManifest.xml inside <application>:

      <meta-data
          android:name="com.google.android.geo.API_KEY"
          android:value="YOUR_API_KEY"/>
    • iOS β€” ios/Runner/AppDelegate.swift or ios/Runner/Info.plist:

      <key>GMSApiKey</key>
      <string>YOUR_API_KEY</string>
    • Web β€” load the Maps JavaScript API with your key in web/index.html.

  5. Configure Firebase (optional, required for auth)

    • Create a Firebase project and add Android/iOS/Web apps.
    • Download google-services.json (Android) and GoogleService-Info.plist (iOS) into the respective platform folders.
    • Run flutterfire configure to generate firebase_options.dart.
    • Uncomment Firebase.initializeApp() in lib/core/main_initialisation.dart.
  6. Run the app

    flutter run

    Supported targets: Android, iOS, Web, macOS, Linux, and Windows.

Environment Configuration

API base URLs for prod, stage, dev, and test environments are defined in lib/core/config/environment.dart. Update the restBaseUrl values and wire up the REST client in lib/core/dependency_manager.dart when connecting to a live backend.

Development

Localization

Translation files live in assets/translations/:

  • app_en.arb β€” English
  • app_es.arb β€” Spanish

Add or update keys in both files, then use .tr(ref) via the localization utilities.

Linting

The project uses flutter_lints and riverpod_lint with a custom lint plugin. Run analysis with:

flutter analyze

Tests

flutter test

License

Private project β€” not published to pub.dev (publish_to: 'none').


Made with care by Viivek Kumar