# aniketdey06/jis_rnd_website architecture

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

- Interactive diagram: https://gitdiagram.com/aniketdey06/jis_rnd_website
- Repository: https://github.com/aniketdey06/jis_rnd_website

## Overview

##### Project Type & Purpose
- This is a full-stack web application built for managing research grant applications and project progress tracking.
- Its main user groups are faculty (applying and submitting progress reports) and RFMO administrators (managing and approving applications, monitoring project status).
- The technology stack comprises front-end (HTML, CSS, JavaScript), back-end (PHP), and a MySQL database. Additionally, external libraries such as PHPMailer are used for email functionalities.

##### File Structure
- Top-Level Folders:
- “admin”: Contains PHP files for various administrative tasks such as dashboards, approving applications, updating status, and reporting.
- “assets”: Holds CSS files, JavaScript files (e.g., a register.js), and images – all part of the front-end static assets.
- “config”: Contains configuration files (e.g., database.php) for connecting to MySQL.
- “forms”: Provides PDF-based progress reports and submission forms, and handles file uploads.
- “includes”: Shared code fragments (e.g., headers, footers, common functions) used throughout the site.
- “template”: Contains page templates for different user interfaces (faculty dashboards, login, registration, password recovery, etc.).
- “utils”: Contains authentication controllers, email handling, data deletion, and other utility scripts which encapsulate common business logic.
- Other files like SQL scripts (rnd_website.sql, posts.sql, project_allocation.sql) are used to set up and maintain the database schema.

##### Key Architectural Components
a. Frontend Components:
- User Interface:
- Faculty templates (from the “template” folder) and associated assets under “assets”.
- Separate views/pages for faculty and administrators.
- Client-Side Interactions:
- HTML, CSS, and JavaScript files provide the responsive interface.
b. Backend Components:
- PHP-based business logic split into:
- “admin” directory for administrative functionalities.
- “utils” for authentication, email handling (PHPMailer integration), and status updates.
- “includes” for reusable code (headers, footers, common functions).
- “forms” to handle file uploads and submissions.
- Server configuration managed via files in “config” (e.g., database.php).
c. Database:
- A MySQL database is used (with schema provided through SQL files like rnd_website.sql).
- Data flows include user information, grant applications, progress reports, and project status.
d. External Integration:
- PHPMailer for email notifications (located in the phpMailer folder).

##### Relationships and Data Flow
- Faculty and Administrators interact with the system via the browser.
- The front-end communicates with the backend PHP scripts, which in turn interact with the MySQL database.
- Utility scripts (in “utils”) handle authentication, password management, file uploads, and email notifications.
- The “admin” section has dedicated endpoints for managing application approval, dashboard summaries, and report displays.
- File uploads (from the “forms/uploads” directories) are managed and later referenced in the database or displayed via templates.

##### Architectural Patterns & Design Principles
- Separation of Concerns: Distinct folders segregate front-end (assets, templates) and back-end logic (admin, utils, includes).
- Modular Design: Utility functions (e.g., auth.php, functions.php) provide reusable services.
- MVC-like Separation: Although not a full MVC framework, the project distinguishes between view templates, processing logic, and data handling.
- Robust Security: Authentication and authorization appear to be handled via separate admin and faculty modules.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Layer
    subgraph "User Layer"
        F1("Faculty"):::user
        A1("Admin"):::user
        Browser("Web Browser"):::user
    end

    %% Frontend Layer
    subgraph "Frontend Layer"
        Templates("UI Templates"):::frontend
        Assets("Static Assets"):::frontend
    end

    %% Application Layer
    subgraph "Application Layer"
        AdminFunc("Admin Functionality"):::backend
        Shared("Shared Code"):::backend
        Forms("Forms Handling"):::backend
        Utils("Utility Scripts"):::backend
    end

    %% Configuration / Data Layer
    subgraph "Configuration / Data Layer"
        Config("Configuration"):::database
        Database("MySQL Database"):::database
        SQL("SQL Schema"):::database
    end

    %% External Integration
    subgraph "External Integration"
        PHPMailer("PHPMailer Integration"):::external
    end

    %% Connections - User Layer to Frontend Layer
    F1 --> Browser
    A1 --> Browser
    Browser -->|"accesses"| Templates
    Browser -->|"loads"| Assets

    %% Connections - Frontend Layer to Application Layer
    Templates -->|"renders"| AdminFunc
    Templates -->|"renders"| Shared
    Templates -->|"submits"| Forms
    Templates -->|"triggers"| Utils
    Assets -->|"supports"| Templates

    %% Connections - Application Layer to Configuration / Data Layer
    AdminFunc -->|"queries"| Config
    Shared -->|"queries"| Config
    Forms -->|"uploads to"| Config
    Utils -->|"authenticates via"| Config

    Config -->|"connects to"| Database
    SQL -->|"initializes"| Database

    %% External Integration Connection
    Utils -->|"sends emails via"| PHPMailer

    %% Styles
    classDef user fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef frontend fill:#A9DFBF,stroke:#145A32,stroke-width:2px;
    classDef backend fill:#F9E79F,stroke:#7D6608,stroke-width:2px;
    classDef database fill:#F5B7B1,stroke:#922B21,stroke-width:2px;
    classDef external fill:#D7BDE2,stroke:#6C3483,stroke-width:2px;

    %% Click Events
    click Templates "https://github.com/aniketdey06/jis_rnd_website/tree/main/template/"
    click Assets "https://github.com/aniketdey06/jis_rnd_website/tree/main/assets/"
    click AdminFunc "https://github.com/aniketdey06/jis_rnd_website/tree/main/admin/"
    click Shared "https://github.com/aniketdey06/jis_rnd_website/tree/main/includes/"
    click Forms "https://github.com/aniketdey06/jis_rnd_website/tree/main/forms/"
    click Utils "https://github.com/aniketdey06/jis_rnd_website/tree/main/utils/"
    click Config "https://github.com/aniketdey06/jis_rnd_website/blob/main/config/database.php"
    click PHPMailer "https://github.com/aniketdey06/jis_rnd_website/tree/main/phpMailer/"
    click SQL "https://github.com/aniketdey06/jis_rnd_website/blob/main/rnd_website.sql"
```
