
Koepel Mega Zip — Hardcoded App Skeleton (PHP)
------------------------------------------------
This is a starter app to rebuild the site without WordPress while integrating
with the existing WordPress database (users, WooCommerce orders) and Yoco payments.

Folders
- config/db.php                 PDO connection (edit credentials + table prefix)
- bridge/wp_bridge.php          Functions to read WordPress users and verify passwords
- bridge/woo_queries.php        Example SQL to read Woo orders/items from WP tables
- migrations/001_init.sql       Custom tables: kmz_roles, bookings, payments, time_slots, add_ons, audit_logs
- public/index.php              Landing page (replace with your HTML/sections)
- public/login.php              Login using WordPress credentials
- public/logout.php
- public/includes/auth.php      Session helpers: require_login, require_roles
- public/includes/functions.php Common helpers
- public/super-admin.php        Super Admin dashboard (metrics, links)
- public/office-admin.php       Office Admin dashboard (today's bookings)
- public/customer-dashboard.php Customer dashboard (my bookings + pay)
- public/bookings.php           Create/list bookings (basic)
- public/pay/start.php          Create Yoco Checkout and redirect user
- public/pay/return.php         Yoco return page
- public/webhooks/yoco.php      Yoco webhook receiver (store + mark paid)
- public/assets/css/style.css   Minimal styles

Quick Start
1) Copy this folder to your server, e.g. /home/kiepersol/koepelmegazip.app/
2) Configure config/db.php with the same DB credentials as WordPress.
3) Run migrations/001_init.sql once.
4) Put your Yoco secret in config/db.php (or server env as YOCO_SECRET_KEY).
5) Point a subdomain to /public (or add a vhost).

Roles
- We map roles in kmz_roles (super_admin, office_admin, customer).
  On first login, if no role mapping exists, default is 'customer'.
  Super Admin can promote/demote via SQL for now.

Yoco
- start.php creates a checkout and redirects.
- webhooks/yoco.php records the event and sets payments.status to 'paid' if completed.
  Configure your Yoco dashboard webhook URL to: https://YOURAPP/webhooks/yoco.php

Safety
- No secrets in Git. Keep keys in env or in config outside webroot.
- This is a minimal MVP — harden, validate, and style before production.

Generated: 2025-08-26T12:20:00.495431
