Getting Started

Get up and running with PointArt in minutes. All you need is PHP 8.1+, Apache with mod_rewrite, and the PDO extension for your database driver (pdo_sqlite, pdo_mysql, or pdo_pgsql).

1. Clone and Configure

git clone https://github.com/Cn8001/PointArt.git
cd pointart
cp .env.example .env

Edit .env with your database settings. PointArt supports SQLite, PostgreSQL, and MySQL:

SQLite

DB_DRIVER=sqlite
DB_PATH=./database.sqlite
Recommended for local development SQLite requires no server — just a single file.

PostgreSQL

DB_DRIVER=pgsql
DB_HOST=localhost
DB_PORT=5432
DB_DATABASE=pointart
DB_USERNAME=your_user
DB_PASSWORD=your_password

MySQL

DB_DRIVER=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=pointart
DB_USERNAME=your_user
DB_PASSWORD=your_password
DB_CHARSET=utf8mb4

2. Point Your Web Server

The included .htaccess rewrites all requests to index.php. For Apache, ensure mod_rewrite is enabled. No additional server configuration is needed.

3. Directory Structure

/ ├── index.php # Entry point ├── .htaccess # Rewrites all requests to index.php ├── .env # Your local config (gitignored) ├── .env.example # Config template ├── config.php # Reads .env, returns config array │ ├── framework/ │ ├── attributes/ # PHP Attributes (Route, Router, Service, Wired, …) │ ├── core/ # App, Container, ClassLoader, RouteHandler, Renderer │ └── ORM/ # Model, Repository │ └── app/ ├── components/ # Controllers and Services (auto-scanned) ├── models/ # Model subclasses ├── repositories/ # Repository subclasses └── views/ # Plain .php view files

4. Create Your First Controller

Create a file in app/components/:

<?php
use PointStart\Attributes\Router;
use PointStart\Attributes\Route;
use PointStart\Attributes\HttpMethod;
use PointStart\Core\Renderer;

#[Router(name: 'hello', path: '/hello')]
class HelloController {

    #[Route('/', HttpMethod::GET)]
    public function index(): string {
        return Renderer::render('hello', ['name' => 'World']);
    }
}
?>

Create the view at app/views/hello.php:

<h1>Hello, <?= htmlspecialchars($name) ?>!</h1>

Visit /hello in your browser — that's it.

5. Clear the Cache

PointArt scans app/ on the first request and caches the route registry to cache/registry.ser. Every subsequent request reads from cache — no scanning, no Reflection.

Important If you add a new controller, route, or service and it doesn't appear — clear the cache.
ClassLoader::clearCache();

Or delete cache/registry.ser manually. The cache rebuilds on the next request.

Next Steps