nixphp / app
Starter app for your project when using NixPHP
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=8.3
- nixphp/form: dev-main
- nixphp/framework: dev-main
- nixphp/view: dev-main
This package is auto-updated.
Last update: 2025-05-13 08:50:52 UTC
README
A clean starting point for building applications with NixPHP — the minimal and flexible PHP microframework.
"As simple as possible, as flexible as necessary."
🚀 Installation
composer create-project nixphp/app my-app
Alternatively, clone the repo manually:
git clone https://github.com/nixphp/app my-app
cd my-app
composer install
Make sure your webserver points to the /public
directory as document root.
🧰 Requirements
- PHP 8.3+
- Composer
- A webserver (e.g. Apache, nginx, or PHP’s built-in server)
🗂️ Project Structure
/app
/Controllers
/Models
/views
config.php
routes.php
/public
index.php
bootstrap.php
composer.json
app/
contains your application logicpublic/
is the webrootbootstrap.php
initializes the appconfig.php
holds your app configurationroutes.php
contains all the routes
🛠️ First Steps
- Define your first route in
app/routes.php
:
route()->add('GET', '/', [App\Controllers\HomeController::class, 'index']);
- Create a controller in
app/controllers/HomeController.php
:
namespace App\Controllers; use function NixPHP\render; class HomeController { public function index() { return render('home', ['name' => 'World']); } }
- Create a view in
app/views/home.phtml
:
<?php use function NixPHP\s; ?> <h1>Hello, <?= s($name) ?>!</h1>
📦 About NixPHP
This app skeleton is based on the NixPHP microframework.
It’s designed to give you a clean starting point — nothing more, nothing less.
To learn more about NixPHP and its philosophy, check out the main documentation.
🪪 License
MIT License. See LICENSE for details.
Ready to build something awesome?
Start hacking with NixPHP. 🚀