PHPackages                             nabeelalihashmi/nthphp - 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. nabeelalihashmi/nthphp

ActiveProject[Framework](/categories/framework)

nabeelalihashmi/nthphp
======================

A fast, optimized PHP framework to make own framework with PHP attributes, automatic routing of Blade views.

v1(1y ago)15MITPHPPHP ^8.1

Since Jan 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/nabeelalihashmi/NthPHP)[ Packagist](https://packagist.org/packages/nabeelalihashmi/nthphp)[ RSS](/packages/nabeelalihashmi-nthphp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (9)Versions (2)Used By (0)

NthPHP Framework
================

[](#nthphp-framework)

NthPHP is a fast, optimized PHP framework designed to speed up and simplify web development using automatic routing and providing great developer experience. Not only it can run in a traditional PHP environment with **Apache**, **Nginx**, **LiteSpeed**, or any other similar web server, but also it provides high performance, leveraging **Swoole** for asynchronous, coroutine-based processing, allowing your application to handle thousands of requests concurrently without requiring any changes in code.

[![](public/logo.png)](public/logo.png)

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

[](#installation)

Download this repo or clone this repo or run following command:

```
composer create-project nabeelalihashmi/nthphp app_name

```

Screenshots
-----------

[](#screenshots)

[![](screenshots/1.png)](screenshots/1.png)[![](screenshots/2.png)](screenshots/2.png)[![](screenshots/3.png)](screenshots/3.png)

Built around a clean and minimal architecture, NthPHP uses PHP attributes for routing, automatic routing for Blade views, a flexible Blade templating engine for views, and a powerful ORM (RedBeanPHP) for database access. With built-in support for middleware and an easy-to-use configuration system, it simplifies common tasks like request handling, email sending, and validation.

Key Features
------------

[](#key-features)

- **Fast &amp; Optimized**: NthPHP is built for speed, providing an efficient routing system and optimized performance.
- **PHP Attributes for Routing**: Routes are defined using PHP attributes, allowing for a clean, modern approach to routing.
- **Automatic Routing**: Routes are automatically collected from controllers, reducing the need for manual route registration.
- **Blade Templating**: Uses **BladeOne** as the templating engine, with automatic routes generation from views stored in a specific folder (`/app/Views/_pages`).
- **RedBeanPHP**: Uses **RedBeanPHP** for database interactions. No need for models, but models can be used if desired.
- **Swoole Integration**: NthPHP can utilize **Swoole** for asynchronous, coroutine-based performance, dramatically improving scalability and handling of concurrent requests. It can run in **Swoole** for better performance without changing the core code base.
- **Compatibility with Apache/Nginx/LiteSpeed**: NthPHP is fully compatible with traditional web servers like **Apache**, **Nginx**, and **LiteSpeed**. Whether you deploy on **Swoole** for concurrency and performance boosts or use a traditional web server, the same code works seamlessly across all environments, making the framework extremely flexible.

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

[](#configuration)

The configuration is stored in `app/config.php` and includes settings for routing, controllers, views, server config etc. NthPHP provides a class `Config` to read the config with dot notation, with `Config::get` method to read the configuration.

```
    $baseUrl = Config::get('app.base_url');

```

### Automatic Views Directory

[](#automatic-views-directory)

The framework uses **Blade** templating with the default directory for views located at `/app/Views`.

In routing, if `automatic_routes` have value other than `false`, e.g,

```
    'automatic_routes' => ['_pages', '_other_dir_in_views' ]

```

then blade view files in `/app/Views/_pages` and `_other_dir_in_views`, are considered as routes.

Manual Routes
-------------

[](#manual-routes)

It is possible to define own routes in `app/Routes` directory. A php file here, must return an array of route arrays. A route array has following keys:

-**method**
-**path**
-**handler**
-**middleware**

Check demo files for example.

If file name is root.php, then routes of that and mounted with group. For other name, such as `demos.php`, any route define in it will automatically prepend `demos` in routes.

Documentation
-------------

[](#documentation)

- **Blade**: [Laravel Blade Documentation](https://laravel.com/docs/8.x/blade)
- **BladeOne**: [BladeOne GitHub Repository](https://github.com/EFTEC/BladeOne)
- **RedBeanPHP**: [RedBeanPHP Documentation](https://redbeanphp.com/)

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

[](#installation-1)

1. Clone the repository or download the framework.
2. Run `composer install` to install the required dependencies.
3. Configure your database and other settings as needed.
4. Start developing your application by creating controllers and views.

Usage
-----

[](#usage)

1. Define routes in your controllers using PHP attributes.

```
#[Route(method, uri, middleware)]

#[Route(['GET', 'POST'], '/user/{name}', [AuthMiddleware::class])]

```

2. Views in `app/views/_pages` are automatically rendered based on routes, with Blade templating.
3. Database interactions can be handled using **RedBeanPHP**, with or without models.
4. The framework can run on **Swoole**, **Apache**, **Nginx**, **LiteSpeed**, or any other similar server environment without any changes to your code.

```
php server.php

```

Caching
-------

[](#caching)

Please note that when routes are changed, and caching is set to true in the config, please delete `cache/routes/collector.cache` and `cache/routes/routes.cache` files.

Developer
---------

[](#developer)

This framework is developed by **Nabeel Ali**. You can connect with the developer on LinkedIn:

- [Nabeel Ali](https://linkedin.com/in/nabeelalihashmi)
- Co-Founder and Creator of Aliveforms
- Founder and Creator Quizrella

---

This is just the beginning. NthPHP is a work in progress and continuously evolving.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance46

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

Unknown

Total

1

Last Release

465d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/449341cf2d2c255eeaa52f06da4293fdcf2f407b10984846b6c130418c7b4eab?d=identicon)[nabeelalihashmi](/maintainers/nabeelalihashmi)

---

Top Contributors

[![nabeelalihashmi](https://avatars.githubusercontent.com/u/14184842?v=4)](https://github.com/nabeelalihashmi "nabeelalihashmi (28 commits)")

---

Tags

phpphp-frameworkphp-routingphp-routing-libraryskeletonphpframeworkroutingblademvcfastoptimized

### Embed Badge

![Health badge](/badges/nabeelalihashmi-nthphp/health.svg)

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

PHPackages © 2026

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