# usc-mike/dcism-intership-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/usc-mike/dcism-intership-tracker
- Repository: https://github.com/usc-mike/dcism-intership-tracker

## Overview

##### Project’s Main Components
- Frontend User Interface:
– Found in the public/ directory (which contains pages for login, registration, and distinct subdirectories for coordinator and student functionalities).
- Backend Server Components:
– PHP controllers and configuration files (src/controllers and src/config) handle authentication, coordinator actions, and student actions.
– PHP scripts located in public (e.g., index.php, login.php) serve as entry points to the application.
- Database:
– The MySQL configuration is indicated in src/config/db.php, and this represents the persistence layer.
- Build/Development Tooling:
– Node-related files (package.json, server.js, postcss.config.js, tailwind.config.js, etc.) work together as part of the frontend build pipeline to compile Tailwind CSS and manage dependencies.
- Additional Resources:
– Report templates (in report_templates folder) and file uploads (in uploads folder) suggest document management features that support the internship tracking process.

##### Relationships and Interactions
- The Frontend (public/ folder) interfaces with the backend PHP controllers. Different URLs (e.g., /coordinator/* and /student/*) indicate role-based access.
- The PHP backend communicates with the MySQL database (via src/config/db.php); this is where data relating to users, reports, checklists, and evaluations are stored.
- Static assets (images, CSS) and document resources (templates, uploads) are served directly or referenced in the UI.
- The Node.js tooling supports the frontend build process (e.g., compiling and processing Tailwind CSS files), but it is not directly part of the runtime architecture of the application.

##### Important Architectural Patterns and Technologies
- The system is structured following a separation-of-concerns approach, splitting responsibilities between presentation (frontend) and business logic (backend).
- There is an implicit MVC-like pattern for the backend with controllers in src/controllers managing requests and business logic.
- Key technologies are HTML, Tailwind CSS, PHP, and MySQL. Node.js is in the mix as a build-time tool rather than a runtime service.
- The document management functionality (using folders for templates and uploads) is an important subsystem for handling internship report materials.

– “Frontend UI” with sub-labels for “Coordinator Portal” and “Student Portal.”
– “Backend Server (PHP)” containing components for authentication, coordinator actions, and student actions.
– “Database (MySQL)” to show where internship data, checklists, evaluation reports, and user information are stored.
– “Build & Asset Pipeline (Node.js)” to denote the process managing Tailwind CSS and frontend dependencies.
– From the “Frontend UI” to the “Backend Server” to indicate HTTP requests and responses.
– From the “Backend Server” to the “Database” to represent CRUD operations.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Frontend Layer
    subgraph "Frontend UI"
        CP("Coordinator Portal"):::frontend
        SP("Student Portal"):::frontend
        SA("Static Assets"):::assets
    end

    %% Backend Layer
    subgraph "Backend Server (PHP)"
        subgraph "Entry Point Scripts"
            EP1("index.php"):::backend
            EP2("login.php"):::backend
            EP3("register.php"):::backend
        end
        PC("PHP Controllers"):::backend
        DBConf("DB Configuration"):::backend
    end

    %% Database Layer
    subgraph "Database (MySQL)"
        MySQL("MySQL Database"):::database
    end

    %% Build / Asset Pipeline
    subgraph "Build & Asset Pipeline (Node.js)"
        B1("package.json"):::build
        B2("server.js"):::build
        B3("postcss.config.js"):::build
        B4("tailwind.config.js"):::build
    end

    %% Document Management
    subgraph "Document Management"
        RT("Report Templates"):::doc
        FU("File Uploads"):::doc
    end

    %% Connections from Frontend to Backend Entry Points
    CP -->|"Access"| EP1
    SP -->|"Access"| EP1

    %% Entry Points routing to PHP Controllers
    EP1 -->|"RouteRequest"| PC
    EP2 -->|"RouteRequest"| PC
    EP3 -->|"RouteRequest"| PC

    %% PHP Controllers interaction with Database and Config
    PC -->|"Uses"| DBConf
    DBConf -->|"DBConnect"| MySQL
    PC -->|"CRUDOperations"| MySQL
    MySQL -->|"DataResponse"| PC

    %% Build Tools generate Static Assets
    B1 -->|"CompileAssets"| SA

    %% PHP Controllers manage Document Resources
    PC -->|"ManageReports"| RT
    PC -->|"HandleUploads"| FU

    %% Styling Classes
    classDef frontend fill:#b3d9ff,stroke:#1a66ff,stroke-width:2px;
    classDef assets fill:#cce6ff,stroke:#3399ff,stroke-width:2px;
    classDef backend fill:#ffcccc,stroke:#ff6666,stroke-width:2px;
    classDef database fill:#fff2cc,stroke:#ffcc00,stroke-width:2px;
    classDef build fill:#d9ead3,stroke:#6aa84f,stroke-width:2px;
    classDef doc fill:#f4cccc,stroke:#e06666,stroke-width:2px;

    %% Click Events for Frontend UI
    click CP "https://github.com/usc-mike/dcism-intership-tracker/tree/main/public/coordinator/"
    click SP "https://github.com/usc-mike/dcism-intership-tracker/tree/main/public/student/"
    click SA "https://github.com/usc-mike/dcism-intership-tracker/tree/main/public/assets/"

    %% Click Events for Backend Server
    click EP1 "https://github.com/usc-mike/dcism-intership-tracker/blob/main/public/index.php"
    click EP2 "https://github.com/usc-mike/dcism-intership-tracker/blob/main/public/login.php"
    click EP3 "https://github.com/usc-mike/dcism-intership-tracker/blob/main/public/register.php"
    click PC "https://github.com/usc-mike/dcism-intership-tracker/tree/main/src/controllers/"
    click DBConf "https://github.com/usc-mike/dcism-intership-tracker/blob/main/src/config/db.php"

    %% Click Events for Build/Development Tooling
    click B1 "https://github.com/usc-mike/dcism-intership-tracker/blob/main/package.json"
    click B2 "https://github.com/usc-mike/dcism-intership-tracker/blob/main/server.js"
    click B3 "https://github.com/usc-mike/dcism-intership-tracker/blob/main/postcss.config.js"
    click B4 "https://github.com/usc-mike/dcism-intership-tracker/blob/main/tailwind.config.js"

    %% Click Events for Document Management
    click RT "https://github.com/usc-mike/dcism-intership-tracker/tree/main/report_templates/"
    click FU "https://github.com/usc-mike/dcism-intership-tracker/tree/main/uploads/"
```
