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

ActiveProject

preflow/skeleton
================

Preflow project skeleton

v0.13.1(1mo ago)017MITPHPPHP &gt;=8.4

Since Apr 10Pushed 1mo agoCompare

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

READMEChangelogDependencies (13)Versions (32)Used By (0)

Preflow Skeleton
================

[](#preflow-skeleton)

Starter template for [Preflow](https://github.com/getpreflow/preflow) applications.

Quick Start
-----------

[](#quick-start)

```
composer create-project preflow/skeleton myapp
cd myapp
php preflow serve
```

Open . That's it — the installer handles `.env`, database, and demo content automatically.

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

[](#project-structure)

```
app/
├── Components/    Reusable UI components (PHP + template + CSS/JS)
├── Controllers/   API and form controllers (#[Route] attributes)
├── Models/        Data models (#[Entity] attributes)
├── Providers/     Service providers
├── Seeds/         Demo data seeders
└── pages/         File-based routes (Twig templates)
config/            Framework configuration
lang/              Translation files (en/, de/)
migrations/        Database schema
public/            Web root (index.php, .htaccess)
storage/           SQLite database, cache, logs
tests/             PHPUnit tests

```

What's Included
---------------

[](#whats-included)

### Routing

[](#routing)

File-based routes in `app/pages/` map to URLs by directory structure. Dynamic segments use brackets: `blog/[slug].twig` matches `/blog/hello-world`.

Controllers use PHP attributes:

```
#[Route('/api')]
final class HealthController
{
    #[Get('/health')]
    public function health(ServerRequestInterface $request): ResponseInterface
    {
        return new Response(200, ['Content-Type' => 'application/json'],
            json_encode(['status' => 'ok']));
    }
}
```

### Components

[](#components)

A component is a PHP class + Twig template + inline CSS/JS in one directory. Drop it in `app/Components/`, it auto-discovers.

```
final class ExampleCard extends Component
{
    public string $title = '';
    public int $count = 0;

    public function __construct(private readonly SessionInterface $session) {}

    public function resolveState(): void
    {
        $this->title = $this->props['title'] ?? 'Hello';
        $this->count = (int) $this->session->get('example_counter', 0);
    }

    public function actions(): array { return ['increment']; }

    public function actionIncrement(array $params = []): void
    {
        $this->count = (int) $this->session->get('example_counter', 0) + 1;
        $this->session->set('example_counter', $this->count);
    }
}
```

Use in templates: `{{ component('ExampleCard', { title: 'Hello' }) }}`

### Authentication

[](#authentication)

Login, registration, and logout are included. Protect routes with middleware:

```
#[Route('/dashboard')]
#[Middleware(AuthMiddleware::class)]
final class DashboardController { /* ... */ }
```

Templates can check auth status:

```
{% if auth_check() %}
    Welcome, {{ auth_user().email }}
{% endif %}
```

### Blog Admin

[](#blog-admin)

The skeleton includes a full blog admin at `/admin` (requires login). Create, edit, and delete posts through a form-based interface.

Default admin credentials:

- **Email:**
- **Password:** password

The admin demonstrates the hybrid pattern: `PostForm` component handles form UI with co-located CSS, `BlogAdminController` handles CRUD logic with redirects and flash messages.

### Internationalization

[](#internationalization)

Translations live in `lang/{locale}/{group}.php`. Switch languages with the locale switcher in the header, or visit `/de/...` for German.

```
{{ t('blog.title') }}
{{ t('blog.published', { date: '2026-01-01' }) }}
{{ t('blog.post_count', {}, 5) }}
```

### Data Layer

[](#data-layer)

Models use PHP attributes for storage mapping:

```
#[Entity(table: 'posts', storage: 'default')]
final class Post extends Model
{
    #[Id] public string $uuid = '';
    #[Field(searchable: true)] public string $title = '';
    #[Field] public string $status = 'draft';
}
```

Query with the DataManager:

```
$posts = $dm->query(Post::class)
    ->where('status', 'published')
    ->orderBy('uuid', SortDirection::Desc)
    ->get();
```

### HTMX

[](#htmx)

Components can define actions that handle HTMX requests. The ExampleCard counter persists in the session across page reloads — no JavaScript needed.

### Asset helpers

[](#asset-helpers)

`AppServiceProvider` registers `asset_url()` and `img_url()` template functions. Both resolve paths relative to the `public/` directory.

```

```

`img_url()` is a convenience wrapper that prepends `images/` automatically. Both functions are commented-out examples in `AppServiceProvider` — uncomment and adjust the base path for your deployment.

Configuration
-------------

[](#configuration)

FilePurpose`config/app.php`App name, debug level, timezone, locale, template engine`config/auth.php`Guards, user providers, session settings`config/data.php`Storage drivers (SQLite, JSON, MySQL)`config/i18n.php`Available locales, fallback, URL strategy`config/providers.php`Service provider registration`.env`Environment-specific overridesCLI Commands
------------

[](#cli-commands)

```
php preflow serve           # Start dev server (localhost:8080)
php preflow migrate         # Run pending migrations
php preflow db:seed         # Seed demo data
php preflow key:generate    # Generate APP_KEY
php preflow routes:list     # List all routes
php preflow cache:clear     # Clear cache
```

Web Server
----------

[](#web-server)

**Development:** `php preflow serve` — no configuration needed.

**Apache:** Point your document root to the `public/` directory. The included `.htaccess` handles URL rewriting. Ensure `mod_rewrite` is enabled.

**Nginx:**

```
server {
    listen 80;
    server_name myapp.test;
    root /path/to/myapp/public;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }
}
```

Testing
-------

[](#testing)

```
./vendor/bin/phpunit
```

Tests live in `tests/`. The skeleton includes example tests for components and routing.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance89

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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 ~0 days

Total

31

Last Release

56d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d8b54efbc79683c32645e3fa8d3590037fa003963a16e0ed989104c6f4a2723?d=identicon)[smyr](/maintainers/smyr)

---

Top Contributors

[![smeyerme](https://avatars.githubusercontent.com/u/1925560?v=4)](https://github.com/smeyerme "smeyerme (43 commits)")

### Embed Badge

![Health badge](/badges/preflow-skeleton/health.svg)

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

###  Alternatives

[getgrav/grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS

15.5k85.4k1](/packages/getgrav-grav)[aimeos/aimeos-typo3

Professional, full-featured and high performance TYPO3 e-commerce extension for online shops and complex B2B projects

1.5k92.9k5](/packages/aimeos-aimeos-typo3)[moonshine/moonshine

Laravel administration panel

1.3k239.9k72](/packages/moonshine-moonshine)[simplesamlphp/saml2

SAML2 PHP library from SimpleSAMLphp

30417.8M41](/packages/simplesamlphp-saml2)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73147.2k29](/packages/jaxon-php-jaxon-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M506](/packages/shopware-core)

PHPackages © 2026

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