# virajmandlik/reportease-portal architecture

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

- Interactive diagram: https://gitdiagram.com/virajmandlik/reportease-portal
- Repository: https://github.com/virajmandlik/reportease-portal

## Overview

##### Project type and purpose
- This is a full-stack web application called “Reportease-Portal” composed of:
- A primary Admin/User Portal front-end (React + TypeScript + Vite + Tailwind)
- A static Landing Page site (React + TypeScript + CRA/Vite)
- A Node.js/Express back-end API server with modular PDF/HTML report generation.
- The back-end handles authentication, CRUD over academic data (courses, departments, events, clubs, etc.), Excel/PDF report creation, file uploads, and serves static reports.

##### File structure
- Top-level directories:
- Backend/ – Express API, controllers, routes, middleware, DB connection, PDF generation module, static report output.
- Frontend/ – Admin portal React app (App.tsx, components, assets, store, UI library).
- LandingPage/ – Marketing site React app (pages, components, assets).
- Backend follows an MVC-style organization: routes → controllers → utils/db layer. PDF generation is factored into a sub-module (`pdfGenModule`) with its own controllers, queries, views.
- Config and template files: `.env`-style DB config in dbConnection.js, Excel templates under Backend (e.g., `course_template.xlsx`), EJS templates in `pdfGenModule/views`.

##### README
- Minimal README indicates project name/version but no extra architecture docs. Rely on folder conventions and naming.

##### Detail
- `pdfGenModule` as a layered mini-service: Queries → Controllers → Views → Output.
- DB connection object (`dbConnection.js`) as the bridge to the Data Store.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        Admin["Admin Portal Front-end"]:::frontend
        Landing["Landing Page Front-end"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        direction TB
        API["Express API Server"]:::backend
        subgraph "API Server Components"
            direction TB
            Auth["Authentication Middleware"]:::backend
            Routes["API Routes"]:::backend
            Controllers["CRUD Controllers"]:::backend
            Upload["Upload Handler"]:::backend
            PdfModuleNode["PDF/HTML Report Generator Module"]:::backend
            DbConn["Database Connection"]:::backend
        end
    end

    %% PDF Module Sub-service
    subgraph "PDF Module"
        direction TB
        PMRoutes["PDF Module Routes"]:::backend
        PMControllers["PDF Module Controllers"]:::backend
        PMQueries["PDF Module Queries"]:::backend
        PMViews["PDF Module Views (EJS Templates)"]:::backend
    end

    %% Data Stores
    subgraph "Data Stores"
        direction TB
        DB["Database"]:::data
        subgraph "Static File Storage"
            direction TB
            HTML["HTML Reports"]:::storage
            PDFs["PDFs"]:::storage
            Creds["Report Credentials"]:::storage
        end
    end

    %% External Services
    SMTP["SMTP Service (OTP)"]:::external

    %% Connections
    Admin -->|REST calls| API
    Landing -->|REST calls| API
    API --> Auth
    API --> Routes
    Routes --> Controllers
    Controllers --> DbConn
    DbConn --> DB
    Controllers --> Upload
    Controllers --> PdfModuleNode
    Upload --> HTML
    Upload --> PDFs
    Upload --> Creds
    PdfModuleNode --> PMRoutes
    PMRoutes --> PMControllers
    PMControllers --> PMQueries
    PMControllers --> PMViews
    PMViews --> HTML
    PMViews --> PDFs
    API -->|sends OTP| SMTP
    HTML -->|download links| Admin
    PDFs -->|download links| Admin
    Creds -->|download links| Admin
    HTML -->|download links| Landing
    PDFs -->|download links| Landing
    Creds -->|download links| Landing

    %% Click Events
    click Admin "https://github.com/virajmandlik/reportease-portal/tree/main/Frontend/"
    click Landing "https://github.com/virajmandlik/reportease-portal/tree/main/LandingPage/"
    click API "https://github.com/virajmandlik/reportease-portal/blob/main/Backend/server.js"
    click DbConn "https://github.com/virajmandlik/reportease-portal/blob/main/Backend/db/dbConnection.js"
    click Auth "https://github.com/virajmandlik/reportease-portal/blob/main/Backend/middleware/authMiddleware.js"
    click Controllers "https://github.com/virajmandlik/reportease-portal/tree/main/Backend/controllers/"
    click Routes "https://github.com/virajmandlik/reportease-portal/tree/main/Backend/routes/"
    click PdfModuleNode "https://github.com/virajmandlik/reportease-portal/tree/main/Backend/pdfGenModule/"
    click PMControllers "https://github.com/virajmandlik/reportease-portal/tree/main/Backend/pdfGenModule/controllers/"
    click PMQueries "https://github.com/virajmandlik/reportease-portal/tree/main/Backend/pdfGenModule/queries/"
    click PMViews "https://github.com/virajmandlik/reportease-portal/tree/main/Backend/pdfGenModule/views/"
    click PMRoutes "https://github.com/virajmandlik/reportease-portal/blob/main/Backend/pdfGenModule/routes/allPdfAndHtmlRoutes.js"
    click HTML "https://github.com/virajmandlik/reportease-portal/tree/main/Backend/public/html_reports/"
    click PDFs "https://github.com/virajmandlik/reportease-portal/tree/main/Backend/public/pdfs/"
    click Creds "https://github.com/virajmandlik/reportease-portal/tree/main/Backend/public/report_credentials/"

    %% Styles
    classDef frontend fill:#f0c,stroke:#333,stroke-width:2px
    classDef backend fill:#8cf,stroke:#333,stroke-width:2px
    classDef data fill:#cfc,stroke:#333,stroke-width:2px
    classDef storage fill:#fc9,stroke:#333,stroke-width:2px
    classDef external fill:#f99,stroke:#333,stroke-width:2px
```
