BaseA lightweight PHP MVC framework built from scratch with OOP principles — routing, queues, scheduling, Redis, and a clean template engine, all under one roof.
// architecture
Every layer is isolated into a focused module. Here's what lives under the hood.
Routing
Compiles named routes with dynamic segments into optimised regex patterns. Dispatches HTTP requests to the right controller action.
Database & Query Builder
Fluent query builder with joins, aggregates, and where clauses. Wraps PDO with transaction management and SQL validation.
Queue System
Async job processing via Database, Redis, or Sync drivers. Supports unique job guards to prevent duplicate execution.
Task Scheduler
Cron-style task scheduling with a fluent PHP API. Register recurring tasks and let the Scheduler evaluate what's due on every tick.
View Engine
Section-based PHP template engine with layout inheritance. Compose pages from named sections injected into shared layouts.
Security
Built-in CSRF token generation and validation on every state-changing request. Encryption helpers protect sensitive data end-to-end.
Redis Integration
Clean Redis connection layer with a configurable driver. Powers the Queue system and any custom caching needs.
Config & Environment
.env-based environment loading with per-domain config files (app, database, queue). Backup env support included.
File & Asset Helpers
FileReader/FileWriter abstractions for I/O. AssetManager serves versioned static URLs. Logger writes structured entries to Storage/Logs.
// highlights
Everything you need to build a modern PHP application, nothing you don't.
Named Routes
Compile dynamic URL patterns at boot and generate URLs from route names anywhere in the app.
MVC Pattern
Controllers, Models, and Views with clean separation enforced by the directory structure.
Query Builder
Chain where, join, and aggregate clauses — validated SQL, never raw string concatenation.
Job Queues
Push work off the request cycle to Database, Redis, or in-process Sync drivers.
Task Scheduling
Define recurring cron jobs in PHP with a readable fluent API, no crontab editing needed.
CSRF Protection
Auto-generated tokens validated on every POST/PUT/DELETE request out of the box.
Encryption
Symmetric encryption for sensitive data with the Encrypter utility.
Redis Driver
First-class Redis connection for queue back-end or custom caching use cases.
Template Sections
Layout inheritance via named sections — styles, content, footer, scripts — in plain PHP.
Asset Pipeline
Versioned static asset URLs via AssetManager; Tailwind CSS compiled output included.
Structured Logging
Timestamped log entries written to Storage/Logs for debugging and monitoring.
Route Middleware
Attach middleware groups per route or per route group from a central registration file.
// file structure
A predictable directory convention so you always know where everything lives.
Ready to get started?
Clone the repo or browse the source code on GitHub.