Show HN: Kortex PHP Framework

https://github.com/sameer-manek/kortex

Kortex

A PHP framework which is

  • Simple to use.
  • Fast.
  • Asynchronous and built on top of Swoole.
  • Easy to extend and scale.

I have been a long time Laravel user and while I have always been in awe of it, I regularly feel it is slow. And it is bound to happen with all the features that laravel comes with, and very few other frameworks even come close to being as feature-rich as Laravel while being more performant. But, I need performance for simple web platforms; Hence I thought of building a framework myself, this could be a fun learning experience and perhaps can also help someone else.

Installation

Dependencies

Local

  • PHP 8.x
  • Swoole
  • MySQL
  • [optional] Enable Zend OPcache

External

  • Twig (v3.x) - for rendering views.

once you have the project, just clone this repo, rename it as you will, use data/config.sample.php create a new config.php file in same dir. Run composer installin the root directory and also create a data/logs directory to store logs.

once done, run php index.php to start the framework and off you go.

NOTE To host your application, SSH access to the server will be necessary.

Todo

  • Basic HTTP request handling
  • Extend Swoole\Http\Response
  • Extend Swoole\Http\Request
  • Basic Controllers
  • Basic Routing
  • Middleware support
  • Advanced routing with in-route params
  • Add twig templating engine
  • DB Connection (MySQL. Needs to be optimized)
  • Encryption & Hashing utils
  • HTTP utils (cookie managers, session managers, etc)
  • Socket utils
  • General utils (random number/string generator, and others)
  • Basic logging
  • Testing (PHPUnit)
  • Exceptions
  • Caching (we are using Swoole\Table)
  • Global Configuration
  • Task/Job queue
  • SMTP Util (using Symfony\Mailer)
  • Documentation
  • Security (CSRF)
  • Debug Utils (Debugbar, etc)
{
"by": "sameer-manek",
"descendants": 1,
"id": 40229784,
"kids": [
40229785
],
"score": 6,
"time": 1714599195,
"title": "Show HN: Kortex PHP Framework",
"type": "story",
"url": "https://github.com/sameer-manek/kortex"
}
{
"author": "sameer-manek",
"date": null,
"description": "Simple, fast and asynchronous PHP Framework. Contribute to sameer-manek/kortex development by creating an account on GitHub.",
"image": "https://opengraph.githubassets.com/c01e224059cd2e4feebab84a87ea29fc81bafe0fc185bf8359c9c644a3307afd/sameer-manek/kortex",
"logo": "https://logo.clearbit.com/github.com",
"publisher": "GitHub",
"title": "GitHub - sameer-manek/kortex: Simple, fast and asynchronous PHP Framework",
"url": "https://github.com/sameer-manek/kortex"
}
{
"url": "https://github.com/sameer-manek/kortex",
"title": "GitHub - sameer-manek/kortex: Simple, fast and asynchronous PHP Framework",
"description": "Kortex A PHP framework which is Simple to use. Fast. Asynchronous and built on top of Swoole. Easy to extend and scale. I have been a long time Laravel user and while I have always been in awe of it, I...",
"links": [
"https://github.com/sameer-manek/kortex"
],
"image": "https://opengraph.githubassets.com/c01e224059cd2e4feebab84a87ea29fc81bafe0fc185bf8359c9c644a3307afd/sameer-manek/kortex",
"content": "<div><article><p></p><h2>Kortex</h2><a target=\"_blank\" href=\"https://github.com/sameer-manek/kortex#kortex\"></a><p></p>\n<p>A PHP framework which is</p>\n<ul>\n<li>Simple to use.</li>\n<li>Fast.</li>\n<li>Asynchronous and built on top of Swoole.</li>\n<li>Easy to extend and scale.</li>\n</ul>\n<p>I have been a long time Laravel user and while I have always been in awe of it, I regularly feel it is slow. And it is bound to happen with all the features that laravel comes with, and very few other frameworks even come close to being as feature-rich as Laravel while being more performant. But, I need performance for simple web platforms; Hence I thought of building a framework myself, this could be a fun learning experience and perhaps can also help someone else.</p>\n<p></p><h3>Installation</h3><a target=\"_blank\" href=\"https://github.com/sameer-manek/kortex#installation\"></a><p></p>\n<p><strong>Dependencies</strong></p>\n<p><em>Local</em></p>\n<ul>\n<li>PHP 8.x</li>\n<li>Swoole</li>\n<li>MySQL</li>\n<li>[optional] Enable Zend OPcache</li>\n</ul>\n<p><em>External</em></p>\n<ul>\n<li>Twig (v3.x) - for rendering views.</li>\n</ul>\n<p>once you have the project, just clone this repo, rename it as you will, use <code>data/config.sample.php</code> create a new <code>config.php</code> file in same dir. Run <code>composer install</code>in the root directory and also create a <code>data/logs</code> directory to store logs.</p>\n<p>once done, run <code>php index.php</code> to start the framework and off you go.</p>\n<p><em>NOTE</em> To host your application, SSH access to the server will be necessary.</p>\n<p></p><h3>Todo</h3><a target=\"_blank\" href=\"https://github.com/sameer-manek/kortex#todo\"></a><p></p>\n<ul>\n<li> Basic HTTP request handling</li>\n<li> Extend Swoole\\Http\\Response</li>\n<li> Extend Swoole\\Http\\Request</li>\n<li> Basic Controllers</li>\n<li> Basic Routing</li>\n<li> Middleware support</li>\n<li> Advanced routing with in-route params</li>\n<li> Add twig templating engine</li>\n<li> DB Connection (MySQL. Needs to be optimized)</li>\n<li> Encryption &amp; Hashing utils</li>\n<li> HTTP utils (cookie managers, session managers, etc)</li>\n<li> Socket utils</li>\n<li> General utils (random number/string generator, and others)</li>\n<li> Basic logging</li>\n<li> Testing (PHPUnit)</li>\n<li> Exceptions</li>\n<li> Caching (we are using Swoole\\Table)</li>\n<li> Global Configuration</li>\n<li> Task/Job queue</li>\n<li> SMTP Util (using Symfony\\Mailer)</li>\n<li> Documentation</li>\n<li> Security (CSRF)</li>\n<li> Debug Utils (Debugbar, etc)</li>\n</ul>\n</article></div>",
"author": "",
"favicon": "https://github.githubassets.com/favicons/favicon.svg",
"source": "github.com",
"published": "",
"ttr": 54,
"type": "object"
}