arefshojaei / routex
A minimal PHP framework for base file routing
dev-main
2026-04-09 20:10 UTC
Requires
- php: >7.4
This package is auto-updated.
Last update: 2026-04-10 11:16:03 UTC
README
PHP File based Routing
A lightweight file‑based Routing system inspired by Next.js, built with PHP and structured around the MVC architecture.
Routing patterns
pages/ | ├── index.php → / ├── about.php → /about ├── auth | | │ ├── login.php → /auth/login │ └── register.php → /auth/register | ├── products | | │ ├── index.php → /products │ └── [id].php → /products/:id | ├── admin | | │ └── [id] | | │ └── dashboard.php → /admin/:id/dashboard |
Folder structure (MVC)
Project | ├── app/ │ ├── Controllers/ │ └── Models/ | ├── config/ │ └── app.php │ └── database.php │ ├── pages/ (Views) │ └── index.php │ ├── public/ │ ├── assets/ │ └── index.php │ ├── vendor/ ├── .gitignore ├── composer.json └── README.md
Installation
Composer
composer create-project arefshojaei/routex my-app
Github
git clone https://github.com/ArefShojaei/Routex/Routex.git
How to run the App?
You can use two ways for running such as:
Built-in PHP web-server
php -S [host]:[port] -t public/