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
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
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.
ClassLoader::clearCache();
Or delete cache/registry.ser manually. The cache rebuilds on the next request.
Next Steps
- Routing — learn about controllers, routes, and parameter injection
- Dependency Injection — wire up services automatically
- ORM — map classes to database tables
- Repositories — dynamic finders and custom queries