Skip to content

Getting Started

Laureano F. Lamonega edited this page Jul 17, 2026 · 1 revision

Getting Started

Installation

composer create-project antimonial/antimonial my-app
cd my-app

Or add to an existing project:

composer require antimonial/framework

Directory Structure

my-app/
├── public/
│   └── index.php          # Front controller
├── bootstrap/
│   └── app.php            # App instance factory
├── app/
│   ├── Config/
│   │   ├── app.php        # App configuration
│   │   └── database.php   # Database configuration
│   ├── Controllers/       # Your controllers
│   ├── Models/            # Your models
│   ├── Routes/
│   │   └── web.php        # Route definitions
│   └── Views/             # View templates
├── storage/
│   └── views/             # Compiled template cache
├── .env                   # Environment variables
└── composer.json

Entry Point

// public/index.php
<?php
define('ROOT_PATH', __DIR__ . '/..');
require ROOT_PATH . '/vendor/autoload.php';

Antimonial\Core\DotEnv::load(ROOT_PATH . '/.env');
Antimonial\Core\Config::load('app');
Antimonial\Core\Config::load('database');
Antimonial\Core\ErrorHandler::enableDebug((bool) env('APP_DEBUG', false));
Antimonial\View\View::setViewPath(ROOT_PATH . '/app/Views');

$app = require ROOT_PATH . '/bootstrap/app.php';
$app->run();

Configuration

Config files return arrays and are accessed via dot notation:

// app/Config/app.php
return [
    'timezone' => env('APP_TIMEZONE', 'UTC'),
    'session'  => true,  // Enable sessions (optional)
];

// Usage
$tz = config('app.timezone', 'UTC');
// app/Config/database.php
return [
    'default' => 'mysql',
    'connections' => [
        'mysql' => [
            'host'     => env('DB_HOST', '127.0.0.1'),
            'port'     => env('DB_PORT', 3306),
            'database' => env('DB_NAME', 'myapp'),
            'username' => env('DB_USER', 'root'),
            'password' => env('DB_PASS', ''),
        ],
    ],
];

Clone this wiki locally