Core
The framework under the CMS.
VelvetCMS Core isn't a micro-framework. It's not a full-stack beast either. It's the sweet spot: everything you need to build content-driven applications, nothing you don't.
What's Included
A complete toolkit. No external dependencies for the essentials.
Router
Expressive routing with parameters, middleware pipelines, and controller support. Cache routes for production.
Service Container
Dependency injection with autowiring. Singletons, factories, aliases. No configuration XML.
Query Builder
Fluent database queries with prepared statements. Joins, subqueries, transactions. SQLite, MySQL, PostgreSQL.
Content Drivers
Four storage strategies: File, Database, Hybrid, Auto. Start simple, scale seamlessly. No migration headaches.
Event System
Hook into everything. Before/after events for requests, content loading, rendering. Build decoupled modules.
Module Architecture
Self-contained packages with routes, services, and config. Enable what you need. Disable what you don't.
Template Engine
Native PHP templates with auto-escaping. Layouts, partials, sections. No Twig dependency.
Caching Pipeline
Query cache, page cache, route cache, config cache. File or custom drivers. Automatic invalidation.
CLI Toolkit
Built-in commands for migrations, cache, scaffolding. Create custom commands for your workflow.
Content Drivers
Pick your storage strategy. Change it later without rewriting code.
CONTENT_DRIVER=file
File Driver
Markdown files with YAML frontmatter. Git-friendly, no database required. Edit with VS Code, vim, whatever.
- Version control friendly
- Zero database setup
- Best for: blogs, docs, small sites
CONTENT_DRIVER=hybrid
Hybrid Driver
Content stays in files, metadata lives in the database. Fast queries without losing the file workflow.
- Best of both worlds
- Fast metadata queries
- Best for: growing sites, mixed teams
CONTENT_DRIVER=db
Database Driver
Everything in the database. Maximum query flexibility for complex content relationships.
- Complex relational queries
- Admin panel ready
- Best for: large sites, Extended CMS
CONTENT_DRIVER=auto
Auto Driver
Start with files, automatically switch to hybrid at 100 pages. Zero configuration scaling.
- Set it and forget it
- Automatic migration
- Best for: new projects
Security by Default
Every layer is hardened. You have to opt out of protection.
Start with Core
Clone, install, serve. Under a minute.
git clone https://github.com/VelvetCMS/VelvetCMS-Core.git && cd VelvetCMS-Core
composer install && ./velvet install && ./velvet serve