PHPackages                             dotari/php-app - 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. dotari/php-app

ActiveProject[Framework](/categories/framework)

dotari/php-app
==============

PHPapp is a lightweight PHP framework designed for quick and efficient web application development. It follows the MVC architecture and provides core components for database interaction, session management, request handling, and more.

1.0.2(10mo ago)151[3 PRs](https://github.com/and-ri/phpapp/pulls)MITPHPPHP ^8.0CI passing

Since Aug 23Pushed 3w ago1 watchersCompare

[ Source](https://github.com/and-ri/phpapp)[ Packagist](https://packagist.org/packages/dotari/php-app)[ RSS](/packages/dotari-php-app/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (9)Dependencies (5)Versions (16)Used By (0)

PHPapp Framework
================

[](#phpapp-framework)

**PHPapp** is a lightweight PHP framework designed for quick and efficient web application development. It follows the MVC (Model-View-Controller) architecture and provides core components for data management, routing, and user interaction.

> [@and-ri](https://github.com/and-ri): Hello everyone! I am very excited to share with you a version of my PHP framework. Maybe it is far from such giants as Laravel or Yii, but it has become very convenient for me. Especially for quick prototyping and small applications.
>
> I will be happy for any contribution :)

Features
--------

[](#features)

- **MVC Architecture:** Clean separation of concerns with models, views, and controllers to organize code logically.
- **Core Components:** Includes essential libraries for handling sessions, database connections, request processing, and URL routing.
- **Secure by Default:** Twig auto-escaping, CSRF tokens, hardened sessions, and strict route validation out of the box.
- **Modern Frontend Build:** Tailwind CSS 4 + daisyUI bundled with Vite, with automatic cache busting.
- **Migration System:** Built-in system for managing database schema changes and versioning.
- **Installer:** Interactive installer for quick setup, including `.env` generation, Composer installation, and database migration execution.
- **Easy to Install and Configure:** Minimal setup required for developers to get started quickly.

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

[](#requirements)

- PHP 8+
- A web server (e.g., Apache, Nginx)
- MySQL
- Node.js 20+ and npm (only for building frontend assets)

Installation
------------

[](#installation)

1. Clone the repository:

    ```
    git clone https://github.com/and-ri/phpapp.git
    ```
2. Navigate to the project directory:

    ```
    cd phpapp
    ```
3. Install dependencies and build frontend assets:

    ```
    composer install
    npm install
    npm run build
    ```
4. Run the installer: Open `http://yourdomain.com/installer.php` in your browser and follow the on-screen instructions to set up the database and configuration.
5. Done! For security, delete `installer.php` from the `www` directory after installation (it refuses to run again while `.env` exists, but removing it entirely is safer).

Frontend Assets
---------------

[](#frontend-assets)

Frontend sources live in `static/css/style.css` and `static/js/app.js` and are bundled by Vite (Tailwind CSS 4 + daisyUI) into `www/assets/`:

```
npm run dev    # rebuild automatically on changes (vite build --watch)
npm run build  # one-off production build
```

Templates reference the built assets through `$this->staticfile->getAssetUri('css/app.css')`, which appends a cache-busting `?v=` parameter. The built files in `www/assets/` are committed to the repository, so remember to run `npm run build` before committing frontend changes.

Templating and Security
-----------------------

[](#templating-and-security)

- Twig **auto-escaping is enabled**: any variable printed with `{{ ... }}` is HTML-escaped. Pass trusted HTML (e.g. output of another controller) through `$this->view->raw($html)` — `Load::controller()` already does this for you.
- Every form should include the CSRF field with `{{ csrf }}` and validate it with `$this->session->validateToken($this->request->post['csrf'])` (see `app/controller/catalog/csrf_protection.php` for a complete example).
- Request data (`$this->request->get/post/cookie`) is raw. Escape at the output layer: Twig handles HTML, and use `$this->db->escape()` or `$this->db->execute($sql, $params)` (prepared statements) for SQL.

Core Components
---------------

[](#core-components)

### Classes

[](#classes)

- **controller.php**: Handles application logic, loading views and models.
- **model.php**: Manages database interactions and data-related operations.
- **view.php**: Renders views and passes data to the user interface.

### Libraries

[](#libraries)

- **app.php**: Manages the application lifecycle, including initialization and configuration.
- **cache.php**: Simple file-based cache with optional TTL (`get`, `set`, `delete`, `deleteAll`).
- **db.php**: Provides methods for database queries and connection handling, including prepared statements via `execute()`.
- **env.php**: Handles environment variables and configuration settings.
- **flash.php**: One-time session messages for the POST -&gt; redirect -&gt; GET pattern.
- **google\_auth.php**: Handles the Google authentication process for the application.
- **language.php**: Loads and manages language files for multi-language support.
- **load.php**: Loads models and controllers dynamically.
- **mail.php**: Sends email via SMTP or PHP `mail()` using PHPMailer (configured through `.env`).
- **pagination.php**: Provides simple pagination functionality.
- **request.php**: Handles incoming HTTP requests.
- **response.php**: Manages HTTP responses and headers.
- **session.php**: Facilitates session management (start, get, set, remove, etc.) and CSRF tokens.
- **staticfile.php**: Serves static files (CSS, JS, images) and generates cache-busted URIs for built assets.
- **upload.php**: Stores uploaded files safely (finfo MIME check, extension allowlist, random names).
- **url.php**: Generates URLs and manages routing.
- **validator.php**: Rule-based input validation (`required|email|min:8|...`) with per-field error messages.
- **log.php**: Provides centralized logging functionality using Monolog.
- **meta.php**: Manages SEO metadata including page titles, descriptions, Open Graph tags, and robots directives using the Melbahja/Seo package.

Migrations
----------

[](#migrations)

Create a migration by copying `migrations/template.php` to a new file (e.g. `migrations/2026_07_04_create_users.php`). A migration returns an anonymous class with `up()` and `down()` methods:

```
return new class {
    public function up($db) {
        $db->query("CREATE TABLE ...");
    }

    public function down($db) {
        $db->query("DROP TABLE ...");
    }
};
```

Then run:

```
php migrate.php migrate   # apply pending migrations
php migrate.php rollback  # undo the last migration
php migrate.php status    # show applied and pending migrations
```

License
-------

[](#license)

This project is licensed under the MIT License.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance77

Regular maintenance activity

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.1% 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 ~42 days

Total

11

Last Release

301d ago

Major Versions

0.1.5 → 1.0.02025-05-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/51118083?v=4)[Andrew](/maintainers/and-ri)[@and-ri](https://github.com/and-ri)

---

Top Contributors

[![and-ri](https://avatars.githubusercontent.com/u/51118083?v=4)](https://github.com/and-ri "and-ri (105 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![pnb-web-dev](https://avatars.githubusercontent.com/u/193879102?v=4)](https://github.com/pnb-web-dev "pnb-web-dev (1 commits)")

---

Tags

phpframeworkmvclightweightweb-development

### Embed Badge

![Health badge](/badges/dotari-php-app/health.svg)

```
[![Health](https://phpackages.com/badges/dotari-php-app/health.svg)](https://phpackages.com/packages/dotari-php-app)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.9k556.2M21.5k](/packages/laravel-framework)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k39.6k](/packages/matomo-matomo)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

86337.5k](/packages/flow-php-flow)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M672](/packages/shopware-core)

PHPackages © 2026

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