-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
github-actions[bot] edited this page May 13, 2026
·
8 revisions
the site is a classic folder-routed PHP app with a shared shell and file-based storage.
usual pattern:
- bootstrap shared session handling via
lib/session.php - set
$titleand$description - locate the preferred template
- load route-local
content.html - inject dynamic placeholders
- echo final HTML
-
template.htmldefault desktop shell with sidebar, footer, placeholders, and global asset includes -
template_mobile.htmlalternate shell for mobile-friendly view -
lib/render.phpshared helpers for upward file lookup and mobile template selection -
lib/session.phpshared session bootstrap, persistent cookie config,mustResetPasswordenforcement, and admin-cookie refresh helper -
lib/feed.phpfeed-specific helpers for reply persistence, permission checks, datetime formatting, and inline image upload replacement -
main.jsshared client behavior layer -
style.cssglobal styling and component rules
mobile/desktop template choice is centralized in lib/render.php.
mobile mode is enabled when any of these are true:
- host is
m.fridg3.org - cookie
mobile_friendly_viewis truthy - logged-in account has
mobileFriendlyView: trueindata/accounts/accounts.json
if the mobile template is requested but missing, routes fall back to template.html.
- logged-in state lives in
$_SESSION['user'] - frontend admin awareness uses a non-HttpOnly
is_admincookie - backend authorization is still done in PHP, which is correct and non-cursed
common session fields:
usernamenameisAdminmustResetPasswordallowedPages
there is no database. the app reads and writes JSON, TXT, HTML, and media files under /data.
main stores:
data/accounts/accounts.jsondata/accounts/login_attempts.jsondata/feed/*.txtdata/feed/replies/*.jsondata/journal/*.txtdata/journal/drafts/*.txtdata/chat/*.jsondata/contact/*.jsondata/guestbook/*.txtdata/etc/*.json
- many routes still do literal string replacement on the footer account button to swap login/logout
-
main.jsassumes certain DOM ids exist across templates - bookmarks are stored in
accounts.json, but some old code paths still reference a legacy/data/userspattern - contact submissions are private runtime JSON under
data/contact/and must never be web-served directly - toast’s Discord bot is not just a stream bot anymore; it also maintains local DM history plus feed notification state under
data/etc/and receives contact notification requests from PHP over127.0.0.1:8765 - page views are updated from shared frontend flow, so nav changes can silently break view counts