Skip to content

Why mouse php

drawfig edited this page Aug 4, 2026 · 2 revisions

When introducing a new framework, the first question is inevitably: Why build something new instead of using an established off-the-shelf option?

The short answer is simple: existing frameworks aren't bad, far from it. For developers needing a "kitchen-sink" solution with massive ecosystem support, tools like Laravel and Symfony are unmatched. mouse-php isn't trying to compete in that arena. Instead, it aims to serve a growing niche in the PHP community that monolithic frameworks struggle to address, not because of poor engineering, but because of the specific trade-offs those frameworks deliberately made.

Historically, PHP frameworks have been responsible for everything in a web application. They handled routing, business logic, database queries, and rendering HTML views through templating engines. This monolithic approach was necessary when client machines lacked the power to efficiently handle the DOM, but times have changed. Modern devices are incredibly powerful, driving a shift toward Single Page Applications (SPAs) built with tools like React, Vue, or Angular.

These decoupled frontends now do the heavy lifting of rendering UIs and formatting data for the user. Consequently, the backend's primary job is simply to serve JSON payloads. When tasked with this streamlined role, traditional monolithic frameworks can feel slow and bloated, loading infrastructure that is no longer needed. This bloat leads to the widespread misconception that "PHP is slow and outdated." mouse-php proves this wrong by treating PHP not as the entire stack, but as a highly efficient Data Marshal.

What is a Data Marshal?

A Data Marshal is a backend whose sole job is to receive an API request from the frontend, validate authorization, fetch data from the database, format it into a clean JSON response, and send it back as quickly as possible. As it turns out, PHP is an extremely good match for this role. PHP is synchronous, stateless, and exceptionally fast when stripped of vestigial scaffolding. By removing that overhead, PHP becomes a blisteringly fast API layer, and mouse-php is built to make unlocking that potential effortless.

API-First, Views Second

Because mouse-php is built from the ground up as an API-first framework, it sheds the weight of larger ecosystem alternatives. You have granular control over routing, down to the exact middleware executed per route. This philosophy means treating views as second-class citizens. While mouse-php can handle views (useful for admin panels or health checks), they are not our primary concern. View dependencies are never bootstrapped on API requests. If an engineering choice boosts API performance at the expense of views, we will make that choice every time.

Routing Without the "Magic"

We also achieve superior speed by rethinking routing. Instead of relying on slow Regex to parse complex routes, we use associative arrays. This maximizes speed while making the request lifecycle entirely transparent to developers. This transparency extends to our middleware engine, where groups and exceptions are managed simply by placing a route into an array. You get fine-grained control from start to finish without having to fight the framework or rely on the black-box "magic" found elsewhere in the ecosystem.

Developer Experience with Squeak

While other lightweight PHP frameworks exist, mouse-php sets itself apart by refusing to compromise on Developer Experience (DX). That is why we built Squeak directly into mouse-php. Squeak is an interactive CLI shell designed to manage, bootstrap, and serve your application, complete with hot-reloading for views. It enables developers to go from cloning the repository to running a high-performance backend in under 60 seconds. With Squeak, you get microframework-level speed without sacrificing modern developer conveniences:

  • Instant Scaffolding & Control: Easily manage routes, middleware, and app configuration through intuitive CLI commands.

  • Lean Production Builds: Automated build tooling packages a compact distribution version of your backend, perfect for lightweight Docker containers or CGI environments without dev-tool bloat.

  • Essential Tooling Included: Built-in lightweight PDO wrappers for database access, alongside ready-to-use auth scaffolding and security middleware to protect your API out of the box.

Ready to Build?

mouse-php strips away the bloat of traditional monoliths to give you an ultra-fast, API-first Data Marshal, without forcing you to compromise on Developer Experience. You get raw PHP speed, architectural transparency, and modern tooling designed specifically for decoupled web applications.

Ready to try it out? Head over to our Quick Start Guide and launch your first mouse-php API in under a minute.

Clone this wiki locally