How drawleados-dotcom/drawleadweb works
Purpose and runtime
This is a PHP website/CMS for Drawlead: public marketing, service/industry/platform pages, blogs and case studies, plus interactive booking, WhatsApp, SEO analysis, and popup features. It is designed for an Apache-style PHP deployment, indicated by .htaccess, PHP entry files, and deployment workflow. Persistent content and feature state are database-backed through SQL schema/migrations.
Key runtime roots: index.php, includes/bootstrap.php, .htaccess.
Public site composition and routing
index.php is the public entry point and likely resolves requested pages/content before assembling shared layout and page-specific bodies. Templates separate reusable page chrome from content types, enabling database-managed pages alongside dedicated templates.
Architecture boundary: request/bootstrap → page/content selection → layout partials → rendered HTML.
Key paths: index.php, templates/layout-start.php, templates/layout-end.php.
Template and content model
The public presentation layer has explicit templates for homepage variants, blog lists/posts, case studies, booking, service solutions, industries, and platform modules. Shared navigation, footer, sidebar, popup, booking modal, and WhatsApp widget are independently composable partials.
This supports a hybrid content model: fixed template types populated by CMS/database records, rather than a single static-site build.
Key paths: templates/home-body.php, templates/blog-post-body.php, templates/partials/nav.php.
Administration CMS
The /admin application is the control plane for authentication, users, pages, blogs, case studies, calendar/booking configuration, WhatsApp flows, popups, analytics, and deployments. Edit/delete endpoints imply server-rendered CRUD workflows backed by the shared database and admin-specific assets.
The admin boundary should enforce authentication/session handling before accessing content or operational actions.
Key paths: admin/index.php, admin/login.php, admin/page-edit.php.
Interactive lead-capture APIs
Public JavaScript calls PHP API endpoints for booking availability/slots/submission and WhatsApp flow/submission. Browser widgets are decoupled from server endpoints, allowing the public templates to embed lead-capture experiences without exposing administration interfaces.
Primary flow: public widget → assets/*.js → /api endpoint → database and likely outbound notification/email.
Key paths: api/booking-submit.php, api/whatsapp-flow.php, assets/booking.js.
Shared application services
includes/bootstrap.php is the likely shared initialization boundary for configuration, database connectivity, sessions, and common helpers. The application also contains a mailer integration and an analysis feature with dedicated templates and admin support, making these cross-cutting services rather than isolated pages.
Key paths: includes/bootstrap.php, includes/mailer.php, includes/analyze.php.
Database evolution and operational state
The SQL schema establishes the baseline data model; ordered migrations add booking, WhatsApp bots, case studies/services, SEO fields, popups/triggers, service/platform/industry pages, page status/menu behavior, and analysis features. admin/run-migrations.php provides an in-application migration operation, so production migration access is an important operational/security boundary.
Key paths: sql/schema.sql, sql/migrations/003_booking_system.sql, admin/run-migrations.php.
Deployment and infrastructure
Deployment is automated through GitHub Actions, with repository deployment instructions available separately. Apache configuration is repository-managed via root and upload-directory .htaccess files; uploads are persistent application data and need writable storage plus access-control review.
Key paths: .github/workflows/deploy.yml, DEPLOYMENT.md, uploads/.htaccess.
Main entry points: schema.sql CMS database · admin/index.php Admin control plane · index.php Public entry · layout-start.php Layout start
Components 22
Public Website
- Public entry
index.php - Page & content selection · Resolves database-managed content and its template type.
- Layout start
templates/layout-start.php - Content templates · Homepage, blog, case study, booking, service, industry, and platform bodies.
templates/home-body.php - Layout end
templates/layout-end.php - Navigation partial
templates/partials/nav.php - Booking widget · Embedded public lead-capture interaction.
assets/booking.js - Booking submission API
api/booking-submit.php - WhatsApp flow API
api/whatsapp-flow.php
Admin CMS
- Admin authentication · Establishes the authenticated admin session boundary.
admin/login.php - Admin control plane · Manages content, users, lead features, analytics, and deployments.
admin/index.php - Page editor
admin/page-edit.php
Shared Services & Data
- Application bootstrap · Initializes configuration, database access, sessions, and common helpers.
includes/bootstrap.php - CMS database · Stores content, users, feature state, bookings, and lead-flow data.
sql/schema.sql - Mailer integration
includes/mailer.php - SEO analysis service
includes/analyze.php
Operations
- Apache routing · Routes PHP requests and enforces repository-managed access rules.
.htaccess - Migration operation · Applies ordered database changes from the application.
admin/run-migrations.php - Booking schema migration
sql/migrations/003_booking_system.sql - Persistent uploads · Application-uploaded data with dedicated access rules.
uploads/.htaccess - Deployment workflow
.github/workflows/deploy.yml - Deployment instructions
DEPLOYMENT.md
Connections 22
- Apache routing → Public entry: routes public requests
- Public entry → Application bootstrap: initializes
- Public entry → Page & content selection: selects page
- Page & content selection → CMS database: reads CMS content
- Page & content selection → Layout start: assembles
- Layout start → Navigation partial: includes
- Layout start → Content templates: wraps
- Content templates → Layout end: completes layout
- Booking widget → Booking submission API: submits lead data
- Booking submission API → CMS database: stores booking
- Booking submission API → Mailer integration: sends notification
- WhatsApp flow API → CMS database: reads and stores flow state
- Admin authentication → Admin control plane: authorizes access
- Admin control plane → Application bootstrap: uses shared initialization
- Admin control plane → Page editor: opens CRUD workflow
- Page editor → CMS database: updates content
- Admin control plane → SEO analysis service: manages analysis
- SEO analysis service → CMS database: persists results
- Migration operation → CMS database: applies changes
- Booking schema migration → Migration operation: migration input
- Deployment workflow → Apache routing: deploys application
- Deployment instructions → Deployment workflow: documents