Custom PHP CMS-style sandbox built around records, contacts, users, and a small admin area. The app uses Composer for PHP dependencies, Twig for templating, MySQL/MariaDB for storage, and a Gulp pipeline for frontend assets.
This repository is currently a hybrid codebase:
- The main entrypoint is
public/index.php. - Core services and controllers live under
src/. - Some pages are routed through
src/Routes/web.php. - Many user/contact/record flows still exist as direct legacy scripts under
public/.
- Record listing/search and record CRUD pages
- Contact management pages
- User login and profile/admin-related pages
- Admin dashboard/settings flow
- Twig-based page rendering alongside PHP view templates
- Sass, JS bundling, BrowserSync, and image optimization via Gulp
- PHP 8.1
- MariaDB/MySQL
- Twig 3
- Dotenv
- Bootstrap 4.6
- jQuery 3.7
- Gulp
- DDEV for local development
The practical local setup for this repo is DDEV. The checked-in DDEV config uses:
- PHP 8.1
- MariaDB 10.11
public/as the docroot- project URL
https://web-fun.ddev.site
- DDEV
- Docker/OrbStack
- Node.js/npm
- Composer
- Install PHP dependencies:
composer install- Install frontend dependencies:
npm install- Start DDEV:
ddev start- Import the sample database dump if you need local data:
ddev import-db --src=db.sql- Open the site:
ddev launchOr visit https://web-fun.ddev.site.
The app reads configuration from a root .env file via vlucas/phpdotenv.
At minimum, the code expects these keys:
DB_SERVERDB_USERDB_PASSDB_NAMESITE_OWNERSITE_AUTHORSITE_NAMESITE_TAGLINESITE_DESCRIPTION
Optional but used by some flows:
APP_ENVPOSTMARK_API_TOKENMAIL_FROM_ADDRESS
The asset pipeline is driven by gulpfile.js.
Useful commands:
npx gulpRuns the default task: cleans generated CSS, rebuilds styles/scripts, and starts BrowserSync against https://web-fun.ddev.site/.
npx gulp styleBuilds Sass into public/assets/css.
npx gulp scriptsLints and rebuilds frontend JS bundles.
npx gulp imageminifyOptimizes images in public/assets/images.
This project does not use framework migrations or php artisan.
- The checked-in schema/data snapshot is
db.sql. - To export the current DDEV database:
ddev exec mysqldump -u root -proot db > db.sqlconfig/ bootstrap and app wiring
public/ webroot and legacy PHP endpoints
src/Controllers controllers
src/Core router, helpers, validation, database classes
src/Models domain models
src/Routes route definitions
src/Services business logic/services
src/Views PHP and Twig views/templates
public/assets/ Sass, JS, generated CSS, images
This is not a full framework app and the routing migration is not complete yet.
public/index.phpbootstraps the app and hands requests to the custom router.- Only a subset of routes are currently defined in
src/Routes/web.php. - Several features still rely on direct script endpoints such as
public/users/login.phpandpublic/contacts/index.php.
That means local development and debugging should assume a mixed routed/legacy application, not a finished centralized MVC/router setup.