# syedwajid01/ounotes architecture

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

- Interactive diagram: https://gitdiagram.com/syedwajid01/ounotes
- Repository: https://github.com/syedwajid01/ounotes

## Overview

##### Project type and purpose
- OU Notes is a Flutter-based mobile (and web) application for Osmania University students to browse, upload, download and report educational documents.
- It follows the “Stacked Architecture” (MVVM-like) on the client side and uses Firebase & other third-party services as its backend.

##### File structure
- Top-level:
- android/ and ios/ folders containing native build configurations and platform integration
- lib/ folder with the complete Flutter app
- assets/ and web/ for static assets (fonts, images, Lottie animations, HTML manifest)
- lib/ is subdivided into:
- app/ (service locator, router, logger)
- models/ (domain entities: Document, Syllabus, User, etc.)
- services/
– functional_services/ (Auth, Firestore, Cloud Storage, SharedPrefs, Email, etc.)
– state_services/ (ViewModel-backing services: NotesService, DownloadService, etc.)
- ui/
– views/ (screen widgets + viewmodels)
– widgets/ (dumb & smart reusable components)
- AppTheme/, CustomIcons/, enums/, misc/, utils/
- pubspec.yaml declares dependencies such as stacked, stacked_services, firebase_auth, firestore, shared_preferences, file_picker, url_launcher, etc.

##### Extracted insights from README
- Confirms use of Stacked (MVVM), service locator (get_it under the hood), and a router code-generator.
- Lists feature set (PDF viewer, download management, reporting, notifications, uploads).
- Shows that backend is entirely Firebase (Auth, Firestore, Storage, Analytics) plus email and local storage.

##### Detail level
- Every major folder as a module
- Interactions (e.g., “ViewModel → FirestoreService.fetchDocuments() → Firestore”)
- Router flow (e.g., Splash → Intro → Home → DocumentDetails)
- Don’t over-aggregate: break out both dumb_widgets and smart_widgets, functional_services vs state_services

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        UI["UI / Views"]:::ui
        Widgets["Widgets (dumb & smart)"]:::ui
    end

    %% Application Layer
    subgraph "Application Layer"
        VM["ViewModels"]:::app
        Router["Router"]:::app
        Locator["Service Locator"]:::app
        Logger["Logger"]:::app
    end

    %% Domain/Service Layer
    subgraph "Domain/Service Layer"
        SS["State Services"]:::service
        FS["Functional Services"]:::service
    end

    %% Data Sources / Infrastructure
    subgraph "Data Sources / Infrastructure"
        Auth[(Firebase Auth)]:::db
        Firestore[(Firestore Database)]:::db
        Storage[(Firebase Storage)]:::db
        SharedPrefs[(Shared Preferences)]:::db
        EmailS[(Email Service)]:::db
        DB[(Local DB Service)]:::db
    end

    %% Platform Modules
    subgraph "Platform Modules"
        Android["Android"]:::platform
        iOS["iOS"]:::platform
        Web["Web"]:::platform
    end

    %% Connections
    UI -->|"invokes"| VM
    Widgets -->|"uses"| VM
    VM -->|"calls"| SS
    SS -->|"delegates to"| FS
    FS -->|"wraps SDK calls to"| Auth
    FS -->|"wraps SDK calls to"| Firestore
    FS -->|"wraps SDK calls to"| Storage
    FS -->|"wraps SDK calls to"| SharedPrefs
    FS -->|"wraps SDK calls to"| EmailS
    FS -->|"wraps SDK calls to"| DB
    VM -->|"navigates via"| Router
    VM -->|"injected by"| Locator
    VM -->|"logs via"| Logger

    %% Click Events
    click UI "https://github.com/syedwajid01/ounotes/tree/master/lib/ui/views"
    click Widgets "https://github.com/syedwajid01/ounotes/tree/master/lib/ui/widgets"
    click VM "https://github.com/syedwajid01/ounotes/blob/master/lib/ui/views/home/home_viewmodel.dart"
    click Router "https://github.com/syedwajid01/ounotes/blob/master/lib/app/router.dart"
    click Locator "https://github.com/syedwajid01/ounotes/blob/master/lib/app/locator.dart"
    click Logger "https://github.com/syedwajid01/ounotes/blob/master/lib/app/logger.dart"
    click SS "https://github.com/syedwajid01/ounotes/tree/master/lib/services/state_services"
    click FS "https://github.com/syedwajid01/ounotes/tree/master/lib/services/funtional_services"
    click Auth "https://github.com/syedwajid01/ounotes/blob/master/lib/services/funtional_services/authentication_service.dart"
    click Firestore "https://github.com/syedwajid01/ounotes/blob/master/lib/services/funtional_services/firestore_service.dart"
    click Storage "https://github.com/syedwajid01/ounotes/blob/master/lib/services/funtional_services/cloud_storage_service.dart"
    click SharedPrefs "https://github.com/syedwajid01/ounotes/blob/master/lib/services/funtional_services/sharedpref_service.dart"
    click EmailS "https://github.com/syedwajid01/ounotes/blob/master/lib/services/funtional_services/email_service.dart"
    click DB "https://github.com/syedwajid01/ounotes/blob/master/lib/services/funtional_services/db_service.dart"
    click Android "https://github.com/syedwajid01/ounotes/tree/master/android/"
    click iOS "https://github.com/syedwajid01/ounotes/tree/master/ios/"
    click Web "https://github.com/syedwajid01/ounotes/tree/master/web/"

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#0366D6,color:#0366D6,stroke-width:1px;
    classDef app fill:#D5F8E3,stroke:#028A0F,color:#028A0F,stroke-width:1px;
    classDef service fill:#FFF4C1,stroke:#D4A200,color:#D4A200,stroke-width:1px;
    classDef db fill:#F0F0F0,stroke:#666666,color:#333333,stroke-width:1px;
    classDef platform fill:#E0E0E0,stroke:#999999,color:#333333,stroke-width:1px;
```
