# adityamakkar000/turnerfentondeca architecture

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

- Interactive diagram: https://gitdiagram.com/adityamakkar000/turnerfentondeca
- Repository: https://github.com/adityamakkar000/turnerfentondeca

## Overview

##### Main Components
- Client (Browser): Represents the user’s interaction layer that loads and displays the static assets (inside the public folder with CSS files) and interacts with the dynamic pages rendered by EJS templates (located in the views folder).
- Server (Node.js Application):
- Central application logic provided by app.js.
- Modules supporting functionality such as gmail.js for Google login procedures, token.js for session or token management, and send.js/nameTruncator.js for auxiliary tasks.
- The googleSetup files likely contain configuration or helper routines for handling Google OAuth.
- PDF Extraction Service (Python Subsystem):
- A separate component (within the pdfextractor folder) with Python scripts (app.py, pdfText.py) and precompiled cache (in __pycache__), which is potentially used for extracting or processing content from PDF documents.
- External Services:
- Google Authentication may be integrated into the system via OAuth – represented as an external dependency that interacts with the server.
- Optionally, any analytics/charting libraries used on the client side (to display the pie graph) might be noted if known from additional documentation.

##### Relationships and Interactions
- Client <-> Server: Users browse the DECA web application pages (landing, home, questions, etc.) that are rendered by EJS views. The interaction happens via HTTP requests that hit the Node.js server.
- Server <-> External (Google Auth): The server handles login and authentication by sending users to Google’s OAuth service (using the googleSetup configuration). Successful authentication returns tokens, which are managed by token.js.
- Server <-> PDF Extraction Service: If PDF processing is required for extracting questions or content, the server may call or integrate with the Python-based pdfextractor service. This could be an internal API call or an offline processing step.
- Client <-> Static Assets: The client receives CSS (and potentially client-side JavaScript, not shown but likely referred in overall asset management) from the public folder.

##### Architectural Patterns and Technologies
- MVC-like Structure: Although not a strict MVC framework, there’s a separation between “views” (EJS files), “controller logic” (in app.js and node modules handling routes and authentication), and “model” (likely interacting with sessions, tokens, or possibly a database that isn’t explicitly shown in the file tree).
- Middleware/Services: The use of separate modules (gmail.js, token.js, send.js) allows for clean separation of functionality.
- Microservice-like or Standalone Utility: The PDF extractor is implemented in Python, serving as a utility or microservice decoupled from the core Node.js application.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        C["Client (Browser)"]:::client
        Static["Static Assets (public/css)"]:::client
        Views["Views (EJS Templates)"]:::client
    end

    %% Backend Server
    subgraph "Backend Server"
        S["Express Server (app.js)"]:::server
        Gmail["Google Auth (gmail.js)"]:::server
        Token["Token Management (token.js)"]:::server
        GSetup["Google Setup (googleSetup)"]:::server
        Send["Send Module (send.js)"]:::server
        NameTrunc["Name Truncator (nameTruncator.js)"]:::server
    end

    %% PDF Extraction Service (Python)
    subgraph "PDF Extraction Service (Python)"
        PDFApp["PDF App (app.py)"]:::pdf
        PDFText["PDF Text Extractor (pdfText.py)"]:::pdf
        PyCache["Cache (__pycache__)"]:::pdf
    end

    %% External Service
    External["Google OAuth Service"]:::external

    %% Relationships
    C -->|"HTTPRequest"| S
    S -->|"Renders"| Views
    Views -->|"Displayed"| C
    C -->|"Loads"| Static

    %% Internal server module interactions
    S -->|"Calls"| Gmail
    S -->|"Calls"| Token
    S -->|"Uses"| GSetup
    S -->|"Executes"| Send
    S -->|"Executes"| NameTrunc

    %% Google Authentication interactions
    Gmail -->|"InitiateOAuth"| External
    External -->|"ReturnToken"| Token

    %% PDF Extraction interactions
    S -->|"ProcessPDF"| PDFApp
    PDFApp -->|"ReturnResult"| S

    %% Class definitions for colors
    classDef client fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef server fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef pdf fill:#F08080,stroke:#333,stroke-width:2px;
    classDef external fill:#FFD700,stroke:#333,stroke-width:2px;

    %% Click Events (using component mapping)
    click Static "https://github.com/adityamakkar000/turnerfentondeca/tree/master/public/css"
    click Views "https://github.com/adityamakkar000/turnerfentondeca/tree/master/views"
    click S "https://github.com/adityamakkar000/turnerfentondeca/blob/master/app.js"
    click Gmail "https://github.com/adityamakkar000/turnerfentondeca/blob/master/gmail.js"
    click Token "https://github.com/adityamakkar000/turnerfentondeca/blob/master/token.js"
    click GSetup "https://github.com/adityamakkar000/turnerfentondeca/tree/master/googleSetup"
    click Send "https://github.com/adityamakkar000/turnerfentondeca/blob/master/send.js"
    click NameTrunc "https://github.com/adityamakkar000/turnerfentondeca/blob/master/nameTruncator.js"
    click PDFApp "https://github.com/adityamakkar000/turnerfentondeca/blob/master/pdfextractor/app.py"
    click PDFText "https://github.com/adityamakkar000/turnerfentondeca/blob/master/pdfextractor/pdfText.py"
    click PyCache "https://github.com/adityamakkar000/turnerfentondeca/tree/master/pdfextractor/__pycache__"
```
