# surya-3699/campuschronicle architecture

> Architecture diagram of the GitHub repository surya-3699/campuschronicle, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/surya-3699/campuschronicle
- Repository: https://github.com/surya-3699/campuschronicle

## Overview

Campus Chronicle is a PHP campus-events platform for students and administrators. Requests enter through the front controller, which dispatches authentication, event discovery and registration, gallery management, notifications, and account features; users then view event, media, and profile results. The map also includes the persistence layer and upload helper. The README is empty, so capabilities are inferred from the source index and excerpts; unsampled controller and view details are represented only where the index documents a relationship.

Main entry points: [`index.php`](https://github.com/surya-3699/campuschronicle/blob/main/index.php) (Request dispatcher), [`config/database.php`](https://github.com/surya-3699/campuschronicle/blob/main/config/database.php) (Database connection), [`app/Controllers/EventController.php`](https://github.com/surya-3699/campuschronicle/blob/main/app/Controllers/EventController.php) (Event workflows), [`app/Models/Registration.php`](https://github.com/surya-3699/campuschronicle/blob/main/app/Models/Registration.php) (Event registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["Request and UI"]
  node_front["Request dispatcher<br/>[index.php]"]
  node_homeview["Home and user views<br/>[home.php]"]
  node_adminview["Admin views"]
end

subgraph group_identity["Accounts and security"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_user["User accounts<br/>[User.php]"]
  node_social["Social identity"]
  node_twofactor["Two-factor security"]
end

subgraph group_events["Events and participation"]
  node_eventsctl["Event workflows"]
  node_eventmodel["Event catalog<br/>[Event.php]"]
  node_registration["Event registration<br/>[Registration.php]"]
  node_certificates["Certificates<br/>[Certificate.php]"]
end

subgraph group_media["Campus media"]
  node_galleryctl["Gallery management"]
  node_mediactl["Media management"]
  node_gallerymodel["Gallery albums<br/>[Gallery.php]"]
  node_mediamodel["Gallery assets<br/>[GalleryMedia.php]"]
  node_uploads["Validated uploads<br/>[FileUpload.php]"]
end

subgraph group_platform["Persistence and services"]
  node_notificationctl["Notification access"]
  node_notifications["Notification records<br/>[Notification.php]"]
  node_database["Database connection<br/>[database.php]"]
end

node_visitor(("Visitor"))
node_mysqldb[("MySQL or MariaDB")]

node_visitor -->|"sends request"| node_front
node_front -->|"dispatches auth"| node_auth
node_front -->|"dispatches events"| node_eventsctl
node_front -->|"dispatches notifications"| node_notificationctl
node_front -->|"renders pages"| node_homeview
node_front -.->|"renders admin"| node_adminview
node_auth -->|"authenticates users"| node_user
node_auth -->|"delegates identity"| node_social
node_front -.->|"dispatches security"| node_twofactor
node_eventsctl -->|"manages events"| node_eventmodel
node_eventsctl -->|"registers attendees"| node_registration
node_registration -->|"checks event"| node_eventmodel
node_registration -->|"issues certificate"| node_certificates
node_eventsctl -->|"broadcasts updates"| node_notifications
node_front -->|"dispatches galleries"| node_galleryctl
node_galleryctl -->|"manages albums"| node_gallerymodel
node_galleryctl -->|"loads album media"| node_mediamodel
node_front -->|"dispatches media"| node_mediactl
node_mediactl -->|"stores media"| node_mediamodel
node_mediactl -->|"refreshes counts"| node_gallerymodel
node_galleryctl -->|"uploads cover"| node_uploads
node_mediactl -->|"uploads assets"| node_uploads
node_front -->|"reads alerts"| node_notificationctl
node_notificationctl -->|"loads notifications"| node_notifications
node_gallerymodel -->|"publishes alerts"| node_notifications
node_database -->|"opens PDO connection"| node_mysqldb
node_eventmodel -->|"connects database"| node_database
node_user -->|"connects database"| node_database
node_registration -->|"connects database"| node_database
node_gallerymodel -->|"connects database"| node_database
node_mediamodel -->|"connects database"| node_database
node_notifications -->|"connects database"| node_database

click node_front "https://github.com/surya-3699/campuschronicle/blob/main/index.php"
click node_homeview "https://github.com/surya-3699/campuschronicle/blob/main/app/Views/home.php"
click node_adminview "https://github.com/surya-3699/campuschronicle/tree/main/app/Views/admin"
click node_auth "https://github.com/surya-3699/campuschronicle/blob/main/app/Controllers/AuthController.php"
click node_user "https://github.com/surya-3699/campuschronicle/blob/main/app/Models/User.php"
click node_social "https://github.com/surya-3699/campuschronicle/blob/main/app/Services/GoogleIdentityService.php"
click node_twofactor "https://github.com/surya-3699/campuschronicle/blob/main/app/Controllers/TwoFactorController.php"
click node_eventsctl "https://github.com/surya-3699/campuschronicle/blob/main/app/Controllers/EventController.php"
click node_eventmodel "https://github.com/surya-3699/campuschronicle/blob/main/app/Models/Event.php"
click node_registration "https://github.com/surya-3699/campuschronicle/blob/main/app/Models/Registration.php"
click node_certificates "https://github.com/surya-3699/campuschronicle/blob/main/app/Models/Certificate.php"
click node_galleryctl "https://github.com/surya-3699/campuschronicle/blob/main/app/Controllers/GalleryController.php"
click node_mediactl "https://github.com/surya-3699/campuschronicle/blob/main/app/Controllers/GalleryMediaController.php"
click node_gallerymodel "https://github.com/surya-3699/campuschronicle/blob/main/app/Models/Gallery.php"
click node_mediamodel "https://github.com/surya-3699/campuschronicle/blob/main/app/Models/GalleryMedia.php"
click node_uploads "https://github.com/surya-3699/campuschronicle/blob/main/app/helpers/FileUpload.php"
click node_notificationctl "https://github.com/surya-3699/campuschronicle/blob/main/app/Controllers/NotificationController.php"
click node_notifications "https://github.com/surya-3699/campuschronicle/blob/main/app/Models/Notification.php"
click node_database "https://github.com/surya-3699/campuschronicle/blob/main/config/database.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_front,node_homeview,node_adminview toneBlue
class node_auth,node_user,node_social,node_twofactor,node_mysqldb toneAmber
class node_eventsctl,node_eventmodel,node_registration,node_certificates toneMint
class node_galleryctl,node_mediactl,node_gallerymodel,node_mediamodel,node_uploads toneRose
class node_notificationctl,node_notifications,node_database,node_visitor toneIndigo
```

## Components

### Request and UI

- [Request dispatcher](https://github.com/surya-3699/campuschronicle/blob/main/index.php): `index.php`
- [Home and user views](https://github.com/surya-3699/campuschronicle/blob/main/app/Views/home.php): `app/Views/home.php`
- [Admin views](https://github.com/surya-3699/campuschronicle/tree/main/app/Views/admin): `app/Views/admin`

### Accounts and security

- [Authentication](https://github.com/surya-3699/campuschronicle/blob/main/app/Controllers/AuthController.php): `app/Controllers/AuthController.php`
- [User accounts](https://github.com/surya-3699/campuschronicle/blob/main/app/Models/User.php): `app/Models/User.php`
- [Social identity](https://github.com/surya-3699/campuschronicle/blob/main/app/Services/GoogleIdentityService.php): `app/Services/GoogleIdentityService.php`
- [Two-factor security](https://github.com/surya-3699/campuschronicle/blob/main/app/Controllers/TwoFactorController.php): `app/Controllers/TwoFactorController.php`

### Events and participation

- [Event workflows](https://github.com/surya-3699/campuschronicle/blob/main/app/Controllers/EventController.php): `app/Controllers/EventController.php`
- [Event catalog](https://github.com/surya-3699/campuschronicle/blob/main/app/Models/Event.php): `app/Models/Event.php`
- [Event registration](https://github.com/surya-3699/campuschronicle/blob/main/app/Models/Registration.php): `app/Models/Registration.php`
- [Certificates](https://github.com/surya-3699/campuschronicle/blob/main/app/Models/Certificate.php): `app/Models/Certificate.php`

### Campus media

- [Gallery management](https://github.com/surya-3699/campuschronicle/blob/main/app/Controllers/GalleryController.php): `app/Controllers/GalleryController.php`
- [Media management](https://github.com/surya-3699/campuschronicle/blob/main/app/Controllers/GalleryMediaController.php): `app/Controllers/GalleryMediaController.php`
- [Gallery albums](https://github.com/surya-3699/campuschronicle/blob/main/app/Models/Gallery.php): `app/Models/Gallery.php`
- [Gallery assets](https://github.com/surya-3699/campuschronicle/blob/main/app/Models/GalleryMedia.php): `app/Models/GalleryMedia.php`
- [Validated uploads](https://github.com/surya-3699/campuschronicle/blob/main/app/helpers/FileUpload.php): `app/helpers/FileUpload.php`

### Persistence and services

- [Notification access](https://github.com/surya-3699/campuschronicle/blob/main/app/Controllers/NotificationController.php): `app/Controllers/NotificationController.php`
- [Notification records](https://github.com/surya-3699/campuschronicle/blob/main/app/Models/Notification.php): `app/Models/Notification.php`
- [Database connection](https://github.com/surya-3699/campuschronicle/blob/main/config/database.php): `config/database.php`

### Other components

- **Visitor**
- **MySQL or MariaDB**

## Connections

- Visitor → Request dispatcher: sends request (evidence: `index.php`)
- Request dispatcher → Authentication: dispatches auth (evidence: `index.php`)
- Request dispatcher → Event workflows: dispatches events (evidence: `index.php`)
- Request dispatcher → Notification access: dispatches notifications (evidence: `index.php`)
- Request dispatcher → Home and user views: renders pages (evidence: `index.php`)
- Request dispatcher → Admin views: renders admin (evidence: `index.php`)
- Authentication → User accounts: authenticates users (evidence: `app/Controllers/AuthController.php`)
- Authentication → Social identity: delegates identity (evidence: `app/Controllers/AuthController.php`)
- Request dispatcher → Two-factor security: dispatches security
- Event workflows → Event catalog: manages events (evidence: `app/Controllers/EventController.php`)
- Event workflows → Event registration: registers attendees (evidence: `app/Controllers/EventController.php`)
- Event registration → Event catalog: checks event (evidence: `app/Models/Registration.php`)
- Event registration → Certificates: issues certificate (evidence: `app/Models/Registration.php`)
- Event workflows → Notification records: broadcasts updates (evidence: `app/Controllers/EventController.php`)
- Request dispatcher → Gallery management: dispatches galleries (evidence: `index.php`)
- Gallery management → Gallery albums: manages albums (evidence: `app/Controllers/GalleryController.php`)
- Gallery management → Gallery assets: loads album media (evidence: `app/Controllers/GalleryController.php`)
- Request dispatcher → Media management: dispatches media (evidence: `index.php`)
- Media management → Gallery assets: stores media (evidence: `app/Controllers/GalleryMediaController.php`)
- Media management → Gallery albums: refreshes counts (evidence: `app/Controllers/GalleryMediaController.php`)
- Gallery management → Validated uploads: uploads cover (evidence: `app/Controllers/GalleryController.php`)
- Media management → Validated uploads: uploads assets (evidence: `app/Controllers/GalleryMediaController.php`)
- Request dispatcher → Notification access: reads alerts (evidence: `index.php`)
- Notification access → Notification records: loads notifications (evidence: `app/Controllers/NotificationController.php`)
- Gallery albums → Notification records: publishes alerts (evidence: `app/Models/Gallery.php`)
- Database connection → MySQL or MariaDB: opens PDO connection (evidence: `config/database.php`)
- Event catalog → Database connection: connects database (evidence: `app/Models/Event.php`)
- User accounts → Database connection: connects database (evidence: `app/Models/User.php`)
- Event registration → Database connection: connects database (evidence: `app/Models/Registration.php`)
- Gallery albums → Database connection: connects database (evidence: `app/Models/Gallery.php`)
- Gallery assets → Database connection: connects database (evidence: `app/Models/GalleryMedia.php`)
- Notification records → Database connection: connects database (evidence: `app/Models/Notification.php`)
