nixphp/app

Starter app for your project when using NixPHP

Maintainers

Details

github.com/nixphp/app

Source

Issues

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:project

dev-main 2025-05-13 08:50 UTC

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 logic
  • public/ is the webroot
  • bootstrap.php initializes the app
  • config.php holds your app configuration
  • routes.php contains all the routes

🛠️ First Steps

  1. Define your first route in app/routes.php:
route()->add('GET', '/', [App\Controllers\HomeController::class, 'index']);
  1. 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']);
    }
}
  1. 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. 🚀