PHPackages                             studiokaizen/skeleton - 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. studiokaizen/skeleton

ActiveProject[Framework](/categories/framework)

studiokaizen/skeleton
=====================

ZenPHP application skeleton

v1.0.3(1mo ago)04MITPHPPHP ^8.4

Since May 26Pushed 1mo agoCompare

[ Source](https://github.com/studiokaizen/skeleton)[ Packagist](https://packagist.org/packages/studiokaizen/skeleton)[ RSS](/packages/studiokaizen-skeleton/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

ZenPHP Skeleton
===============

[](#zenphp-skeleton)

Starter project for [ZenPHP](https://github.com/studiokaizen/framework) — a modern, zero-dependency PHP 8.4 micro-framework.

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

[](#requirements)

- PHP 8.4+
- Composer
- PDO extension (SQLite or MySQL)
- OpenSSL extension

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

[](#installation)

```
composer create-project studiokaizen/skeleton my-app
cd my-app
```

Setup
-----

[](#setup)

**1. Copy the config file and fill in your values:**

```
cp config.example.php config.php
```

Open `config.php` and set your app name, database connection, and any other settings.

**2. Generate an encryption key:**

```
php zen key:generate
```

This writes a secure 32-byte key into `config.php` automatically.

**3. Run migrations:**

```
php zen migrate
```

**4. Point your web server's document root to the `public/` directory.**

For local development with PHP's built-in server:

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

---

Project Structure
-----------------

[](#project-structure)

```
bootstrap/          Application bootstrap (providers, middleware, error handlers)
config.php          Your local configuration (gitignored)
config.example.php  Configuration template to commit
database/
  migrations/       SQL migration files
  seeders/          SQL seeder files
public/
  index.php         Web entry point — define your routes here
  .htaccess         Apache rewrite rules
resources/
  views/            PHP view templates
src/
  Events/           Application events
  Jobs/             Queued jobs
  Providers/        Service providers (AppServiceProvider wired by default)
storage/
  app/              Private file storage
  cache/            File cache
  logs/             Application logs
zen                 CLI entry point

```

---

Defining Routes
---------------

[](#defining-routes)

Open `public/index.php` — it ships with commented examples covering all common patterns. Uncomment and adapt as needed.

```
use Zen\Http\Request;
use Zen\Http\Response;

$app->get('/', function (Request $request, Response $response) use ($app): Response {
    return $app->view('home');
})->middleware('csrf');

$app->get('/users/:id', function (Request $request, Response $response) use ($app): Response {
    $user = $app['db']->table('users')->find((int) $request->getRouteParam('id'));
    return $app->view('users/show', compact('user'));
})->middleware('csrf', 'auth');
```

---

Adding Views
------------

[](#adding-views)

Templates live in `resources/views/` and use plain PHP. Extend `layout.php` using sections:

```
