# intanaqilah-mf/smart-move architecture

> Architecture diagram of the GitHub repository intanaqilah-mf/smart-move, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/intanaqilah-mf/smart-move
- Repository: https://github.com/intanaqilah-mf/smart-move

## Overview

##### Project type and purpose
- This is a cross-platform full-stack mobile/web/desktop application built in Flutter, named “smart_move.”
- It includes:
- A Flutter frontend targeting Android, iOS, Web, and Windows
- A Node.js “backend” service (backend/index.js)
- Firebase Cloud Functions under the “functions” directory
- Firebase hosting and services (firebase.json, .firebaserc, lib/firebase_options.dart)

##### File structure
- Top-level Flutter targets:
- android/, ios/, web/, windows/ — native shells generated by Flutter
- lib/ — your Dart application code, organized into screens/, services/, widgets/
- Backend tiers:
- backend/ — a standalone Node.js service entry point (index.js)
- functions/ — Firebase Cloud Functions in TypeScript/JavaScript
- Configuration and orchestration:
- firebase.json, .firebaserc — Firebase project and hosting configuration
- pubspec.yaml — Flutter dependencies
- package.json files in backend/ and functions/ — Node.js dependencies

##### README
- It’s the standard Flutter boilerplate.
- The presence of lib/firebase_options.dart (auto-generated Firebase config) implies integration with Firestore/Auth/Storage and Cloud Functions.

- Labels: use clear names like “Flutter UI,” “BusDataService,” “Firestore,” “Cloud Function: generateCrowd”
- Green for Firebase managed services
- Orange for custom backend (Node.js)

##### Detailed capture of essential elements
- On the client, list key Dart packages (firebase_core, cloud_firestore, http, etc.)
- On the server, annotate whether backend/index.js is an Express app or uses Firebase Admin
- Build/deploy flow: code → Firebase CLI → hosting & functions

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Zone
    subgraph "Client"
        direction TB
        FlutterClient["Flutter Client"]:::client
        subgraph "Platforms"
            direction TB
            Android["Android Shell"]:::client
            iOS["iOS Shell"]:::client
            WebShell["Web Shell"]:::client
            WindowsShell["Windows Shell"]:::client
        end
        subgraph "Presentation Layer"
            direction TB
            Screens["Screens"]:::client
            Widgets["Widgets"]:::client
        end
        subgraph "Business Logic Layer"
            direction TB
            Services["Services"]:::client
        end
        subgraph "Data Layer"
            direction TB
            FirebaseSDK["Firebase SDK"]:::client
            HTTPClient["HTTP Client"]:::client
        end
        FirebaseOptions["Firebase Config"]:::client
        FlutterClient -->|runs on| Android
        FlutterClient -->|runs on| iOS
        FlutterClient -->|runs on| WebShell
        FlutterClient -->|runs on| WindowsShell
        FlutterClient -->|uses| Screens
        FlutterClient -->|uses| Widgets
        FlutterClient -->|uses| Services
        Services -->|calls| FirebaseSDK
        Services -->|calls| HTTPClient
        FirebaseSDK -->|configured by| FirebaseOptions
    end

    %% Server/Cloud Zone
    subgraph "Server/Cloud"
        direction TB
        subgraph "Firebase Cloud" 
            direction TB
            Auth["Authentication"]:::firebase
            Firestore["Firestore"]:::firebase
            Storage["Cloud Storage"]:::firebase
            Messaging["Cloud Messaging"]:::firebase
            subgraph "Hosting & Config"
                direction TB
                FirebaseConfig["firebase.json / .firebaserc"]:::firebase
            end
        end
        subgraph "Cloud Functions"
            direction TB
            FunctionsIndex["Functions Entry (index.js)"]:::functions
            GenerateCrowd["Function: generateCrowd"]:::functions
            GenkitConfig["GenKit Config"]:::functions
        end
        subgraph "Node.js Backend"
            direction TB
            NodeBackend["Backend Entry (index.js)"]:::backend
            BackendDeps["package.json / package-lock.json"]:::backend
        end

        %% Interactions
        FirebaseSDK -->|"SDK Calls"| Auth
        FirebaseSDK -->|"SDK Calls"| Firestore
        FirebaseSDK -->|"SDK Calls"| Storage
        FirebaseSDK -->|"SDK Calls"| Messaging
        HTTPClient -->|"HTTP Requests"| NodeBackend
        NodeBackend -->|"Admin SDK"| Firestore
        NodeBackend -->|"Admin SDK"| Auth
        Firestore -->|onWrite Trigger| FunctionsIndex
        FunctionsIndex -->|"invokes"| GenerateCrowd
        FunctionsIndex -->|"reads/writes"| Firestore
        FunctionsIndex -->|"reads/writes"| Storage
    end

    %% Click Events
    click lib/ "https://github.com/intanaqilah-mf/smart-move/tree/master/lib/"
    click lib/screens/ "https://github.com/intanaqilah-mf/smart-move/tree/master/lib/screens/"
    click lib/widgets/ "https://github.com/intanaqilah-mf/smart-move/tree/master/lib/widgets/"
    click lib/services/ "https://github.com/intanaqilah-mf/smart-move/tree/master/lib/services/"
    click lib/firebase_options.dart "https://github.com/intanaqilah-mf/smart-move/blob/master/lib/firebase_options.dart"
    click firebase.json "https://github.com/intanaqilah-mf/smart-move/blob/master/firebase.json"
    click .firebaserc "https://github.com/intanaqilah-mf/smart-move/blob/master/.firebaserc"
    click functions/ "https://github.com/intanaqilah-mf/smart-move/tree/master/functions/"
    click functions/index.js "https://github.com/intanaqilah-mf/smart-move/blob/master/functions/index.js"
    click functions/flows/generateCrowd.ts "https://github.com/intanaqilah-mf/smart-move/blob/master/functions/flows/generateCrowd.ts"
    click functions/genkit.config.ts "https://github.com/intanaqilah-mf/smart-move/blob/master/functions/genkit.config.ts"
    click backend/index.js "https://github.com/intanaqilah-mf/smart-move/blob/master/backend/index.js"
    click backend/package.json "https://github.com/intanaqilah-mf/smart-move/blob/master/backend/package.json"
    click backend/package-lock.json "https://github.com/intanaqilah-mf/smart-move/blob/master/backend/package-lock.json"
    click android/ "https://github.com/intanaqilah-mf/smart-move/tree/master/android/"
    click ios/ "https://github.com/intanaqilah-mf/smart-move/tree/master/ios/"
    click web/ "https://github.com/intanaqilah-mf/smart-move/tree/master/web/"
    click windows/ "https://github.com/intanaqilah-mf/smart-move/tree/master/windows/"

    %% Styles
    classDef client fill:#cfe2f3,stroke:#6fa8dc,color:#073763
    classDef firebase fill:#d9ead3,stroke:#93c47d,color:#274e13
    classDef functions fill:#ead1dc,stroke:#c27ba0,color:#741b47
    classDef backend fill:#f9cb9c,stroke:#e69138,color:#7f6000
```
