Mvcms-lite
mvcms-lite: A Minimalist Architecture for File-Based Content Management
Abstract Modern Content Management Systems (CMS) have become increasingly complex, often relying on heavy relational databases and monolithic plugin architectures to serve simple content needs. This paper introduces mvcms-lite, a lightweight, flat-file CMS architecture strictly adhering to the Model-View-Controller (MVC) design pattern. By leveraging native file systems for storage and a minimalist routing engine, mvcms-lite demonstrates that secure, scalable, and maintainable web applications can be built without the overhead of traditional database drivers or administrative bloat.
3. The Request Lifecycle
The execution flow of mvcms-lite is designed to be transparent and linear, avoiding the "magic" present in larger frameworks. mvcms-lite
- Bootstrap: The application loads configuration constants (paths, environment mode).
- Routing: The
Routerclass matches the request URI against defined routes (e.g.,/blog/slug). - Dispatch: The matched route instantiates the designated Controller.
- Processing: The Controller calls the
Model::find($slug)method. The Model reads the file from the disk, parses the Front Matter, and returns a Data Object. - Rendering: The Controller passes the Data Object to the
View::render('template', $data)method. - Response: The HTML is output to the browser.
6. Security Implications
By removing the database, the attack surface is altered but not eliminated. authentication is handled via session-based middleware
- SQL Injection: Eliminated entirely.
- XSS (Cross-Site Scripting): Mitigated through the View layer, which escapes output by default.
- Directory Traversal: The Model must strictly sanitize input paths. A request for
../../etc/passwdmust be rejected by the core engine. - Authentication: As a "lite" system, authentication is handled via session-based middleware, suitable for single-user or small-team deployments.
Building Your First Page
Unlike bloated CMS drag-and-drop builders, MVCMS-Lite assumes you know HTML. Here is how you build a "Products" page. suitable for single-user or small-team deployments.
