PHPackages                             rapo/framework - 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. rapo/framework

ActiveLibrary[Framework](/categories/framework)

rapo/framework
==============

A modern, lightweight PHP framework designed to bring the Next.js developer experience to the PHP world.

13PHP

Since Mar 17Pushed 2mo agoCompare

[ Source](https://github.com/OMouta/rapoPHP)[ Packagist](https://packagist.org/packages/rapo/framework)[ RSS](/packages/rapo-framework/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![rapophpbanner](https://private-user-images.githubusercontent.com/79537410/540451408-fdfc2071-7c85-43b7-aade-b81d9cfbe18b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxMzkzMTMsIm5iZiI6MTc3NTEzOTAxMywicGF0aCI6Ii83OTUzNzQxMC81NDA0NTE0MDgtZmRmYzIwNzEtN2M4NS00M2I3LWFhZGUtYjgxZDljZmJlMThiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAyVDE0MTAxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYyY2E4NGE1NmY4OTAyMDg2NDYxYmQ2ZmE1ODAzYTZmZTVjOGM5YjE4YmJlYzU1YmI0ODk4NWExNzFiODhiODYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.RZ074b0DTIRMqIyDC1ENcWdcVnafDU1bRYqvdKEdPas)](https://private-user-images.githubusercontent.com/79537410/540451408-fdfc2071-7c85-43b7-aade-b81d9cfbe18b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxMzkzMTMsIm5iZiI6MTc3NTEzOTAxMywicGF0aCI6Ii83OTUzNzQxMC81NDA0NTE0MDgtZmRmYzIwNzEtN2M4NS00M2I3LWFhZGUtYjgxZDljZmJlMThiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAyVDE0MTAxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYyY2E4NGE1NmY4OTAyMDg2NDYxYmQ2ZmE1ODAzYTZmZTVjOGM5YjE4YmJlYzU1YmI0ODk4NWExNzFiODhiODYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.RZ074b0DTIRMqIyDC1ENcWdcVnafDU1bRYqvdKEdPas)---

RapoPHP is a modern, lightweight PHP framework designed to bring the **Next.js developer experience** to the PHP world. It moves away from traditional MVC patterns in favor of a **component-centric architecture**, file-based routing, and built-in reactivity.

> **⚠️ Warning: RapoPHP is in early development. APIs and features may change significantly and security improvements are ongoing. Use at your own risk.**

Key Modern Features
-------------------

[](#key-modern-features)

### Zero-Config File-based Routing (Next.js App Router Style)

[](#zero-config-file-based-routing-nextjs-app-router-style)

- **Folder-Based URL Segments**: Your directory structure in `src/Pages` directly maps to URLs.
- **Routable Files**: A route is only public if it contains a `Page.php` or `Index.php`. Colocate other files (components, tests) safely.
- **Private Folders**: Prefix folders with `_` (e.g., `_components`) to opt them out of routing.
- **Route Groups**: Wrap folders in `()` (e.g., `(marketing)`) to organize routes without affecting the URL.
- **Dynamic Routes**: Full support for `[slug]` and catch-all `[...slug]` segments.
- **Special Files**: Built-in support for `Layout.php`, `Template.php`, `Error.php`, `NotFound.php`, `Loading.php`, and `Action.php` at any level.
- **Hierarchical Layouts &amp; Middleware**: Layouts and Middleware nest automatically following the folder structure.
- **Server Actions**: Define server-side logic in `Action.php` to handle form submissions directly in your route folder.

### Component-Centric UI

[](#component-centric-ui)

- **Pages as Components**: Forget controllers. A page is just a PHP class extending `Component`.
- **JSX-style PHP**: Use the `h()` helper for a declarative way to build HTML.
- **Functional Hooks**:
    - `useRouter()`: Access routing data and navigation.
    - `useHead()`: Declarative metadata management.
    - `useState()`: Persisted state across requests.
    - `useForm()`: Simplified form handling and validation.
    - `useSession()`: Easy session management.
    - `useCache()`: Access to the built-in caching layer.
- **Nested Layouts**: Intuitively wrap pages with layouts at any level.

### Performance &amp; DX

[](#performance--dx)

- **Rapo-Live**: Livewire-style server-side reactivity for interactive components.
- **Data Fetching**: Built-in `getServerSideProps` for pre-rendering data.
- **ISR &amp; Caching**: Incremental Static Regeneration support for blazing fast load times via the built-in `Cache` service.
- **Modern CLI**: Scaffolding for pages, components, models, middleware, and server actions.
- **Image Optimization**: Built-in `Image` component for lazy-loading and optimization.
- **Mail Engine**: Professional email handling using **Symfony Mailer**, powered by Rapo Components.
- **Context Debugger**: A built-in floating badge in debug mode to inspect component props and route hierarchy.
- **Quality Tools**: Built-in `dd()` and `dump()` helpers via **Symfony Var-Dumper**.

### Modern Data &amp; Auth

[](#modern-data--auth)

- **Active Record ORM**: A fluent way to interact with your database.
- **Automatic Migrations**: Define your schema in models and sync effortlessly.
- **Auth Scaffolding**: Get a full authentication system running in seconds.
- **Storage Abstraction**: Simplified file management with `storage()` helper and `useStorage()` hook.
- **Background Queues**: Handle heavy tasks out-of-process with the SQLite-based `queue()` system.
- **Attribute-based Validation**: Cleanly validate requests using PHP 8 Attributes: `#[Validate(['email' => 'required|email'])]`.

Rapo-Only Unique Features
-------------------------

[](#rapo-only-unique-features)

### Hierarchical i18n

[](#hierarchical-i18n)

Translations that follow your folder structure. Place `translation.php` in any route folder, and use the `useTranslation()` hook. It automatically merges translations from the current page up to the root.

### Automatic Page-to-API Mirroring

[](#automatic-page-to-api-mirroring)

Every page is an API. Request any page with `Accept: application/json` and RapoPHP will return the `props` and `getServerSideProps` data as JSON instead of HTML.

### Markdown-as-Routes

[](#markdown-as-routes)

Create docs effortlessly. Create `Page.md` in any route folder, and RapoPHP will automatically parse and render it.

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

[](#installation)

The recommended way to install RapoPHP is via [Composer](https://getcomposer.org/):

```
composer require rapo/framework
php vendor/bin/rapo project:init
```

CLI Commands
------------

[](#cli-commands)

After initializing your project, you can use the Rapo CLI:

```
# Start the development server
php vendor/bin/rapo serve

# Create a dynamic page: src/Pages/blog/[slug]/Page.php
php vendor/bin/rapo make:page blog/[slug]

# Create a new component
php vendor/bin/rapo make:component Navbar

# Create an API route
php vendor/bin/rapo make:api-route status

# Create a Server Action
php vendor/bin/rapo make:action contact

# Run migrations
php vendor/bin/rapo migrate

# Start queue worker
php vendor/bin/rapo queue:work
```

Advanced Features
-----------------

[](#advanced-features)

### Server Actions &amp; Validation

[](#server-actions--validation)

Handle forms with zero-config using `Action.php` and declarative validation:

```
namespace App\Pages\contact;

use Rapo\Http\Attributes\Validate;

class Action {
    #[Validate(['email' => 'required|email', 'msg' => 'required'])]
    public function handle($request) {
        // Logic here...
        return redirect('/thanks');
    }
}
```

### Background Jobs

[](#background-jobs)

Keep your app fast by offloading heavy tasks:

```
// Dispatch to queue
queue(SendEmailJob::class, ['to' => 'user@example.com']);
```

### Storage

[](#storage)

Easily manage files across different environments:

```
storage()->put('uploads/photo.jpg', $binaryData);
$url = storage()->url('uploads/photo.jpg');
```

---

Built with ❤️ for PHP developers who love modern workflows.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance58

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e480491d9dc7172ee9faa25d8f5c5f80ba659cc01c29f428945f89757f65b53?d=identicon)[omoutaz](/maintainers/omoutaz)

---

Top Contributors

[![OMouta](https://avatars.githubusercontent.com/u/79537410?v=4)](https://github.com/OMouta "OMouta (24 commits)")

---

Tags

phpphp-frameworkphp8

### Embed Badge

![Health badge](/badges/rapo-framework/health.svg)

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

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)

PHPackages © 2026

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