PHPackages                             bitshost/upmvc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. bitshost/upmvc

ActiveProject[Framework](/categories/framework)

bitshost/upmvc
==============

upMVC. Modular Model View Controller. A modular PHP MVC system with integrated routing for scalable and organized web applications. Built-in Namespace Support. Object-Oriented Programming (OOP).

v2.4.0(2w ago)37321MITPHPPHP &gt;=8.1CI passing

Since Nov 17Pushed 2w ago1 watchersCompare

[ Source](https://github.com/upMVC/upMVC)[ Packagist](https://packagist.org/packages/bitshost/upmvc)[ RSS](/packages/bitshost-upmvc/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (8)Dependencies (10)Versions (72)Used By (1)

📚 upMVC noFramework v2.5 – Complete Documentation
=================================================

[](#-upmvc-noframework-v25--complete-documentation)

> **Modern, lightweight PHP NoFramework with Islands Architecture for real-world PHP + JS systems**

**Status: ✅ Production Ready (v2.5)** | **PHP 8.1+** | **PSR-4 Compliant** | **MIT License**

**v2.5:** Thin create-project — **Welcome** homepage (no database), optional demos as a Releases zip, migration runner, Router v2.0, package/provider architecture, **AI Agent pack**, and PHP + React/Vue *Islands Architecture*. Kernel lives in `src/Etc/`; modules are optional.

🤖 AI Agent — built-in context for Cursor, Claude, and local LLMs
----------------------------------------------------------------

[](#-ai-agent--built-in-context-for-cursor-claude-and-local-llms)

upMVC ships an **AI-native knowledge pack** — not a chatbot inside PHP, but portable rules and facts any coding assistant can load so you **start in the middle of the house**: say what you want to build; the agent already knows paths, bootstrap, modules, and constraints.

**You do not need to explain upMVC from scratch in every chat.**

### How it works

[](#how-it-works)

1. Run **`php src/Tools/upmvc-next.php`** (or pass `--goal "…"`).
2. The CLI scans your project (modules, `.env`, SaaS pack if present).
3. It writes **`docs/agent/generated/last-prompt.md`** — paste into Cursor, Windsurf, Claude, or any agent.
4. The agent follows **`upmvc-rules.json`** (must/never) and outputs a **plan before** multi-file edits.

### What ships in the repo

[](#what-ships-in-the-repo)

FileRoleLoaded by default?[`AGENTS.md`](AGENTS.md)Entry point for cloud agents / CursorYes (when supported)`docs/agent/upmvc-knowledge.json`Framework facts: paths, config, routing, packagesYes`docs/agent/upmvc-rules.json`Hard must/never rulesYes`docs/agent/upmvc-workflows.json`Intent → recipes (config audit, API, auth, …)Yes`docs/agent/upmvc-scaffolds.json`Module types, CRUD field schema, route patterns**No** — opt-in (`--scaffold`)`docs/agent/upmvc-saas-pack.json`SaaS pack architecture**No** — when SaaS project detected**General mode by default.** Module scaffolds and SaaS context are optional extensions — different users use agents differently; we do not force builder mode on every session.

### Quick commands

[](#quick-commands)

```
# Interactive — one question, then paste last-prompt.md into your agent
php src/Tools/upmvc-next.php

# Non-interactive
php src/Tools/upmvc-next.php --goal "Fix JWT on /api/auth" --stdout

# Opt-in module builder pack (replaces removed PHP generators)
php src/Tools/upmvc-next.php --scaffold --goal "Create a Blog CRUD module"
```

**Full guide:** [docs/AGENT\_PACK.md](docs/AGENT_PACK.md) · **Tests:** `vendor\bin\phpunit tests\Unit\Tools`

> **Note:** Legacy PHP module generators were removed. New modules are created by your AI assistant using the knowledge pack (and optional scaffolds), not `php tools/createmodule/…`.

🏢 upMVC-SaaS — Official Multi-Tenant Fork
-----------------------------------------

[](#-upmvc-saas--official-multi-tenant-fork)

Need to build a **SaaS product**? **[upMVC-SaaS](https://github.com/upMVC/upMVC-SaaS)** is the official fork of upMVC with multi-tenancy, platform administration, tenant isolation, plan gating, JWT auth, impersonation, and a complete signup/onboarding flow built in — ready to extend, not a starting template.

→ **[github.com/upMVC/upMVC-SaaS](https://github.com/upMVC/upMVC-SaaS)**

### Compose your stack (optional layers)

[](#compose-your-stack-optional-layers)

Thin Core is enough for many apps. When you need more, compose — nothing is mandatory:

LayerPieceJobKernel**upMVC** (`src/Etc/`)Boot, routes, modules, SSR / SPA shells — PHP first, no forced ORMProduct**upMVC-SaaS + saas-pack**Tenants, plans, isolation, onboardingAPI**[PHP CRUD API Generator](https://github.com/BitsHost/PHP-CRUD-API-Generator)**Full API plane — auth, RBAC, filters, bulk, rate limits, OpenAPIUIModules / islandsReact, Vue, Svelte, or plain PHP — consume the API from any SPA**Strongest simple foundation for multi-tenant products:** upMVC-SaaS + saas-pack + the API library — then SPA modules in whatever JS you like. Each layer stays in its lane; you don’t rebuild tenancy or REST from scratch.

→ Full guide: **[upMVC + PHP CRUD API Generator](docs/INTEGRATION_PHP_CRUD_API.md)** (includes the SaaS + API composition)

---

🎨 **NEW: Modern UI System**
---------------------------

[](#-new-modern-ui-system)

upMVC v1.0.3 introduces a **contemporary design system** while maintaining complete backward compatibility:

- **🌟 Modern BaseView**: Contemporary CSS Grid/Flexbox layouts with dark mode
- **📱 Responsive Design**: Mobile-first approach with modern navigation
- **⚡ Alpine.js Integration**: Lightweight interactivity (~40KB vs 87KB jQuery)
- **🎯 Zero Breaking Changes**: Drop-in replacement for existing BaseView

**Quick Demo** (with optional demos installed): `/test` (original) vs `/test/modern` (new design) **Documentation:** [Modern BaseView Guide](docs/MODERN_BASEVIEW_GUIDE.md) | [Demo Instructions](docs/MODERN_DEMO.md)

🌟 **What is upMVC?**
--------------------

[](#-what-is-upmvc)

A lightweight, modern PHP 8.1+ noFramework built on Modular MVC (MMVC) architecture. Designed for developers who want flexibility without noFramework bloat. Features true modularity, "PHP Islands" for frontend integration (React/Vue), dependency injection, middleware pipeline, and clean routing. No forced conventions - use pure PHP or integrate modern JS noFrameworks as needed. Perfect for rapid development while maintaining performance and flexibility.

✨ **Key Features:** Modular architecture • PHP 8.1+ • PSR-4 compliant • Dependency injection • Middleware support • Frontend noFramework integration • Minimal learning curve

### 🚀 **Deploy Any JavaScript Framework**

[](#-deploy-any-javascript-framework)

upMVC excels at integrating **pre-built JavaScript applications** from any framework:

- **⚛️ React** - `npm run build` → deploy to module/public ([Guide](docs/REACT_BUILD_INTEGRATION.md))
- **💚 Vue** - Production builds with Vite/Webpack ([Guide](docs/VUE_BUILD_INTEGRATION.md))
- **🔥 Svelte** - SvelteKit or standalone builds
- **⚡ Any Framework** - Angular, Solid, Qwik, etc.

**Your PHP module serves the built app** - no complex webpack configs, no dev servers in production. Just build your JS app locally and deploy the static files. Your Controller exposes data via API endpoints that your JS app consumes.

📖 **Complete Guides:**

- [React Integration](docs/REACT_BUILD_INTEGRATION.md) - React 18, Vite, Webpack, CRA
- [Vue Integration](docs/VUE_BUILD_INTEGRATION.md) - Vue 2/3, Vite, Webpack, Nuxt
- Coming soon: Svelte, Angular guides

> **🤔 Why Mix PHP with JavaScript Frameworks?**
> upMVC is a **system architecture**, not just a single app. **Layer 1 (Main upMVC)** handles security, auth, sessions. **Layer 2 (Modules)** are independent apps using any tech—PHP, React, Vue, Svelte. Split large monoliths into micro-frontends. Each team works independently. Deploy modules separately. One breach can't compromise the entire system. **Best of both worlds:** Server-side security + client-side reactivity. Read: [Why Mix?](docs/REACT_BUILD_INTEGRATION.md#-why-mix-php-with-javascript-frameworks)

> **🆚 How is upMVC Different?**
> Unlike Laravel, Symfony, or other PHP frameworks, upMVC is a **system, not a framework**. No forced conventions, no ORM requirements, no framework rules. **"Direct PHP First"** principle means complete freedom. Want React in one module and Vue in another? ✅ Want to delete core modules? ✅ Want to split your app into multiple independent instances? ✅ True micro-frontends architecture that nobody else offers. Read: [Comparison with Other PHP Projects](docs/COMPARISON_PHP_FRAMEWORKS.md)

> **📌 Note:** Stock upMVC ships a thin **Welcome** homepage only (no database). Optional demos are a separate download — not a Composer package. See [Module Philosophy](docs/MODULE_PHILOSOPHY.md).
>
> **Homepage:** `/` is owned by `src/Etc/custom-routes.php` → `Welcome\Controller`. Change or remove that entry anytime and point `/` at your own module.

### Optional demo modules (Auth, Test, Admin, React, …)

[](#optional-demo-modules-auth-test-admin-react-)

Download **`upmvc-demos.zip`** from [GitHub Releases](https://github.com/upMVC/upMVC/releases).

1. Paste `Modules/*` into `src/Modules/` (next to `Welcome`)
2. Import demo SQL if needed (`demo-modules.sql` is in the zip, or `database/demo-modules.sql` in the repo)
3. `composer dump-autoload` — optional; `App\` → `src/` usually already covers new folders
4. Done — routes appear (`/test`, `/auth`, `/admin`, …)

Take / try / drop: delete any demo folder under `src/Modules/` anytime.

🚀 **Quick Navigation**
----------------------

[](#-quick-navigation)

### **🎯 New to upMVC? Start Here:**

[](#-new-to-upmvc-start-here)

- **[📋 First Steps Guide](docs/FIRST-STEPS-GUIDE.md)** - Get running in 5 minutes
- **[📘 How-To Guide](docs/HOW-TO-GUIDE.md)** - Complete development guide
- **[❓ FAQ](docs/FAQ.md)** - Common questions and solutions
- **[📚 Documentation Index](docs/DOCUMENTATION-INDEX.md)** - Complete documentation map

### **🗺️ Routing System (Complete Guide):**

[](#️-routing-system-complete-guide)

- **[🌟 THE COMPLETE PICTURE](docs/routing/THE_COMPLETE_PICTURE.md)** - ⭐⭐⭐ **START HERE!** Everything from .htaccess to controller - Why each piece exists, when to use each strategy
- **[📖 Routing Documentation](docs/routing/README.md)** - Complete routing documentation hub
- **[📋 Routing Guide](docs/routing/ROUTING_GUIDE.md)** - All 5 routing types with decision tree
- **[🚀 Router V2 Examples](docs/routing/ROUTER_V2_EXAMPLES.md)** - Type casting, validation, named routes

### **🔐 Security &amp; Authentication:**

[](#-security--authentication)

- **[JWT Authentication Guide](docs/JWT_AUTHENTICATION.md)** — Opt-in JWT support: issue tokens with `JwtService`, protect API routes with `['jwt']` middleware, refresh token flow. Sessions are unaffected — JWT is an additional option for APIs and SPAs.

### **🗄 Database &amp; Migrations:**

[](#-database--migrations)

- **[Database Guide](database/README.md)** — Two ways in: import `database/schema.sql` + `database/seed.sql` for an instant working install, or run `php src/Tools/migrate.php` for tracked, repeatable migrations. Packages register their own migration paths and are picked up automatically. `schema.sql` is generated on every run, so it never drifts.

### **🤖 AI Agent:**

[](#-ai-agent)

- **[Agent Pack Guide](docs/AGENT_PACK.md)** — Full guide: core JSON pack, `upmvc-next.php`, optional scaffolds, Cursor/`AGENTS.md`
- **[AGENTS.md](AGENTS.md)** — Root entry for cloud agents

### **🏗 Architecture &amp; Philosophy:**

[](#-architecture--philosophy)

- **[🎨 Pure PHP Philosophy](docs/PHILOSOPHY_PURE_PHP.md)** - The upMVC NoFramework approach
- **[🧩 Module Philosophy](docs/MODULE_PHILOSOPHY.md)** - Modules as reference implementations
- **[🔄 Configuration Fallbacks](docs/CONFIGURATION_FALLBACKS.md)** - **NEW!** Three-level fallback system explained
- **[🏝️ Islands Architecture](docs/ISLANDS_ARCHITECTURE_INDEX.md)** - **NEW!** Complete guide to PHP + React Islands
- **[⚛️ React Integration Patterns](docs/REACT_INTEGRATION_PATTERNS.md)** - Five ways to integrate React/Vue/Preact
- **[🔥 ReactHMR - Hot Module Reload](https://github.com/upMVC/upMVC/releases)** - Demo module in the optional Releases zip (see Reacthmr README inside the pack)
- **[📦 Integration: upMVC + PHP CRUD API Generator](docs/INTEGRATION_PHP_CRUD_API.md)** - Compose with SaaS pack + API (full API plane, not a toy helper)
- **[🎯 JavaScript Framework Integration](docs/REACT_BUILD_INTEGRATION.md)** - **NEW!** Deploy React, Vue, Svelte, or any JS framework build
- **[⚛️ React Build Integration](docs/REACT_BUILD_INTEGRATION.md)** - Complete React deployment guide (Vite/Webpack/CRA)
- **[💚 Vue Build Integration](docs/VUE_BUILD_INTEGRATION.md)** - **NEW!** Vue 2/3 deployment guide (Vite/Webpack/Nuxt)
- **[🆚 Comparison with Other PHP Frameworks](docs/COMPARISON_PHP_FRAMEWORKS.md)** - **NEW!** Why upMVC is unique
- **[💪 Architectural Strengths](docs/ARCHITECTURAL_STRENGTHS.md)** - What makes upMVC powerful
- **[🛣 Routing Capabilities](docs/ROUTING_CAPABILITIES.md)** - Understanding the routing system
- **[�️ Routing &amp; .htaccess System](docs/ROUTING_HTACCESS.md)** - **NEW!** Complete guide with module examples (test, moda, userorm, admin)
- **[�🔧 URL Handling Explained](docs/URL_HANDLING_EXPLAINED.md)** - Request flow and middleware

### **� Bug Fixes &amp; Improvements:**

[](#-bug-fixes--improvements)

- **[🔐 Authentication Redirect Fix](docs/BUG_FIX_AUTH_REDIRECT.md)** - Session intended\_url handling
- **[⚙️ Assignment Operator Fix](docs/BUG_FIX_AUTH_ASSIGNMENT.md)** - Comparison vs assignment
- **[🚪 Missing Exit Statements](docs/BUG_FIX_MISSING_EXIT.md)** - Proper redirect handling
- **[📤 Output Before Header Fix](docs/BUG_FIX_OUTPUT_BEFORE_HEADER.md)** - Header redirect timing
- **[🔗 Trailing Slash Fix](docs/BUG_FIX_TRAILING_SLASH.md)** - URL normalization
- **[🧹 Debug Code Cleanup](docs/CLEANUP_DEBUG_CODE.md)** - Production-ready code

### **✅ Verification &amp; Release:**

[](#-verification--release)

- **[🔍 Pre-Release Verification](docs/PRE_RELEASE_VERIFICATION.md)** - Complete verification report
- **[🚀 Ready for Main](docs/READY_FOR_MAIN.md)** - Production readiness checklist
- **[📋 Verification Checklist](docs/VERIFICATION_CHECKLIST.md)** - Step-by-step validation
- **[✨ Enhancements](docs/ENHANCEMENTS.md)** - Latest improvements

### **🛠 Development:**

[](#-development)

- **[🐛 /zbug Folder](zbug/README.md)** - Debug files and development utilities (excluded from Git)

### **🚀 Router v2.0 - Enhanced Routing:**

[](#-router-v20---enhanced-routing)

- **[🌟 THE COMPLETE PICTURE](docs/routing/THE_COMPLETE_PICTURE.md)** - ⭐⭐⭐ **Everything explained** - .htaccess, Router, all 5 strategies, when to use each
- **[Complete Routing Guide](docs/routing/ROUTING_GUIDE.md)** - Unified guide covering all 5 routing types, decision tree, when to use each
- **[Router v2.0 Examples](docs/routing/ROUTER_V2_EXAMPLES.md)** - Complete Router V2 usage guide (type casting, validation, named routes, grouping)
- **[Router v2.0 Changelog](docs/routing/ROUTER_V2_CHANGELOG.md)** - What's new in v2.0
- **[Implementation Report](docs/routing/ROUTER_V2_IMPLEMENTATION_COMPLETE.md)** - Technical implementation details
- **[Parameterized Routing Guide](docs/routing/PARAMETERIZED_ROUTING.md)** - Full parameterized routing documentation
- **[Evaluation Report](docs/routing/PARAMETERIZED_ROUTING_EVALUATION.md)** - Grade: A+ (90/100)
- **[Future Recommendations](docs/routing/PARAMETERIZED_ROUTING_RECOMMENDATIONS.md)** - v2.1+ roadmap
- **[Helpers Class Usage](docs/routing/HELPERS_CLASS_USAGE.md)** - OOP helper methods guide
- **[Helper Functions Guide](docs/routing/HELPER_FUNCTIONS_GUIDE.md)** - `HelperFacade` reference: routes, URLs, CSRF, config, responses

### **🏗️ PSR-4 Helper Architecture:**

[](#️-psr-4-helper-architecture)

upMVC now features a modern PSR-4 compliant modular helper system:

- **Modular Structure:** Each helper in its own class (RouteHelper, UrlHelper, FormHelper, etc.)
- **Facade Pattern:** Unified access via `HelperFacade`
- **Auto-loaded:** No manual `require_once` needed
- **Type-Safe:** Router V2 integration for named routes
- **Scalable:** Easy to add new helpers
- **[View Helper Classes](src/Etc/Helpers/)** - PSR-4 helper architecture

### **🎯 Routing Features:**

[](#-routing-features)

upMVC provides **5 routing strategies** for different scenarios:

1. **Simple Static Routes** - Fixed URLs (`/about`, `/contact`)
2. **Parameterized Routes** - URL placeholders (`/users/{id}`)
3. **Router V2 Enhanced** - Type casting + validation + named routes ⭐ **NEW!**
4. **Database-Driven Routes** - Dynamic routes from DB
5. **Cached Database Routes** - DB routes with file caching

**Router V2 Enhanced Features:**

- ✅ **Type Casting:** `{id:int}`, `{price:float}`, `{active:bool}` - automatic type conversion
- ✅ **Validation:** Regex constraints at router level (`['id' => '\d+']`)
- ✅ **Named Routes:** `addParamRoute(...)->name('user.edit')`, then `$router->route('user.edit', ['id' => 5])`
- ✅ **Prefix Grouping:** routes are bucketed by first segment internally to speed up matching — an optimisation, not a `group()` API

> Only `addParamRoute()` is chainable (it returns `$this`). `addRoute()` returns nothing, so `addRoute(...)->name(...)` is a fatal error — attach middleware and methods through its 4th and 5th arguments instead.

**Quick Example:**

```
// Router V2 - Type-safe with validation
$router->addParamRoute('/users/{id:int}', User\Controller::class, 'show', [], [
    'id' => '\d+'
])->name('user.show');

// Controller - no manual casting needed!
public function show() {
    $id = $_GET['id']; // Already an integer!
    $user = $this->model->getUserById($id);
    // ...
}

// Generate URLs with named routes
$url = HelperFacade::route('user.show', ['id' => 123]); // /users/123
```

**See:** [Complete Routing Guide](docs/routing/ROUTING_GUIDE.md) for decision tree and when to use each type

Demo:

Rasmus Lerdorf: PHP NoFrameworks all suck!

[Rasmus Lerdorf: PHP NoFrameworks all suck!](https://www.youtube.com/watch?v=DuB6UjEsY_Y&ab_channel=matperino)

Use cases:
==========

[](#use-cases)

#### You can use the system as a standalone, as a library, as a library in the standalone version where it can be a module, you can also use it as a standalone in the standalone version /shop /blog /app /anything else - in this way, you split your app into multiple apps(shop, blog, app, anything else as separate instances of upMVC) each with their modules connected to the same or different endpoints.

[](#you-can-use-the-system-as-a-standalone-as-a-library-as-a-library-in-the-standalone-version-where-it-can-be-a-module-you-can-also-use-it-as-a-standalone-in-the-standalone-version-shop-blog-app-anything-else---in-this-way-you-split-your-app-into-multiple-appsshop-blog-app-anything-else-as-separate-instances-of-upmvc-each-with-their-modules-connected-to-the-same-or-different-endpoints)

📦 Installation
==============

[](#-installation)

> **Entry Point**
> The only HTTP entry point is `public/index.php`. There is no `index.php` at the project root. Point your web server's document root at `public/` — never at the project root, which would expose `src/Etc/.env`.

Option 1: Install as a Library (Recommended for existing projects)
------------------------------------------------------------------

[](#option-1-install-as-a-library-recommended-for-existing-projects)

Add upMVC to your existing project:

```
# Step 1: Install via Composer
composer require bitshost/upmvc
# Alternative versions:
# composer require bitshost/upmvc:^2.4  (pin the current minor)
# composer require bitshost/upmvc:dev-main  (bleeding edge - risky!)

# Step 2: Copy the entry point into your own public directory
cp vendor/bitshost/upmvc/public/index.php public/
cp vendor/bitshost/upmvc/public/.htaccess public/

# Step 3: Create the .env the framework reads
cp vendor/bitshost/upmvc/src/Etc/.env.example vendor/bitshost/upmvc/src/Etc/.env
# Edit that file with the required settings:
# - SITE_PATH=/your-folder-name (e.g., /myproject)
# - DOMAIN_NAME=localhost (or your domain)
#
# Database configuration is optional (uses src/Etc/ConfigDatabase.php fallback)
# - Configure only when your modules need database access
# - Framework works without database for static/API projects
```

> **Note on `.env` location.** The `Environment` class currently reads `src/Etc/.env` **relative to the package**, so on a library install that file lives inside `vendor/`. See [docs/install-as-library/](docs/install-as-library/) for the full picture and an advanced `Environment` variant that supports a per-install `.env` outside `vendor/`.

**Run it with:**

```
php -S localhost:8080 -t public
```

**Visit:** `http://localhost:8080` — Welcome homepage loads with no database. Optional demos (if installed) are discovered automatically.

Option 2: Install as a Standalone Project (Even Simpler!)
---------------------------------------------------------

[](#option-2-install-as-a-standalone-project-even-simpler)

Create a complete upMVC project in **4 simple steps:**

```
# Step 1: Create project
composer create-project bitshost/upmvc yourProjectName
# Or in current directory:
# composer create-project bitshost/upmvc .

# Step 2: Navigate to project
cd yourProjectName

# Step 3: Configure .env — note the destination: src/Etc/.env, not the root
# cp src/Etc/.env.example src/Etc/.env
# Edit these 2 required settings:
# - SITE_PATH=/yourProjectName/public   # document root should point at public/
#   or SITE_PATH=                       # if the app is at domain root
# - DOMAIN_NAME=http://localhost

# Step 4: Open the site
# Welcome (`/`) needs no database. You can browse immediately after
# configuring DOMAIN_NAME / SITE_PATH.
#
# When you add your own modules (or the optional demo pack) that use PDO,
# point .env at a database — an EMPTY database is enough to avoid
# SQLSTATE[HY000] [1049] Unknown database:
#
#   CREATE DATABASE upmvc CHARACTER SET utf8mb4;
#
# - DB_NAME=upmvc
# - DB_HOST=127.0.0.1
# - DB_USER=root
# - DB_PASS=
#
# Kernel tables and demo logins: see database/README.md
#   mysql -u root -p upmvc < database/schema.sql
#   mysql -u root -p upmvc < database/seed.sql
#
# Optional demo modules (Auth, Test, Admin, React, …):
#   1. Download upmvc-demos.zip from GitHub Releases
#   2. Paste Modules/* into src/Modules/ (next to Welcome)
#   3. mysql -u root -p upmvc < database/demo-modules.sql   # or the copy inside the zip
#   4. composer dump-autoload   # optional
#   Userorm also needs: composer require gabordemooij/redbean
#
# Database settings are optional because upMVC has smart fallbacks:
# - If .env database settings are missing, it uses src/Etc/ConfigDatabase.php
# - Framework will work even without database (for static/API projects)
# - Configure database only when you need it for your modules
```

**That's it!** 🎉 Run with:

```
php -S localhost:8081 -t public
```

`-t public` is required — `public/index.php` is the only entry point, so serving the project root returns 404 for every URL, including `/`.

**Visit:** `http://localhost:8081` (or adjust for `SITE_PATH`)

**Note:** Stock install is **Welcome + kernel** only. Demo modules are the optional Releases zip (steps above) — not bundled in `create-project`.

**Optional - Keep dependencies updated:**

```
# Update autoloader when adding new modules
composer dump-autoload

# Update dependencies
composer update
```

� Lightweight Parameterized Routing (Optional)
----------------------------------------------

[](#-lightweight-parameterized-routing-optional)

You can now declare routes with simple placeholders instead of only exact paths or .htaccess rewrites.

Examples:

```
// Exact route (unchanged)
$router->addRoute('/users', User\Controller::class, 'index');

// New: parameterized routes
$router->addParamRoute('/users/{id}', User\Controller::class, 'show');
$router->addParamRoute('/orders/{orderId}/items/{itemId}', OrderItem\Controller::class, 'detail');
```

How it works:

- Exact routes are checked first (fast hash lookup).
- If no exact match, parameterized routes are evaluated (segment by segment).
- Extracted parameters are injected into `$_GET` (e.g., `$_GET['id'] = '123'`) and also available to middleware via `$request['params']`.
- Controllers keep their simple signature: `action($route, $method)` and read params from `$_GET`.

Benefits:

- Cleaner route declarations for resource-like URLs.
- Fewer .htaccess patterns; less boilerplate loops.
- Backward compatible; you can mix exact and param routes.

Notes:

- Placeholder syntax: `{name}` (letters/digits/underscore, must start with a letter/underscore).
- Exact routes always win over parameterized routes (e.g., `/users/profile`).
- Type validation remains in your controller (e.g., `ctype_digit($_GET['id'])`).

�🧹 Maintenance: Cache CLI
-------------------------

[](#-maintenance-cache-cli)

Use the cache maintenance utility to inspect and clear caches (module discovery, admin dynamic route cache, and configured cache stores).

```
# List available commands
php src/Tools/cache-cli.php list

# Show cache statistics
php src/Tools/cache-cli.php stats

# Clear only module discovery caches
php src/Tools/cache-cli.php clear:modules

# Clear Admin module dynamic route cache
php src/Tools/cache-cli.php clear:admin

# Clear everything (modules + admin + cache stores)
php src/Tools/cache-cli.php clear:all
```

Windows PowerShell example:

```
php .\src\Tools\cache-cli.php clear:all
```

Affected components:

- Module discovery cache used by `src/Etc/InitModsImproved.php` in production mode.
- Admin dynamic route cache file: `src/Etc/storage/cache/admin_routes.php`.
- All instantiated cache stores via `App\Etc\Cache\CacheManager::clearAll()`.

Exit codes: `0` success, `1` failure, `2` unknown command.

🤖 AI Agent Pack (tools)
-----------------------

[](#-ai-agent-pack-tools)

See **[AI Agent — built-in context](#-ai-agent--built-in-context-for-cursor-claude-and-local-llms)** above for the full picture. From `src/Tools/`:

```
php src/Tools/upmvc-next.php
php src/Tools/upmvc-next.php --goal "Audit my .env wiring" --stdout
php src/Tools/upmvc-next.php --scaffold --goal "Add Api/Bookings module"
```

Output: `docs/agent/generated/last-prompt.md` (gitignored). Details: **[docs/AGENT\_PACK.md](docs/AGENT_PACK.md)**.

⚙️ Configuration
----------------

[](#️-configuration)

upMVC uses a smart **layered configuration system** with automatic fallbacks:

### Primary Configuration: `.env` file

[](#primary-configuration-env-file)

Edit `.env` (at project root) for environment-specific settings:

- **Required:** `SITE_PATH`, `DOMAIN_NAME`, `APP_ENV`
- **Optional:** Database, mail, cache, session settings

### 🔄 Five-Level Fallback System

[](#-five-level-fallback-system)

upMVC has intelligent fallbacks that let the system work immediately without complete configuration:

1. **Path &amp; Domain** → `.env` or `Config.php` fallbacks
2. **Protected Routes** → `.env` or `start.php` defaults
3. **Database** → `.env` or `ConfigDatabase.php` fallbacks
4. **Session Configuration** → Config array or hardcoded defaults (lifetime, secure, httponly)
5. **Security/Middleware** → `.env` ConfigManager or defaults (CORS, CSRF, rate limiting)

**Why?** Start coding immediately, configure gradually as you need features!

📖 **[Complete Fallback Documentation](docs/CONFIGURATION_FALLBACKS.md)** - Detailed guide with examples and troubleshooting

### 🔍 Quick Troubleshooting

[](#-quick-troubleshooting)

If something doesn't work as expected, check:

1. `.env` file (highest priority)
2. `Config.php` fallbacks (path/domain + session)
3. `start.php` defaults (protected routes + security)
4. `ConfigDatabase.php` (database credentials)
5. `ConfigManager.php` (all .env-based defaults)

💡 **Pro Tip:** Start with just `SITE_PATH` and `DOMAIN_NAME`, add database later when needed!

🛣️ Routing System
-----------------

[](#️-routing-system)

upMVC v2 uses a **Router v2.0 + auto-discovery** model – you configure the core router once and let modules register themselves.

### Core Routing Flow

[](#core-routing-flow)

1. **Global Routes** → `src/Etc/Routes.php`
    - Application-wide routes (health, home, system-level endpoints).
2. **Router v2.0** → `src/Etc/Router.php`
    - Exact routes + parameterized routes (typed, validated, named).
3. **Module Auto‑Discovery** → `src/Etc/InitModsImproved.php`
    - Scans `src/Modules/*` and automatically wires module routes.

### Autoloading (Composer)

[](#autoloading-composer)

Composer now handles everything via a **single PSR‑4 root**:

```
"autoload": {
    "psr-4": {
        "App\\": "src/"
    }
}
```

- No per‑module namespace entries needed **in composer.json** – all modules live under the single `App\` tree.
- Inside your module code you still declare normal namespaces like `App\Modules\Blog`, `App\Modules\Shop`, etc. – Composer autoload will resolve them automatically.
- After adding new modules, run: `composer dump-autoload`

### Quick Start: Add a Module with Routes

[](#quick-start-add-a-module-with-routes)

1. Create your module under `src/Modules/Yourmodule/` (Controller, View, etc.).
2. Expose routes from the module via its `Routes`/`routes` method (see docs and examples).
3. Ensure `InitModsImproved` is in use – it will auto‑discover and register the module.
4. Visit the module URL; Router v2.0 + middleware handle the rest.

**Examples &amp; Guides:**

- Optional demos (`Test`, `Admin`, …) ship in the Releases zip — not in a stock clone.
- Read: `docs/routing/ROUTING_GUIDE.md`, `docs/routing/ROUTER_V2_EXAMPLES.md`, and `docs/routing/ROUTER_V2_CHANGELOG.md`.

Note:

A friendly URL is a short and simple web address that redirects to a longer web address. Friendly URLs are called Aliases in Sitecore.

We achieve this by combining some .htacces rules with module routes. Check modules/test/routes/Routes.php and the .htaccess file - you will notice the rules established in the.htaccess file for these specific routes - you may build as many as you like.

[![Screenshot 2024-02-14 141414](https://private-user-images.githubusercontent.com/23263143/304729706-7494c92d-5fb8-4246-9e1a-12cd08edf21c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODU2OTE0ODAsIm5iZiI6MTc4NTY5MTE4MCwicGF0aCI6Ii8yMzI2MzE0My8zMDQ3Mjk3MDYtNzQ5NGM5MmQtNWZiOC00MjQ2LTllMWEtMTJjZDA4ZWRmMjFjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwODAyVDE3MTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUxMGVlYmRjNTNkOGEyYmU2NzBjNDUxZGNlMDRmMDc4MDhlZjQ2MjZmYjRjMGI1NzllNzQzNTAzMzM0MDVmMzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.6cBCD05F1mieXRuaKyBuDCm74l_hjZlQDfNmcRd0w2Q)](https://private-user-images.githubusercontent.com/23263143/304729706-7494c92d-5fb8-4246-9e1a-12cd08edf21c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODU2OTE0ODAsIm5iZiI6MTc4NTY5MTE4MCwicGF0aCI6Ii8yMzI2MzE0My8zMDQ3Mjk3MDYtNzQ5NGM5MmQtNWZiOC00MjQ2LTllMWEtMTJjZDA4ZWRmMjFjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwODAyVDE3MTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUxMGVlYmRjNTNkOGEyYmU2NzBjNDUxZGNlMDRmMDc4MDhlZjQ2MjZmYjRjMGI1NzllNzQzNTAzMzM0MDVmMzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.6cBCD05F1mieXRuaKyBuDCm74l_hjZlQDfNmcRd0w2Q)
[![Screenshot 2024-02-14 141435](https://private-user-images.githubusercontent.com/23263143/304729764-f0c30024-f382-405d-8c75-880b9fd385d7.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODU2OTE0ODAsIm5iZiI6MTc4NTY5MTE4MCwicGF0aCI6Ii8yMzI2MzE0My8zMDQ3Mjk3NjQtZjBjMzAwMjQtZjM4Mi00MDVkLThjNzUtODgwYjlmZDM4NWQ3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwODAyVDE3MTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM4NWFlNmNiNDU0Yjg3ZTlmNWZlOWM0ZmMxOWEwODBlYzkyZWI2MmI0YmU5MTMxZTUyYzQzZDFlNmVmMDkxZTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.49isGJMFcZJNvjKkO7R7YBsr5nl676mTJ-YuNJydD1w)](https://private-user-images.githubusercontent.com/23263143/304729764-f0c30024-f382-405d-8c75-880b9fd385d7.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODU2OTE0ODAsIm5iZiI6MTc4NTY5MTE4MCwicGF0aCI6Ii8yMzI2MzE0My8zMDQ3Mjk3NjQtZjBjMzAwMjQtZjM4Mi00MDVkLThjNzUtODgwYjlmZDM4NWQ3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwODAyVDE3MTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM4NWFlNmNiNDU0Yjg3ZTlmNWZlOWM0ZmMxOWEwODBlYzkyZWI2MmI0YmU5MTMxZTUyYzQzZDFlNmVmMDkxZTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.49isGJMFcZJNvjKkO7R7YBsr5nl676mTJ-YuNJydD1w)
In the same file, modules/test/routes/Routes.php, you will see for demonstration purposes how you may handle a large number of URLs with parameters (such as an idProduct) in a very straightforward way.

[![Screenshot 2024-02-14 142531](https://private-user-images.githubusercontent.com/23263143/304733293-d5e155b2-92f8-4034-9fc8-1267efdbbf23.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODU2OTE0ODAsIm5iZiI6MTc4NTY5MTE4MCwicGF0aCI6Ii8yMzI2MzE0My8zMDQ3MzMyOTMtZDVlMTU1YjItOTJmOC00MDM0LTlmYzgtMTI2N2VmZGJiZjIzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwODAyVDE3MTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNhNDZkODZkZmIzYWExMTgwN2NkNjFhZDg2Yjk5M2U0YTEzOGMwZGUwYWNkMWU0NzUxOTdjOTI0ZmQwMDY1MGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.tj6eleByEIpuYXjbCkMmgW3Jb7j1RqfnQhDVMcmPYr0)](https://private-user-images.githubusercontent.com/23263143/304733293-d5e155b2-92f8-4034-9fc8-1267efdbbf23.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODU2OTE0ODAsIm5iZiI6MTc4NTY5MTE4MCwicGF0aCI6Ii8yMzI2MzE0My8zMDQ3MzMyOTMtZDVlMTU1YjItOTJmOC00MDM0LTlmYzgtMTI2N2VmZGJiZjIzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwODAyVDE3MTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNhNDZkODZkZmIzYWExMTgwN2NkNjFhZDg2Yjk5M2U0YTEzOGMwZGUwYWNkMWU0NzUxOTdjOTI0ZmQwMDY1MGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.tj6eleByEIpuYXjbCkMmgW3Jb7j1RqfnQhDVMcmPYr0)

Steps
=====

[](#steps)

- Copy `src/Etc/.env.example` to `src/Etc/.env` — it stays in that folder, which is where `Environment` reads it — and fill in `SITE_PATH`, `DOMAIN_NAME`, and database credentials.
- For mail: configure `src/Modules/Mail/MailController.php` with your SMTP settings (or use `.env` `MAIL_*` keys).
- Make your module in the MVC style (model, view, controller).
- You may or may not wish to utilize BASE MODEL, BASE VIEW and BASE CONTROLLER from `src/Common/Bmvc/`.
- BaseModel contains all of the data required for CRUD OPERATIONS; simply expand it in your module model and you have a CRUD ready-made module; see example module `src/Modules/User/`.
- Make a distinctive namespace for each module under `App\Modules\YourModule`.
- Your module routes should be kept under `src/Modules/YourModule/Routes/Routes.php`.
- `InitModsImproved` (`src/Etc/InitModsImproved.php`) auto-discovers and registers routes — no manual wiring needed.
- After adding new modules, refresh the autoloader:
- `composer dump-autoload`

### You have more than one method of accomplishing things in example modules, upMVC - don't enforce RULES like others do, but respect architecture models MVC, MMVC, and pure PHP and OOP programming rules.

[](#you-have-more-than-one-method-of-accomplishing-things-in-example-modules-upmvc---dont-enforce-rules-like-others-do-but-respect-architecture-models-mvc-mmvc-and-pure-php-and-oop-programming-rules)

The Names Convention
====================

[](#the-names-convention)

Considering recommendations:
----------------------------

[](#considering-recommendations)

- Model, View, Controller - will be called without using module name in their name. For example, module name = books:
- Model.php - class Model; View.php - class View; Controller.php - class Controller;
- and make a distinctive namespace for each module, mirroring its folder - e.g. `namespace App\Modules\Books;`
- Your module routes should be kept under `src/Modules/YourModule/Routes/Routes.php`:
    - `Routes.php` class `Routes` in `src/Modules/Books/Routes/`
    - namespace `App\Modules\Books\Routes`

The optional demo modules (Auth, Mail, Test, React, …) are illustrative only.
-----------------------------------------------------------------------------

[](#the-optional-demo-modules-auth-mail-test-react--are-illustrative-only)

Download them from GitHub Releases when you want show-off code; delete any
--------------------------------------------------------------------------

[](#download-them-from-github-releases-when-you-want-show-off-code-delete-any)

folder under src/Modules/ anytime. Stock create-project ships Welcome only.
---------------------------------------------------------------------------

[](#folder-under-srcmodules-anytime-stock-create-project-ships-welcome-only)

Homepage `/` is set in src/Etc/custom-routes.php — change it to your module.
----------------------------------------------------------------------------

[](#homepage--is-set-in-srcetccustom-routesphp--change-it-to-your-module)

Diagram: [![upMVC-Diagram](https://private-user-images.githubusercontent.com/23263143/283993792-b3d2ff6c-bff5-41c8-9dad-a08d1b7ad6c5.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODU2OTE0ODAsIm5iZiI6MTc4NTY5MTE4MCwicGF0aCI6Ii8yMzI2MzE0My8yODM5OTM3OTItYjNkMmZmNmMtYmZmNS00MWM4LTlkYWQtYTA4ZDFiN2FkNmM1LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwODAyVDE3MTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgyY2UwOTdmNDQ4MDNlMDEyNDUwZTNlYTFhOGZmOGI4MzRiZjQ1NTY3MDdlM2Y0YjIyNDc2MTQwZDNiMGUyNmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRmpwZWcifQ.bEFNB2q2AOnSNJ1Iv3itYDs_szJ8e0aAzT6rgnZmbMg)](https://private-user-images.githubusercontent.com/23263143/283993792-b3d2ff6c-bff5-41c8-9dad-a08d1b7ad6c5.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODU2OTE0ODAsIm5iZiI6MTc4NTY5MTE4MCwicGF0aCI6Ii8yMzI2MzE0My8yODM5OTM3OTItYjNkMmZmNmMtYmZmNS00MWM4LTlkYWQtYTA4ZDFiN2FkNmM1LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwODAyVDE3MTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgyY2UwOTdmNDQ4MDNlMDEyNDUwZTNlYTFhOGZmOGI4MzRiZjQ1NTY3MDdlM2Y0YjIyNDc2MTQwZDNiMGUyNmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRmpwZWcifQ.bEFNB2q2AOnSNJ1Iv3itYDs_szJ8e0aAzT6rgnZmbMg)

File Structure:

[![upMVC-FileStructure ](https://private-user-images.githubusercontent.com/23263143/284536779-b1f92106-476a-45ee-9462-9b562edfe777.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODU2OTE0ODAsIm5iZiI6MTc4NTY5MTE4MCwicGF0aCI6Ii8yMzI2MzE0My8yODQ1MzY3NzktYjFmOTIxMDYtNDc2YS00NWVlLTk0NjItOWI1NjJlZGZlNzc3LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwODAyVDE3MTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIwMzFiMjAxOGUyMDA2MWMyNjQ2MWEzZWZlMDQwNjNlZmQ3OGJiZDkxY2UzOTMwNDQ3MGEzZGRlNDRiODU0MGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRmpwZWcifQ._yUjjwCTpt6gshbmIPBYYNLhFqx2fgEasMKrIlqUsFY)](https://private-user-images.githubusercontent.com/23263143/284536779-b1f92106-476a-45ee-9462-9b562edfe777.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODU2OTE0ODAsIm5iZiI6MTc4NTY5MTE4MCwicGF0aCI6Ii8yMzI2MzE0My8yODQ1MzY3NzktYjFmOTIxMDYtNDc2YS00NWVlLTk0NjItOWI1NjJlZGZlNzc3LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwODAyVDE3MTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIwMzFiMjAxOGUyMDA2MWMyNjQ2MWEzZWZlMDQwNjNlZmQ3OGJiZDkxY2UzOTMwNDQ3MGEzZGRlNDRiODU0MGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRmpwZWcifQ._yUjjwCTpt6gshbmIPBYYNLhFqx2fgEasMKrIlqUsFY)

### "Many noFrameworks may look very appealing at first glance because they seem to reduce web application development to a couple of trivial steps leading to some code generation and often automatic schema detection, but these same shortcuts are likely to be your bottlenecks as well since they achieve this simplicity by sacrifizing flexibility and performance."

[](#many-noframeworks-may-look-very-appealing-at-first-glance-because-they-seem-to-reduce-web-application-development-to-a-couple-of-trivial-steps-leading-to-some-code-generation-and-often-automatic-schema-detection-but-these-same-shortcuts-are-likely-to-be-your-bottlenecks-as-well-since-they-achieve-this-simplicity-by-sacrifizing-flexibility-and-performance)

[All NoFramweworks: "achieve this simplicity by sacrifizing flexibility and performance" Rasmus Lerdorf](https://toys.lerdorf.com/the-no-framework-php-mvc-framework)

upMVC - MMVC, PHP MVC with modules. Modular MVC(Model, View, Controller) derive from Hierarchical Model‐View‐Controller (HMVC).

Introducing MODULAR MVC - Empowering Your Development

In the realm of modern noFrameworks, it often feels like they do everything except what truly matters. These noFrameworks tend to add layers of abstraction that demand you to learn new skills and pathways whenever you decide to switch. They also tend to clutter themselves with superfluous options, solving simple problems in needlessly convoluted ways.

Consider PHP, including its blade templating engine. Why introduce yet another template engine when PHP is already equipped for the task? Delving into a new noFramework often necessitates a substantial relearning effort, pushing you far beyond your existing PHP knowledge.

So, why should you choose MMVC?

MMVC, standing for Modular Model View Controller, is not about reinventing the wheel. Instead, it's about optimizing the use of exceptional components. It offers a structured, straightforward approach, and its versatility proves invaluable for project management and development.

But why MMVC specifically?

1. **Modularity:** MMVC allows you to work on a module without impacting the rest of your project. Modules can be interchanged and integrated seamlessly, enhancing your development agility.
2. **Language Freedom:** Perhaps most importantly, you have the freedom to write your modules in your preferred language, whether it's PHP, JS, PYTHON, or modern technologies like TS, React, Vue, Preact. There are no constraints on your creativity.
3. **Development-Centric:** MMVC was designed with development in mind. You can steer your project in any direction you desire, utilizing your own autoloader or composer autoload. Composer/packagist usage is optional, not obligatory.
4. **"Islands"** of Interactivity: Within this PHP-generated HTML, you strategically place interactive components built with noFrameworks like React, Vue, Preact or Svelte. These components handle dynamic elements, such as user interactions, real-time updates, and animations. Read here: [The Rise of "PHP Islands": A Hybrid Approach to Web Development](https://upmvc.com/Blog/The-Rise-of-%22PHP-Islands%22:-A-Hybrid-Approach-to-Web-Development/#wbb1)

What truly sets MMVC apart is its ability to harness the latest PHP capabilities without constraint. No more endless loops, as this noFramework liberates your development possibilities.

BitsHost Team

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance96

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~36 days

Recently: every ~70 days

Total

9

Last Release

19d ago

Major Versions

v1.4.2 → v2.0.02025-12-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23263143?v=4)[BitsHost](/maintainers/bitshost)[@BitsHost](https://github.com/BitsHost)

---

Top Contributors

[![BitsHost](https://avatars.githubusercontent.com/u/23263143?v=4)](https://github.com/BitsHost "BitsHost (367 commits)")

---

Tags

hmvcisland-architectureislands-architecturejavascript-phpjs-frameworks-phpmmvcphpphp-hmvcphp-islandsphp-islands-architecturephp-mmvcphp-no-frameworkphp-without-a-frameworkphp8purepure-phppurephpreact-phpsvelte-phpvue-php

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bitshost-upmvc/health.svg)

```
[![Health](https://phpackages.com/badges/bitshost-upmvc/health.svg)](https://phpackages.com/packages/bitshost-upmvc)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k39.6k](/packages/matomo-matomo)[getkirby/cms

The Kirby core

1.5k606.6k541](/packages/getkirby-cms)[jelix/jelix

Jelix PHP framework

84118.0k6](/packages/jelix-jelix)[chameleon-system/chameleon-base

The Chameleon System core.

1029.4k6](/packages/chameleon-system-chameleon-base)[doppar/framework

The Doppar Framework

4112.6k14](/packages/doppar-framework)[sproutcms/cms

Enterprise content management and framework

243.0k4](/packages/sproutcms-cms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
