3.1 KiB
3.1 KiB
AGENTS
Stack And Entry Points
- This repo is a plain PHP app for Strato-style hosting. There is no Node, Composer, container, or build step.
- Live web root is
httpdocs/. - Main app entrypoint:
httpdocs/index.php. - First-time setup entrypoint:
httpdocs/install.php. - App wiring and request handling live in
httpdocs/app/bootstrap.php. - All HTML/UI rendering lives in
httpdocs/app/views.php.
Deployment Reality
- Changes in this repo do nothing until the contents of
httpdocs/are uploaded to the server. - If the user says “nothing changed”, verify whether the live site is serving the current workspace contents before changing logic again.
- The live site can be checked directly at
http://arbeitsstunden.tc-ingelfingen.de.
Runtime Behavior
- The app supports two modes:
- With DB: MySQL/MariaDB via
DB_HOST,DB_NAME,DB_USER,DB_PASS. - Without DB: demo mode with in-code users from
findUserByEmail()and in-code member/hour data fromfetchUsers()/fetchLogs().
- With DB: MySQL/MariaDB via
index.phpredirects toinstall.phponly when a DB connection exists and no users are installed.install.phponly works with a DB connection; without DB it only shows an error.
Roles And UI Rules
- Roles are
member,editor,admin. membershould only see their own hours on the dashboard.editorandadminshould see their own hours plus all members in the dashboard table.- Admin-only menu item is
Vereinskonfiguration. - Header should keep club name on the left and current user + logout on the right.
- Navigation is implemented as a left sidebar inside
renderAppShell().
Persistence Gotchas
- Club settings are persisted in DB table
settingsand read into$configinbootstrap.php. - If settings appear not to save, check DB mode first. In demo mode there is no DB persistence.
- Schema is created in
initSchema()at runtime. Keepschema.sqlaligned with runtime-created tables. schema.sqlcurrently contains seed password hashes that may drift from runtime-generated demo passwords; trust runtime behavior inbootstrap.phpover static SQL prose.
Session And Auth Gotchas
- Session handling is configured manually in
bootstrap.phpwithsession_set_cookie_params()beforesession_start(). - Login redirects to
/?page=dashboardafter setting$_SESSION['user']. - If auth appears broken, inspect
currentUser()and the session flow inbootstrap.phpbefore changing UI conditionals.
Editing Guidance
- Most app behavior changes require editing
httpdocs/app/views.phpand sometimeshttpdocs/app/bootstrap.phptogether. - Prefer minimal inline changes over adding new abstractions; the app is intentionally small and file-local.
- When changing page layout, update only
renderAppShell()unless the login or install flow is involved.
Verification
- There is no automated test suite in the repo.
- Best available verification is:
- read the affected PHP files,
- check role-gated branches in
views.phpand action handling inbootstrap.php, - optionally fetch the live URL to compare deployed output versus workspace output.