PHPackages                             mohammadraufzahed/tondbad-swoole - 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. mohammadraufzahed/tondbad-swoole

ActiveLibrary[Framework](/categories/framework)

mohammadraufzahed/tondbad-swoole
================================

Tondbād - A lightweight and high-performance PHP framework built on OpenSwoole with routing, job workers, queue management, and gRPC support.

v0.0.1(1y ago)074MITPHPPHP &gt;=8.2

Since Sep 19Pushed 8mo ago1 watchersCompare

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

READMEChangelogDependencies (7)Versions (2)Used By (0)

TondbadSwoole
=============

[](#tondbadswoole)

**TondbadSwoole** is a high-performance, lightweight PHP framework built on **OpenSwoole** for creating asynchronous web applications, microservices, and gRPC servers. It offers a robust routing system, dependency injection, and support for gRPC, making it an ideal choice for modern PHP applications.

Features
--------

[](#features)

- Asynchronous HTTP Server powered by OpenSwoole.
- FastRoute based routing system with attribute-based route definitions.
- Dependency Injection using a custom container for managing services and configurations.
- gRPC Support for building high-performance microservices.
- Monolog Integration for comprehensive logging to console and files.
- Graceful Shutdown to handle system signals (SIGTERM, SIGINT) and ensure smooth termination.

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- OpenSwoole extension
- Composer

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

[](#installation)

1. **Clone the repository**:

    ```
    git clone https://github.com/yourusername/tondbad-swoole.git
    cd tondbad-swoole
    ```
2. **Install dependencies using Composer**:

    ```
    composer install
    ```
3. **Install OpenSwoole**:

    ```
    pecl install openswoole
    ```
4. **Configure the environment**:

    - Create a `.env` file in the root directory and configure necessary settings. For example:

    ```
    PORT=8000
    APP_ENV=local
    APP_DEBUG=true
    ```

Usage
-----

[](#usage)

### Running the HTTP Server

[](#running-the-http-server)

To start the HTTP server, run the following command:

```
composer server
```

This will start the OpenSwoole server on the configured port (default: `8000`).

### Running the gRPC Server

[](#running-the-grpc-server)

To start the gRPC server, use the command:

```
composer grpc
```

This will start the gRPC server for handling gRPC requests.

Defining Routes
---------------

[](#defining-routes)

Routes can be defined using PHP 8 attributes within your controllers. Here is an example of a route definition using the `#[Endpoint]` attribute:

```
namespace App\Controllers;

use TondbadSwoole\Core\Route\Attributes\Endpoint;
use OpenSwoole\Http\Request;
use OpenSwoole\Http\Response;

class HomeController
{
    #[Endpoint('GET', '/')]
    public function index(Request $request, Response $response)
    {
        $response->end('Welcome to TondbadSwoole!');
    }

    #[Endpoint('POST', '/submit')]
    public function submit(Request $request, Response $response)
    {
        $response->end('Form Submitted!');
    }
}
```

### Registering Routes

[](#registering-routes)

In your configuration file (`config/routes.php`), list the classes containing route definitions:

```
return [
    \App\Controllers\HomeController::class,
    \App\Controllers\UserController::class,
];
```

Logging
-------

[](#logging)

TondbadSwoole uses **Monolog** for logging:

- Logs are written to the console (`php://stdout`) and stored in a file (`logs/app.log`).
- You can configure the logging settings in the `LoggerServiceProvider`.

### Log Levels

[](#log-levels)

The default log level is `DEBUG`, capturing all levels of logs. You can change this level in the logger configuration.

Graceful Shutdown
-----------------

[](#graceful-shutdown)

The server will gracefully shut down on receiving `SIGINT` (`Ctrl+C`) or `SIGTERM` signals, allowing ongoing requests to complete before stopping the server.

Compilation of Protocol Buffers (for gRPC)
------------------------------------------

[](#compilation-of-protocol-buffers-for-grpc)

To compile `.proto` files, run the following command:

```
composer compile-proto
```

This command will generate the necessary PHP files for gRPC communication.

Coming Soon
-----------

[](#coming-soon)

- Background Job Processing: The next version will include support for background job processing using OpenSwoole's TaskWorker, allowing you to handle long-running tasks efficiently in the background.
- Queue Management: Enhanced queue management for dispatching and handling background tasks.

Contributing
------------

[](#contributing)

Feel free to submit issues or pull requests to improve this project. Contributions are welcome!

License
-------

[](#license)

This project is licensed under the MIT License.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance48

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

600d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/76d3cb04b2b53a74ae9ad6fc3d077fbc1faaf9e8526d3b08e67d6c2588b9d94a?d=identicon)[mohammadraufzahed](/maintainers/mohammadraufzahed)

---

Top Contributors

[![mohammadraufzahed](https://avatars.githubusercontent.com/u/24861953?v=4)](https://github.com/mohammadraufzahed "mohammadraufzahed (59 commits)")

---

Tags

frameworkopenswoolephpswooleswoole-frameworkphpframeworkperformanceroutinggRPCqueueopenswoolejob workers

### Embed Badge

![Health badge](/badges/mohammadraufzahed-tondbad-swoole/health.svg)

```
[![Health](https://phpackages.com/badges/mohammadraufzahed-tondbad-swoole/health.svg)](https://phpackages.com/packages/mohammadraufzahed-tondbad-swoole)
```

###  Alternatives

[pecee/simple-router

Simple, fast PHP router that is easy to get integrated and in almost any project. Heavily inspired by the Laravel router.

696214.6k17](/packages/pecee-simple-router)[nimbly/syndicate

A powerful queue and pubsub message publisher and consumer framework.

304.2k](/packages/nimbly-syndicate)

PHPackages © 2026

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