The context
Glad Blog is a simple blog with CRUD and minimal authentication, written in plain PHP — without Laravel or Symfony. I present it as one of my first steps exploring PHP: learning the fundamentals, shipping a first production-oriented setup, and building the local environment myself with Docker.
The project is not a finished product: it still lacks security layers, tests, and other best practices. It remains interesting for what it forces you to understand without a framework: MVC architecture, homemade routing, light dependency injection, and concrete design patterns.
On the domain side, Entities hold business rules (ess anemic model than in my first versions), while Managers handle persistence. Controllers stay thin thanks to a container (`AppContainer`) that injects Managers and Session. Routing relies on PHP Attributes `#[Route]` discovered via Reflection when the front controller boots.
What I learn :
- Architecture and patterns:
- MVC (Controllers / Views / Entities + Managers) and PHP OOP, without a framework
- Abstract Factory: `PdoConnectionFactory` (MySQL / Postgres) and `DocumentConnectionFactory` (Mongo); the app uses MySQL by default
- Template Method: `AbstractController`, `BaseManager`, and `BaseEntity` fix the skeleton; subclasses only fill in the details
- Attribute routing + Reflection: `#[Route('/read', ...)]` registered at startup via `ReflectionClass`
- Stack and environment:
- PHP 8.1, JavaScript, HTML/CSS; MySQL; Apache
- Docker Compose: blog on port 1300, Adminer on 1301, `composer install` on PHP container start
- GitHub repository: source code and install README (clone, `docker compose up`, demo account)
