DEV Community

Chris Carpenter
Chris Carpenter

Posted on

I spent 4 years building a production PHP system. Then I turned the framework into a product.

The backstory

For the past 4 years, I've been the sole developer at a manufacturing facility. I built everything from scratch: a 2,188-file PHP enterprise application managing production tracking, quality control, scheduling, inventory, and shipping. 100+ daily users. 99.9% uptime since 2022.

No Laravel. No Symfony. Custom MVC architecture with OOP, SOLID principles, and design patterns throughout.

The realization

After building the same foundational components for the third time across different projects — authentication, permissions, database connections, API responses, caching, CSRF protection, input validation, logging — I realized these components were genuinely reusable.

So I extracted them.

What PhoenixPHP includes

Base Framework ($40)

  • Auth.php — Session-based authentication with bcrypt, mobile detection, session management
  • RBAC — Configurable permission groups with Auth::can('admin.write') pattern
  • Database.php — Multi-database MySQLi + PDO connection pooling with lazy initialization
  • API bootstrap — Standardized {"ok": true, "data": {...}} response format, CORS, auth enforcement
  • Cache.php — Multi-driver (Redis → APCu → File) with automatic fallback
  • CSRF.php — Token generation/validation with constant-time comparison
  • Validator.php — Fluent API with 15+ rules: Validator::make($data, ['email' => 'required|email'])
  • Logger.php — PSR-3 compatible with file rotation
  • Performance.php — Operation timers, slow query detection
  • SecurityHelper.php — Rate limiting, input sanitization, password hashing
  • ModuleLoader.php — Auto-discovers plug-and-play modules

6 Modules ($20 each)

Each module includes database schema, full REST API routes, and a module.json manifest:

Module Endpoints Tables
Inventory Management 24 7
CMMS Maintenance 20 6
Production Tracker 18 5
Internal Chat 16 5
Shift Scheduling 14 6
Report Builder 12 4

Total: 104 API endpoints, 33 database tables.

The demo

I built an interactive dashboard demo showcasing every module:

Live Demo →

Dark theme, animated stats, Chart.js graphs, live activity feeds, and full CRUD previews for every module.

What I learned

  1. Extracting a framework from a monolith is harder than building one from scratch. You have to untangle business logic from framework logic, and the line isn't always clear.

  2. The module system was the key insight. Once I designed the ModuleLoader with auto-discovery, adding new capabilities became trivial: create a directory, add a module.json, and the framework picks it up.

  3. Production code is different from tutorial code. Every class handles edge cases, error states, and security concerns that you only discover by running software for real users.

Get it

Built by CDAC Programming.

Top comments (0)