# omkarnirala/flutter_my_notes architecture

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

- Interactive diagram: https://gitdiagram.com/omkarnirala/flutter_my_notes
- Repository: https://github.com/omkarnirala/flutter_my_notes

## Overview

##### Project type and purpose
- This is a cross-platform full-stack mobile/desktop/web application built with Flutter (Dart) that uses Firebase (Firestore) as its backend for real-time data persistence and sync. Its sole domain purpose is “Notes” management (create, read, update, delete).

##### File structure
- Top-level “android”, “ios”, “linux”, “macos”, “windows”, “web” folders contain native runner code and embedding for each platform.
- The “lib” folder holds the core Dart code:
- lib/main.dart – app entry point
- lib/edit_note_screen.dart – UI for create/edit
- lib/Model/Note.dart – data model
- lib/Service/FirestoreService.dart – data access layer
- lib/firebase_options.dart – auto‐generated Firebase config
- pubspec.yaml, firebase_app_id_file.json, google-services.json/plist are config files for Firebase setup.

##### README for additional insights
- UI layer: two main screens (NoteListScreen, EditNoteScreen); uses widgets like ListTile, TextField, AppBar, SnackBar.
- Backend: Firebase Firestore for CRUD.
- App flow: launch → fetch & render → navigate to edit → validate & save → real-time sync.

##### Elements
[Android/iOS/Web/Desktop Runner]
[Flutter Engine & Dart VM]
[Presentation Layer (NoteListScreen, EditNoteScreen)]
[Service Layer (FirestoreService)]
[Data Model (Note)]
[Firebase Firestore Database]
“user input” (UI ← user),
“CRUD request” (UI → Service),
“Firestore API call” (Service → Firestore),
“data response” (Firestore → Service → UI)
- Blue for UI components
- Green for service/model
- Orange for external services
- Rectangles for modules
- Parallelograms for config files

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Platform Runners
    subgraph "Platform Runners"
        direction TB
        Android["Android Runner"]:::platform
        iOS["iOS Runner"]:::platform
        Linux["Linux Runner"]:::platform
        macOS["macOS Runner"]:::platform
        Windows["Windows Runner"]:::platform
        Web["Web Runner"]:::platform
    end

    %% Flutter Engine & Dart VM
    FlutterEngine["Flutter Engine & Dart VM"]:::engine

    %% Config Files
    subgraph "Configuration Files"
        direction TB
        DartConfig["firebase_options.dart"]:::config
        AndroidConfig["google-services.json"]:::config
        iOSConfig["GoogleService-Info.plist (iOS)"]:::config
        macOSConfig["GoogleService-Info.plist (macOS)"]:::config
        AppIDFile["firebase_app_id_file.json"]:::config
        Pubspec["pubspec.yaml"]:::config
    end

    %% Presentation Layer
    subgraph "Presentation Layer" 
        direction TB
        NoteList["NoteListScreen"]:::frontend
        EditNote["EditNoteScreen"]:::frontend
    end

    %% Service & Model
    subgraph "Business Layer"
        direction TB
        FirestoreService["FirestoreService"]:::service
        NoteModel["Note Model"]:::model
    end

    %% Backend
    Firebase["Firebase Firestore"]:::backend

    %% User
    User["User"]:::user

    %% Connections
    User -->|"user input"| NoteList
    NoteList -->|"navigate/edit"| EditNote
    NoteList -->|"CRUD request"| FirestoreService
    EditNote -->|"CRUD request"| FirestoreService
    FirestoreService -->|"uses config"| DartConfig
    FirestoreService -->|"Firestore API call"| Firebase
    Firebase -->|"data response"| FirestoreService
    FirestoreService -->|"maps to model"| NoteModel
    NoteModel -->|"updates UI"| NoteList
    NoteModel -->|"updates UI"| EditNote

    Android -->|"bootstraps"| FlutterEngine
    iOS -->|"bootstraps"| FlutterEngine
    Linux -->|"bootstraps"| FlutterEngine
    macOS -->|"bootstraps"| FlutterEngine
    Windows -->|"bootstraps"| FlutterEngine
    Web -->|"bootstraps"| FlutterEngine

    FlutterEngine -->|"starts"| NoteList
    FlutterEngine -->|"starts"| EditNote

    AndroidConfig -->|"included in build"| Android
    iOSConfig -->|"included in build"| iOS
    macOSConfig -->|"included in build"| macOS
    AppIDFile -->|"global config"| FlutterEngine
    Pubspec -->|"package config"| FlutterEngine

    %% Click Events
    click Android "https://github.com/omkarnirala/flutter_my_notes/blob/master/android/app/src/main/kotlin/com/example/notes/MainActivity.kt"
    click iOS "https://github.com/omkarnirala/flutter_my_notes/blob/master/ios/Runner/AppDelegate.swift"
    click Linux "https://github.com/omkarnirala/flutter_my_notes/blob/master/linux/main.cc"
    click macOS "https://github.com/omkarnirala/flutter_my_notes/blob/master/macos/Runner/AppDelegate.swift"
    click Windows "https://github.com/omkarnirala/flutter_my_notes/blob/master/windows/runner/main.cpp"
    click Web "https://github.com/omkarnirala/flutter_my_notes/blob/master/web/index.html"
    click DartConfig "https://github.com/omkarnirala/flutter_my_notes/blob/master/lib/firebase_options.dart"
    click AndroidConfig "https://github.com/omkarnirala/flutter_my_notes/blob/master/android/app/google-services.json"
    click iOSConfig "https://github.com/omkarnirala/flutter_my_notes/blob/master/ios/Runner/GoogleService-Info.plist"
    click macOSConfig "https://github.com/omkarnirala/flutter_my_notes/blob/master/macos/Runner/GoogleService-Info.plist"
    click AppIDFile "https://github.com/omkarnirala/flutter_my_notes/blob/master/firebase_app_id_file.json"
    click Pubspec "https://github.com/omkarnirala/flutter_my_notes/blob/master/pubspec.yaml"
    click NoteList "https://github.com/omkarnirala/flutter_my_notes/blob/master/lib/main.dart"
    click EditNote "https://github.com/omkarnirala/flutter_my_notes/blob/master/lib/edit_note_screen.dart"
    click NoteModel "https://github.com/omkarnirala/flutter_my_notes/blob/master/lib/Model/Note.dart"
    click FirestoreService "https://github.com/omkarnirala/flutter_my_notes/blob/master/lib/Service/FirestoreService.dart"

    %% Styles
    classDef platform fill:#f9f,stroke:#333,stroke-width:1px
    classDef engine fill:#ccc,stroke:#333,stroke-width:1px
    classDef config fill:#ffeb99,stroke:#333,stroke-width:1px,shape:parallelogram
    classDef frontend fill:#b3d9ff,stroke:#333,stroke-width:1px
    classDef service fill:#b3ffb3,stroke:#333,stroke-width:1px
    classDef model fill:#b3ffb3,stroke:#333,stroke-width:1px
    classDef backend fill:#ffcc99,stroke:#333,stroke-width:1px,shape:cylinder
    classDef user fill:#fff,stroke:#333,stroke-width:1px,shape:ellipse
```
