# narenmicom/student-navi architecture

> Architecture diagram of the GitHub repository narenmicom/student-navi, 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/narenmicom/student-navi
- Repository: https://github.com/narenmicom/student-navi

## Overview

##### Project type and purpose
- Project type: A cross-platform Flutter full-stack application (targets Android, iOS, Web, Windows, Linux).
- Purpose: Provide a “Student-Navi” interface for students and faculty to manage announcements, events, attendance, notes, etc., with authentication and data storage powered by Supabase.

##### File structure
- Top-level platform folders (android/, ios/, web/, linux/, windows/) indicate Flutter’s multi-platform support.
- The lib/ directory follows a layered architecture:
– lib/views/… → Presentation layer with Flutter widgets and BLoC classes per feature (Announcements, Events, Attendance, Subjects).
– lib/services/… → Service layer, including auth (AuthProvider, SupabaseProvider) and BLoC providers.
– lib/helpers/… & lib/utilities/… → UI helpers (loading screens, dialogs, size config, side drawer).
- State management: BLoC pattern extensively used in features under lib/services/auth/bloc and lib/views/**/bloc.
- No custom backend code: the app calls Supabase APIs directly.

##### README
- Confirms tech stack: Flutter + Supabase
- Mentions expansion plans for BLoC usage (already in place for many modules).

a. Main components
– Clients: Flutter UI running on Mobile (Android/iOS) and Desktop/Web (Windows, Linux, Web).
– Presentation layer: Flutter Views & Widgets (login, register, student_homepage, faculty_homepage, feature screens).
– Business logic layer: BLoCs (AuthBloc, AnnouncementHomepageBloc, EventsHomepageBloc, etc.).
– Service/Data layer: AuthProvider & SupabaseProvider communicate with Supabase.
– External backend: Supabase services (Authentication, Postgres Database, Storage, Real-time).
– Helpers & Utilities: Loading/Dialogs, Settings, SideDrawer.

b. Relationships & interactions
– Users interact with the Flutter UI.
– UI components dispatch Events to BLoCs.
– BLoCs process events, call Methods on Providers.
– Providers perform HTTP/Realtime requests to Supabase Auth & Database services.
– Supabase returns responses/updates which propagate back through Providers → BLoCs → UI streams.

c. Architectural patterns
– Layered architecture (Presentation → BLoC → Services → External).
– BLoC for state management, separating UI from business logic.
– Platform abstraction via Flutter engine for multi-OS support.

d. Key technologies & libraries
– Flutter & Dart
– flutter_bloc (BLoC pattern)
– supabase_flutter (Supabase integration)
– Platform SDKs (Android, iOS, Web, Windows, Linux)

## Diagram (Mermaid)

```mermaid
flowchart TD
  subgraph "Clients (Flutter engine targets)"
    AND["Android"]:::client
    IOS["iOS"]:::client
    WEB["Web"]:::client
    LNX["Linux"]:::client
    WIN["Windows"]:::client
  end
  click AND "https://github.com/narenmicom/student-navi/tree/main/android/"
  click IOS "https://github.com/narenmicom/student-navi/tree/main/ios/"
  click WEB "https://github.com/narenmicom/student-navi/tree/main/web/"
  click LNX "https://github.com/narenmicom/student-navi/tree/main/linux/"
  click WIN "https://github.com/narenmicom/student-navi/tree/main/windows/"

  subgraph "Student-Navi App"
    subgraph "Presentation Layer"
      MAIN["main.dart"]:::presentation
      ROUTER["app_router.dart"]:::presentation
      Login["login_view.dart"]:::presentation
      Register["register_view.dart"]:::presentation
      Profile["profile_view.dart"]:::presentation
      Landing["overal_view.dart"]:::presentation

      subgraph "Faculty Features"
        AnnAdd["add_announcement_view.dart"]:::presentation
        AnnAll["all_announcement_view.dart"]:::presentation
        AnnTile["announcement_tile.dart"]:::presentation
        EvAdd["add_event_view.dart"]:::presentation
        EvAll["all_events_view.dart"]:::presentation
        EvTile["event_tile.dart"]:::presentation
        AtView["attendance_view.dart"]:::presentation
        AtTake["attendance_taking_view.dart"]:::presentation
        AtReport["attendance_report_view.dart"]:::presentation
        SubjView["subjects_view.dart"]:::presentation
        NotesAdd["add_new_notes_view.dart"]:::presentation
        SubjAll["all_subjects_view.dart"]:::presentation
        NotesList["notes_list_view.dart"]:::presentation
        PDFf["pdf_viewer.dart"]:::presentation
        Subj["subject.dart"]:::presentation
      end

      subgraph "Student Features"
        SAtReport["attendance_report.dart"]:::presentation
        SEvAll["all_events_view.dart"]:::presentation
        SSubjAll["all_subjects_view.dart"]:::presentation
        SPDF["pdf_viewer.dart"]:::presentation
        SSubj["subject.dart"]:::presentation
      end

      subgraph "Helpers & Utilities"
        LoadHScr["loading_screen.dart"]:::helper
        LoadHCtrl["loading_screen_controller.dart"]:::helper
        DataCls["data_classes.dart"]:::helper
        GenericU["generic.dart"]:::helper
        Settings["settings.dart"]:::helper
        SideDrawer["side_drawer.dart"]:::helper
        SizeCfg["size_config.dart"]:::helper
        ErrDlg["error_dialog.dart"]:::helper
        GenDlg["generic_dialog.dart"]:::helper
        LoadDlg["loading_dialog.dart"]:::helper
      end
    end

    subgraph "Business Logic Layer"
      AuthBloc["auth_bloc.dart"]:::bloc
      AuthEvt["auth_event.dart"]:::bloc
      AuthState["auth_state.dart"]:::bloc
      AnnBloc["announcement_homepage_bloc.dart"]:::bloc
      EvBloc["events_homepage_bloc.dart"]:::bloc
      FacHPBloc["faculty_home_page_bloc.dart"]:::bloc
    end

    subgraph "Service/Data Layer"
      AuthProv["auth_provider.dart"]:::service
      SupProv["supabaseprovider.dart"]:::service
      AuthEx["auth_exception.dart"]:::service
    end
  end

  subgraph "Supabase Services"
    SupAuth["Auth Service"]:::external
    SupDB["Postgres DB"]:::database
    SupStorage["Storage"]:::external
    SupRealtime["Real-time"]:::external
  end

  AND --> MAIN
  IOS --> MAIN
  WEB --> MAIN
  LNX --> MAIN
  WIN --> MAIN

  MAIN --> ROUTER
  ROUTER --> Login
  ROUTER --> Register
  ROUTER --> Profile
  ROUTER --> Landing

  Login --> AuthBloc
  Register --> AuthBloc
  Profile --> AuthBloc
  Landing --> AnnBloc
  Landing --> EvBloc
  Landing --> FacHPBloc

  AnnAdd --> AnnBloc
  AnnAll --> AnnBloc
  EvAdd --> EvBloc
  EvAll --> EvBloc
  AtView --> AnnBloc
  AtTake --> AnnBloc
  AtReport --> AnnBloc
  SubjView --> AnnBloc
  NotesAdd --> FacHPBloc
  SubjAll --> FacHPBloc
  NotesList --> FacHPBloc
  PDFf --> FacHPBloc
  Subj --> FacHPBloc

  SAtReport --> AnnBloc
  SEvAll --> EvBloc
  SSubjAll --> FacHPBloc
  SPDF --> FacHPBloc
  SSubj --> FacHPBloc

  AuthBloc --> AuthProv
  AnnBloc --> SupProv
  EvBloc --> SupProv
  FacHPBloc --> SupProv

  AuthProv --> SupAuth
  SupProv --> SupDB
  SupProv --> SupStorage
  SupProv --> SupRealtime

  SupAuth --> AuthProv
  SupDB --> SupProv
  SupStorage --> SupProv
  SupRealtime --> SupProv

  AuthProv --> AuthBloc
  SupProv --> AnnBloc
  SupProv --> EvBloc
  SupProv --> FacHPBloc

  click MAIN "https://github.com/narenmicom/student-navi/blob/main/lib/main.dart"
  click ROUTER "https://github.com/narenmicom/student-navi/blob/main/lib/views/app_router.dart"
  click Login "https://github.com/narenmicom/student-navi/blob/main/lib/views/login_view.dart"
  click Register "https://github.com/narenmicom/student-navi/blob/main/lib/views/register_view.dart"
  click Profile "https://github.com/narenmicom/student-navi/blob/main/lib/views/profile_view.dart"
  click Landing "https://github.com/narenmicom/student-navi/blob/main/lib/views/overal_view.dart"
  click AnnAdd "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Announcement/add_announcement_view.dart"
  click AnnAll "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Announcement/all_announcement_view.dart"
  click AnnTile "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Announcement/announcement_tile.dart"
  click EvAdd "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Events/add_event_view.dart"
  click EvAll "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Events/all_events_view.dart"
  click EvTile "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Events/event_tile.dart"
  click AtView "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Attendance/attendance_view.dart"
  click AtTake "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Attendance/attendance_taking_view.dart"
  click AtReport "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Attendance/attendance_report_view.dart"
  click SubjView "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Attendance/subjects_view.dart"
  click NotesAdd "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Subjects/add_new_notes_view.dart"
  click SubjAll "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Subjects/all_subjects_view.dart"
  click NotesList "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Subjects/notes_list_view.dart"
  click PDFf "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Subjects/pdf_viewer.dart"
  click Subj "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Subjects/subject.dart"
  click SAtReport "https://github.com/narenmicom/student-navi/blob/main/lib/views/Student/Attendance/attendance_report.dart"
  click SEvAll "https://github.com/narenmicom/student-navi/blob/main/lib/views/Student/Events/all_events_view.dart"
  click SSubjAll "https://github.com/narenmicom/student-navi/blob/main/lib/views/Student/Subjects/all_subjects_view.dart"
  click SPDF "https://github.com/narenmicom/student-navi/blob/main/lib/views/Student/Subjects/pdf_viewer.dart"
  click SSubj "https://github.com/narenmicom/student-navi/blob/main/lib/views/Student/Subjects/subject.dart"
  click AuthBloc "https://github.com/narenmicom/student-navi/blob/main/lib/services/auth/bloc/auth_bloc.dart"
  click AuthEvt "https://github.com/narenmicom/student-navi/blob/main/lib/services/auth/bloc/auth_event.dart"
  click AuthState "https://github.com/narenmicom/student-navi/blob/main/lib/services/auth/bloc/auth_state.dart"
  click AnnBloc "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Announcement/bloc/announcement_homepage_bloc.dart"
  click EvBloc "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/Events/bloc/events_homepage_bloc.dart"
  click FacHPBloc "https://github.com/narenmicom/student-navi/blob/main/lib/views/Faculty/HomePage/bloc/faculty_home_page_bloc.dart"
  click AuthProv "https://github.com/narenmicom/student-navi/blob/main/lib/services/auth/auth_provider.dart"
  click SupProv "https://github.com/narenmicom/student-navi/blob/main/lib/services/auth/supabaseprovider.dart"
  click AuthEx "https://github.com/narenmicom/student-navi/blob/main/lib/services/auth/auth_exception.dart"
  click LoadHScr "https://github.com/narenmicom/student-navi/blob/main/lib/helpers/loading/loading_screen.dart"
  click LoadHCtrl "https://github.com/narenmicom/student-navi/blob/main/lib/helpers/loading/loading_screen_controller.dart"
  click DataCls "https://github.com/narenmicom/student-navi/blob/main/lib/utilities/data_classes.dart"
  click GenericU "https://github.com/narenmicom/student-navi/blob/main/lib/utilities/generic.dart"
  click Settings "https://github.com/narenmicom/student-navi/blob/main/lib/utilities/settings.dart"
  click SideDrawer "https://github.com/narenmicom/student-navi/blob/main/lib/utilities/side_drawer.dart"
  click SizeCfg "https://github.com/narenmicom/student-navi/blob/main/lib/utilities/size_config.dart"
  click ErrDlg "https://github.com/narenmicom/student-navi/blob/main/lib/utilities/dialog/error_dialog.dart"
  click GenDlg "https://github.com/narenmicom/student-navi/blob/main/lib/utilities/dialog/generic_dialog.dart"
  click LoadDlg "https://github.com/narenmicom/student-navi/blob/main/lib/utilities/dialog/loading_dialog.dart"

  classDef client fill:#f9f,stroke:#333,stroke-width:2px
  classDef presentation fill:#bbf,stroke:#333,stroke-width:1px
  classDef helper fill:#ddd,stroke:#333,stroke-width:1px
  classDef bloc fill:#bfb,stroke:#333,stroke-width:1px
  classDef service fill:#f96,stroke:#333,stroke-width:1px
  classDef external fill:#d9d,stroke:#333,stroke-width:1px
  classDef database fill:#96f,stroke:#333,stroke-width:2px
```
