PHPackages                             webpagestudio/wps-micro - 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. webpagestudio/wps-micro

ActiveLibrary[Framework](/categories/framework)

webpagestudio/wps-micro
=======================

Lightweight PHP framework for building web applications

v3.0.0(3w ago)8221MITPHPPHP ^8.3CI passing

Since Dec 31Pushed 3w ago1 watchersCompare

[ Source](https://github.com/Victor8730/Wps-Micro)[ Packagist](https://packagist.org/packages/webpagestudio/wps-micro)[ RSS](/packages/webpagestudio-wps-micro/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (9)Versions (8)Used By (1)

WPS Micro
=========

[](#wps-micro)

Lightweight PHP framework core for building focused web applications.

WPS Micro provides the reusable request lifecycle, container, routing, middleware, validation, sessions, Twig integration, database access, migrations, and console primitives. Application controllers, models, routes, views, frontend assets, and deployment files live in a separate application skeleton.

Requirements
------------

[](#requirements)

- PHP 8.3 or higher
- Composer
- PDO and mbstring PHP extensions

The test suite runs against PHP 8.3, 8.4, and 8.5 in GitHub Actions.

Start A New Application
-----------------------

[](#start-a-new-application)

Use the application skeleton instead of installing the framework into an empty directory:

```
composer create-project webpagestudio/wps-micro-skeleton my-site
```

The skeleton requires this package and keeps application code outside `vendor/`. Framework updates therefore do not replace controllers, models, routes, migrations, or templates:

```
composer update webpagestudio/wps-micro
```

For an existing Composer project, install only the core:

```
composer require webpagestudio/wps-micro
```

Package Structure
-----------------

[](#package-structure)

- `src` - framework runtime and public APIs
- `src/Console` - console application and reusable commands
- `src/Exceptions` - framework and HTTP exceptions
- `src/Middleware` - built-in middleware
- `tests` - framework unit and integration tests

All framework classes use the `WpsMicro\Core\` namespace.

Application Boundary
--------------------

[](#application-boundary)

The framework package owns infrastructure:

- `Request`, `Response`, `Router`, and `Dispatcher`
- `Container` and `Kernel`
- middleware pipeline and CSRF protection
- validation, sessions, and error handling
- Twig rendering and Vite manifest integration
- PDO connection, models, migrations, and migrator
- console application and generator commands

The application owns product behavior:

- controllers and application middleware
- models, repositories, and business services
- routes and configuration
- database migrations
- Twig templates and frontend assets
- public entry point and deployment configuration

Core classes never import `App\` classes or assume an application directory. The application passes routes, middleware, paths, and error handlers through configuration.

Request Lifecycle
-----------------

[](#request-lifecycle)

```
Request -> Global Middleware -> Router -> Route Middleware -> Controller -> Response

```

The `Kernel` registers framework services in the PSR-11 container. The `Dispatcher` executes the middleware pipeline, resolves a controller through the container, invokes the matched action, and normalizes the result to a `Response`.

Bootstrap
---------

[](#bootstrap)

A minimal application bootstrap can load environment values and create a kernel from a PHP configuration file:

```
