Getting Started

Installation

Install Glueful with the API skeleton or as a framework package

Glueful has two entry points:

  1. glueful/api-skeleton for most users. This is the recommended path.
  2. glueful/framework if you are embedding the framework into an existing project.

Requirements

  • PHP 8.3+
  • Composer 2+

Create a new project from the starter app:

composer create-project glueful/api-skeleton my-api
cd my-api

The skeleton already includes:

  • a CLI entrypoint at glueful
  • framework bootstrap in bootstrap/app.php
  • example routes in routes/api.php
  • example controller in app/Controllers/WelcomeController.php
  • default SQLite storage in storage/database/glueful.sqlite

First Run

composer install
php glueful install --quiet
php glueful serve

Then verify the starter routes:

curl http://127.0.0.1:8080/welcome
curl http://127.0.0.1:8080/v1/status
curl http://127.0.0.1:8080/health

Alternative: Framework Only

Install the framework package into an existing PHP project:

composer require glueful/framework

Create a minimal bootstrap:

<?php
declare(strict_types=1);

use Glueful\Framework;
use Symfony\Component\HttpFoundation\Request;

require __DIR__ . '/vendor/autoload.php';

$framework = Framework::create(__DIR__)
    ->withConfigDir(__DIR__ . '/config')
    ->withEnvironment($_ENV['APP_ENV'] ?? 'development');

$app = $framework->boot();

$request = Request::createFromGlobals();
$response = $app->handle($request);
$response->send();
$app->terminate($request, $response);

Use this path only if you already know the project structure you want. If not, use the API skeleton.