Introduction

Overview, quickstart, project structure, and FAQs

Getting Started with Glueful

Glueful is a modern, enterprise-grade PHP API framework designed for building secure, scalable, and high-performance applications. Built with PHP 8.2+ and leveraging cutting-edge development practices, Glueful provides a comprehensive toolkit for professional API development with minimal configuration overhead.

What is Glueful?

Glueful is a high-performance PHP framework that prioritizes developer productivity while maintaining enterprise-grade features. It's designed specifically for building modern APIs with:

  • Developer-first experience - Interactive setup wizard and powerful CLI tools
  • Enterprise architecture - Production-ready with connection pooling, queues, and advanced caching
  • Security by default - Multi-layered security with CSRF, rate limiting, and secure sessions
  • Performance optimized - Built-in memory management and query optimization
  • API-first design - Automatic OpenAPI/Swagger documentation
  • Extensible - High-performance extension system

When to Use Glueful

Glueful is perfect for:

  • API-first applications - REST APIs, microservices, and backend services
  • Enterprise applications - Applications requiring robust security, performance, and scalability
  • Modern PHP development - Projects leveraging PHP 8.2+ features and modern practices
  • Rapid prototyping - Quick API development with built-in tooling
  • Team collaboration - Standardized structure and comprehensive documentation

Quick Start

Get up and running with Glueful in under 5 minutes using the API skeleton:

Prerequisites

  • PHP 8.2 or higher
  • Composer 2+
  • SQLite (default) or your preferred database

Installation

# Create a new Glueful project from the API skeleton (recommended)
composer create-project glueful/api-skeleton my-api
cd my-api
# Start the development server

Your First Request

Visit your new API:

  • Welcome endpoint: http://127.0.0.1:8080/
  • Health check: http://127.0.0.1:8080/health

Hello World Route

Add a simple route in routes/api.php:

<?php

use Glueful\Http\Response;

// Add to your existing routes
$router->get('/hello', function() {
    return new Response([
        'message' => 'Hello, Glueful!',
        'timestamp' => date('c')
    ]);
});

Project Structure

The API skeleton provides a clean, organized structure:

my-api/
├── app/                    # Application code
│   ├── Controllers/        # HTTP controllers
│   ├── Models/            # Data models
│   └── Services/          # Business logic
├── bootstrap/
│   └── app.php            # Framework bootstrap
├── config/                # Configuration files
│   ├── app.php            # Application config
│   ├── database.php       # Database settings
│   └── ...                # Feature-specific configs
├── database/
│   └── migrations/        # Database migrations
├── public/
│   └── index.php          # HTTP entry point
├── routes/
│   └── api.php            # Route definitions
├── storage/               # Cache, logs, database
│   ├── cache/
│   ├── logs/
│   └── database/
└── tests/                 # Test files

Core Features Overview

Foundation

  • Modern PHP 8.2+ architecture with attributes and typed properties
  • Powerful Dependency Injection container with service providers
  • Advanced routing system with PSR-15 middleware support
  • Request Context architecture eliminating superglobal dependencies

API Development

  • RESTful API endpoints with automatic OpenAPI/Swagger documentation
  • Multi-layer request validation with centralized helpers
  • Standardized error handling with secure production responses
  • Adaptive rate limiting with behavior analysis

Database & Performance

  • Connection pooling with health monitoring
  • Advanced QueryBuilder with JSON support and bulk operations
  • Repository pattern with consistent data access
  • Memory-efficient processing for large datasets

Security & Production

  • Multi-layered security (CSRF, headers, lockdown modes)
  • Permission system with role-based access control
  • Audit logging and security event tracking
  • Production-hardened defaults and monitoring

Developer Experience

  • Interactive CLI with setup wizards and generators
  • Hot-reload development server
  • Comprehensive error pages and debugging tools
  • Built-in profiling and performance monitoring

Next Steps

Now that you have Glueful running:

  1. Installation Guide - Detailed installation and setup
  2. Configuration - Environment setup and config options
  3. Quick Tutorial - Build your first complete API
  4. Core Concepts - Learn the essentials you’ll use daily

FAQ