# dillibasker/jec_app architecture

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

- Interactive diagram: https://gitdiagram.com/dillibasker/jec_app
- Repository: https://github.com/dillibasker/jec_app

## Overview

##### Main components
- Flutter Frontend: This module is multi-platform (Android, iOS, Web, Windows, macOS, Linux) and includes various pages like login, homepage, attendence page, assignment page, exam timetable, etc.
- Node.js Backend: This module provides RESTful API endpoints, as seen in its directory structure with routes for “Attendence” (adding students, fetching records, marking attendance), “auth” (login, register, forgot/reset password, Google auth), and “profile” (user profile management with an auth middleware).
- Database (Implied): Although not explicitly shown in the file structure, the existence of models (Department, students, userSchema) suggests that there is a database layer that the Node backend interacts with.
- External Services: Depending on the authentication routes (such as Google auth) and potential integrations (like email for password resets), there may be external APIs or services involved.

##### Architectural patterns and design principles
- Separation of Concerns: The clear split between the frontend and backend shows adherence to this pattern.
- REST API Design: The Node backend’s route structure suggests a clean RESTful architecture.
- Cross-Platform Design: The Flutter frontend is designed to work across multiple operating systems, which is an important design nuance.
- Middleware/Authentication: The “authMiddleware” in the profile routes signals the use of middleware for authentication/authorization.

##### Relevant technologies and frameworks
- Frontend: Flutter (Dart) framework for mobile and multi-platform applications.
- Backend: Node.js, with Express.js (inferred from route structure) for routing and API handling.
- Authentication/External APIs: Google authentication and password recovery methods imply integration with external identity providers.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Flutter Frontend Section
    subgraph "Flutter Frontend"
        F1("Flutter Frontend"):::frontend
        F2("App Screens (Login,Homepage,Attendance,Timetable)"):::frontend
    end

    %% Node.js Backend Section
    subgraph "Node.js Backend"
        NB1("Express Server (API)"):::backend
        subgraph "Routes"
            A("Attendance Routes"):::routes
            B("Authentication Routes"):::routes
            C("Profile Routes (with_auth_middleware)"):::routes
        end
        NB2("Database Schemas (Models)"):::backend
    end

    %% External and Database Nodes
    ES("Google OAuth API"):::external
    DB("Database"):::database

    %% Connections
    F2 -->|"API_calls"| NB1
    NB1 -->|"handles"| A
    NB1 -->|"handles"| B
    NB1 -->|"handles"| C
    NB1 -->|"CRUD_calls"| DB
    NB2 -->|"defines_models_for"| DB
    B -->|"OAuth_calls"| ES

    %% Click Events
    click F1 "https://github.com/dillibasker/jec_app/tree/main/JEC_STAFF_APP/Flutter-Frontend-Attendence"
    click F2 "https://github.com/dillibasker/jec_app/tree/main/JEC_STAFF_APP/Flutter-Frontend-Attendence/lib/pages"
    click NB1 "https://github.com/dillibasker/jec_app/blob/main/JEC_STAFF_APP/Node-Backend-Attendence/server.js"
    click A "https://github.com/dillibasker/jec_app/tree/main/JEC_STAFF_APP/Node-Backend-Attendence/Routes/Attendence"
    click B "https://github.com/dillibasker/jec_app/tree/main/JEC_STAFF_APP/Node-Backend-Attendence/Routes/auth"
    click C "https://github.com/dillibasker/jec_app/tree/main/JEC_STAFF_APP/Node-Backend-Attendence/Routes/profile"
    click NB2 "https://github.com/dillibasker/jec_app/tree/main/JEC_STAFF_APP/Node-Backend-Attendence/Models"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#0000FF,stroke-width:2px;
    classDef backend fill:#90EE90,stroke:#008000,stroke-width:2px;
    classDef routes fill:#FFFF99,stroke:#DAA520,stroke-width:2px;
    classDef external fill:#FFA07A,stroke:#FF4500,stroke-width:2px;
    classDef database fill:#D3D3D3,stroke:#696969,stroke-width:2px;
```
