Skip to content

Installation ​

Requirements ​

  • PHP 8.3+
  • Composer
  • SQLite (dev) / PostgreSQL / MySQL / MariaDB (production)
  • Redis (optional — cache and queues)
  • FrankenPHP (optional — recommended for production)

Create a new project ​

bash
composer create-project rbaezc/hexagen-app my-app
cd my-app

This installs the application skeleton: your config/, public/, src/Slices/ and a welcome page. The framework goes in vendor/, so composer update brings new releases.

Adding it to an existing project ​

bash
composer require rbaezc/hexagenphp-framework

Then copy config/, public/index.php and .env.example from the skeleton, and map HexaGen\ to src/ in your composer.json autoload so your slices load.

Configure environment ​

create-project copies .env.example to .env and fills APP_KEY and JWT_SECRET with random values. Open .env to change the rest:

ini
APP_NAME=MyApp
APP_ENV=local
APP_DEBUG=true
APP_URL=http://localhost:8000

DB_DRIVER=sqlite
DB_DATABASE=database/hexagen    # creates database/hexagen.sqlite

APP_KEY signs queue and cache payloads and encrypts encrypted model attributes. To generate a new one:

bash
php -r "echo bin2hex(random_bytes(32));"

Run migrations ​

bash
php hexaphp migrate

The database file is created automatically — no manual setup needed.

Start the server ​

bash
php hexaphp server:start

Open http://localhost:8000 in your browser.

PostgreSQL / MySQL / MariaDB ​

ini
DB_DRIVER=mysql                 # pgsql for PostgreSQL; mysql for MySQL and MariaDB
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=my_app
DB_USER=root
DB_PASSWORD=secret

MariaDB uses the mysql driver (pdo_mysql).

The framework creates the database automatically if it doesn't exist.

Next steps ​

Released under the MIT License.