# jwaitze/jake-personal-website architecture

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

- Interactive diagram: https://gitdiagram.com/jwaitze/jake-personal-website
- Repository: https://github.com/jwaitze/jake-personal-website

## Overview

##### Project type and purpose
- Type: Monolithic PHP-based personal website
- Purpose: Presents static and dynamic content (home page, blog with full CRUD, chat, resume, privacy policy), plus integrates CAPTCHA (Securimage) and an IRC chat (unrealircd).

##### File structure
- Top-level entry points:
– index.php (likely homepage redirect)
– folders for each section: blog/, chat/, home/, login/, privacy-policy/, resume/
- Shared code:
– inc/ contains helper modules (database.php, blog.php, chat.php, functions.php, process_submits.php, etc.), header/footer templates
– _config.php holds DB credentials, _structure.sql defines schema
- Static assets:
– css/, js/, img/
- Third-party modules:
– securimage/ provides CAPTCHA service
– uconn-chat/ likely client or embed for IRC
- Build/deploy:
– robots.txt, sitemap.xml, pgp.txt

##### README for insights
- Stack: LAMP (Linux, Apache, MySQLi, PHP), HTML5, CSS3, JS
- Features: Blog CRUD, chat via IRC, contact & resume pages
- Setup: DB and user, configure _config.php, import schema, generate password

##### Main components & interactions
a. User’s Web Browser
– Sends HTTP(S) requests, loads HTML/CSS/JS, interacts via forms/JS
b. Web Server (Apache or equivalent)
– Serves static assets directly (css/, js/, img/)
– Routes requests for .php endpoints to the PHP interpreter
c. PHP Application
– Front controller pattern: each folder’s index.php loads inc/includes.php, renders header/footer, calls section logic (inc/blogpost.php, inc/chat.php, etc.)
– inc/process_submits.php handles form submissions (login, blog create/update/delete, chat posts)
– securimage/ module hooked into forms for CAPTCHA generation & validation
d. MySQL Database
– Stores user accounts, blog posts, comments (if any), chat logs (if stored), site defaults, etc.
e. IRC Server (unrealircd)
– External service; uconn-chat client connects to it for real-time chat
f. External Integrations (optional)
– Social links, analytics (statcounter.js), robots.txt for search engines

##### Architectural patterns & design principles
- Monolith with module-based organization: inc/ holds reusable code, each feature in its own folder
- Separation of concerns: templates (header/footer), business logic (inc/*.php), data access (database.php)
- Client-server: JS enhances UX (AreYouSureYouWantToLeave.js, CanvasRenderer.js) but all data operations go through PHP back end
- Security: CAPTCHA via securimage/, login checks via inc/check_login.php

##### Detailed call-outs
- Inc/includes.php as the common bootstrap for all pages
- Static vs. dynamic content paths
- Where configuration (_config.php) and schema (_structure.sql) fit

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        Browser["Web Browser"]:::client
        CSS["CSS (css/)"]:::server
        JS["JavaScript (js/)"]:::server
        IMG["Images (img/)"]:::server
    end

    %% Application Layer
    subgraph "Application Layer"
        ApachePHP["Apache + PHP"]:::server
        incIncludes["inc/includes.php"]:::server
        Header["inc/header.php"]:::server
        Footer["inc/footer.php"]:::server
        ProcessSubs["inc/process_submits.php"]:::server
        Functions["inc/functions.php"]:::server
        Defaults["inc/defaults.php"]:::server
        DatabaseAccess["inc/database.php"]:::server

        %% Modules
        HomeMod["Home Module\n(home/index.php)"]:::server
        BlogMod["Blog Module\n(blog/index.php)"]:::server
        BlogPostMod["Post View\n(blogpost/index.php)"]:::server
        BlogLogic["Business Logic\ninc/blog.php, inc/blogpost.php, inc/blogedit.php"]:::server
        ChatMod["Chat Module\n(chat/index.php)"]:::server
        ChatLogic["inc/chat.php, inc/uconn-chat.php"]:::server
        UConnClient["uconn-chat Client\n(uconn-chat/)"]:::server
        AuthMod["Auth Module\n(login/index.php)"]:::server
        AuthLogic["inc/login.php, inc/check_login.php, inc/logged_in.php"]:::server
        PrivacyMod["Privacy Policy\n(privacy-policy/index.php)"]:::server
        PrivacyLogic["inc/privacy-policy.php"]:::server
        ResumeMod["Resume Page\n(resume/index.html)"]:::server
        ResumeCSS["resume/css/main.css"]:::server
        CaptchaLogic["Securimage CAPTCHA\n(securimage/)"]:::server
    end

    %% Data Layer
    subgraph "Data Layer"
        MySQLDB["MySQL Database\n(_config.php, _structure.sql)"]:::datastore
        SQLiteDB["Securimage SQLite\n(securimage/database/securimage.sq3)"]:::datastore
    end

    %% External Services
    subgraph "External Services"
        IRC["UnrealIRCd IRC Server"]:::external
    end

    %% Metadata
    Robots["robots.txt, sitemap.xml, pgp.txt"]:::server

    %% Connections
    Browser -->|HTTP GET/POST| ApachePHP
    Browser --> CSS
    Browser --> JS
    Browser --> IMG
    ApachePHP --> incIncludes
    incIncludes --> Header
    incIncludes --> Footer
    incIncludes --> ProcessSubs
    incIncludes --> Functions
    incIncludes --> Defaults
    incIncludes --> DatabaseAccess

    incIncludes --> HomeMod
    incIncludes --> BlogMod
    incIncludes --> BlogPostMod
    incIncludes --> ChatMod
    incIncludes --> AuthMod
    incIncludes --> PrivacyMod
    incIncludes --> ResumeMod

    HomeMod --> DatabaseAccess
    BlogMod --> DatabaseAccess
    BlogPostMod --> DatabaseAccess
    BlogLogic --> DatabaseAccess
    ChatMod --> ChatLogic
    ChatLogic --> DatabaseAccess
    ChatLogic --> UConnClient
    AuthMod --> AuthLogic
    AuthLogic --> DatabaseAccess
    PrivacyMod --> PrivacyLogic
    PrivacyLogic --> DatabaseAccess
    ResumeMod --> ResumeCSS

    ApachePHP --> CaptchaLogic
    CaptchaLogic --> SQLiteDB

    ChatLogic -->|IRC protocol| IRC

    ApachePHP --> Robots

    DatabaseAccess --> MySQLDB

    %% Click Events
    click index.php "https://github.com/jwaitze/jake-personal-website/blob/master/index.php"
    click incIncludes "https://github.com/jwaitze/jake-personal-website/blob/master/inc/includes.php"
    click Header "https://github.com/jwaitze/jake-personal-website/blob/master/inc/header.php"
    click Footer "https://github.com/jwaitze/jake-personal-website/blob/master/inc/footer.php"
    click ProcessSubs "https://github.com/jwaitze/jake-personal-website/blob/master/inc/process_submits.php"
    click Functions "https://github.com/jwaitze/jake-personal-website/blob/master/inc/functions.php"
    click Defaults "https://github.com/jwaitze/jake-personal-website/blob/master/inc/defaults.php"
    click DatabaseAccess "https://github.com/jwaitze/jake-personal-website/blob/master/inc/database.php"
    click HomeMod "https://github.com/jwaitze/jake-personal-website/blob/master/home/index.php"
    click inc/home.php "https://github.com/jwaitze/jake-personal-website/blob/master/inc/home.php"
    click BlogMod "https://github.com/jwaitze/jake-personal-website/blob/master/blog/index.php"
    click BlogPostMod "https://github.com/jwaitze/jake-personal-website/blob/master/blogpost/index.php"
    click BlogLogic "https://github.com/jwaitze/jake-personal-website/blob/master/inc/blog.php"
    click BlogLogic "https://github.com/jwaitze/jake-personal-website/blob/master/inc/blogpost.php"
    click BlogLogic "https://github.com/jwaitze/jake-personal-website/blob/master/inc/blogedit.php"
    click ChatMod "https://github.com/jwaitze/jake-personal-website/blob/master/chat/index.php"
    click ChatLogic "https://github.com/jwaitze/jake-personal-website/blob/master/inc/chat.php"
    click ChatLogic "https://github.com/jwaitze/jake-personal-website/blob/master/inc/uconn-chat.php"
    click UConnClient "https://github.com/jwaitze/jake-personal-website/tree/master/uconn-chat/full-page/"
    click UConnClient "https://github.com/jwaitze/jake-personal-website/blob/master/uconn-chat/index.php"
    click AuthMod "https://github.com/jwaitze/jake-personal-website/blob/master/login/index.php"
    click AuthLogic "https://github.com/jwaitze/jake-personal-website/blob/master/inc/login.php"
    click AuthLogic "https://github.com/jwaitze/jake-personal-website/blob/master/inc/check_login.php"
    click AuthLogic "https://github.com/jwaitze/jake-personal-website/blob/master/inc/logged_in.php"
    click PrivacyMod "https://github.com/jwaitze/jake-personal-website/blob/master/privacy-policy/index.php"
    click PrivacyLogic "https://github.com/jwaitze/jake-personal-website/blob/master/inc/privacy-policy.php"
    click ResumeMod "https://github.com/jwaitze/jake-personal-website/blob/master/resume/index.html"
    click ResumeCSS "https://github.com/jwaitze/jake-personal-website/blob/master/resume/css/main.css"
    click CaptchaLogic "https://github.com/jwaitze/jake-personal-website/blob/master/securimage/securimage.php"
    click CaptchaLogic "https://github.com/jwaitze/jake-personal-website/blob/master/securimage/config.inc.php.SAMPLE"
    click SQLiteDB "https://github.com/jwaitze/jake-personal-website/blob/master/securimage/database/securimage.sq3"
    click Robots "https://github.com/jwaitze/jake-personal-website/blob/master/robots.txt"
    click MySQLDB "https://github.com/jwaitze/jake-personal-website/blob/master/_config.php"
    click MySQLDB "https://github.com/jwaitze/jake-personal-website/blob/master/_structure.sql"
    click CSS "https://github.com/jwaitze/jake-personal-website/blob/master/css/main.css"
    click JS "https://github.com/jwaitze/jake-personal-website/tree/master/js/"
    click IMG "https://github.com/jwaitze/jake-personal-website/tree/master/img/"

    %% Styles
    classDef client fill:#D0E6FF,stroke:#3399FF,stroke-width:2px
    classDef server fill:#E8F5E9,stroke:#2E7D32,stroke-width:2px
    classDef datastore fill:#FFF3E0,stroke:#EF6C00,stroke-width:2px
    classDef external fill:#ECEFF1,stroke:#607D8B,stroke-width:2px
```
