Framework

Starter repository designed to help you leverage Fusio as a professional PHP framework foundation.

Scaffold

Your API configuration as code

Usually you configure operations, actions, schemas and scopes through the Fusio backend. The Framework starter repository turns this around: all configuration lives in files under version control, and your business logic lives in plain PHP classes. This means you can always rebuild a fully configured Fusio instance from your repository.

The deploy command reads the configuration files from resources/ and submits them to the internal REST API, just like the backend would. The project ships with a complete todo resource including CRUD endpoints, events and a cronjob, which you can use as reference implementation for your own resources.

Quick start
# install the dependencies
composer install

# set FUSIO_CONNECTION in .env, then install the tables
php bin/fusio migrations:migrate

# create an administrator and login
php bin/fusio adduser --role=1
php bin/fusio login

# apply resources/* to the instance
php bin/fusio deploy

# try the API without a web server
php bin/fusio serve GET /todo

Why use Fusio as a framework?

Get the full power of an API management platform while keeping the developer workflow you already know from classic PHP frameworks.

Version controlled

Operations, scopes, roles, events and cronjobs are plain YAML and PHP files, so every change is reviewable and reproducible.

Type-safe models

Describe your request and response models with TypeSchema and generate the DTOs and table classes automatically.

Clean architecture

A clear separation between thin actions, views for read requests and services for your business logic.

Database migrations

Manage your schema with Doctrine migrations on MySQL/MariaDB, PostgreSQL or SQLite.

SDK generation

Generate type-safe client SDKs for TypeScript, PHP, Python, Java, Go and C# directly from your API.

Docker ready

Includes a Dockerfile and a GitHub action which builds an image on every push, ready to run on Plant or any Docker platform.

How a resource is built

Every endpoint is made of a few small parts. The included todo resource shows each of them.

  1. 01
    Schema

    The TypeSchema definition of your request and response models in resources/typeschema.json.

  2. 02
    Migration

    A Doctrine migration in src/Migrations which creates the database table.

  3. 03
    Table

    Generated type-safe table classes in src/Table.

  4. 04
    View & Service

    Views build the JSON responses, services contain the business logic and dispatch events.

  5. 05
    Action

    The thin entry point of an operation which calls the view or the service.

  6. 06
    Operation, Scopes & Roles

    The route, HTTP method, models and action, and which users are allowed to call it.

  7. 07
    Deploy

    php bin/fusio deploy applies everything to your instance.

Built for AI-assisted development

The repository ships with Claude Code skills and a CLAUDE.md file which describes the project conventions. Run one of the skills or simply describe what you want, i.e. "add a product resource".

/fusio-setupFirst-time setup of the database, API metadata, admin user and the first deploy
/fusio-resourceAdds a complete REST resource end to end, from schema to deploy
/fusio-migrationCreates or changes tables and regenerates the table classes
/fusio-cronjobAdds a periodic background job
/fusio-deployApplies resources/* to the Fusio instance
/fusio-sdkGenerates a type-safe client SDK
SHA1 872762ea7adb24a64cd010ae6414f787af8b89e0