Tereta Framework
Quick Start
Install PHP and Composer for MAC
brew update
brew install [email protected] composer
Install PHP and Composer for Debian (trixie)
sudo apt update
sudo apt install php8.4 php8.4-cli php8.4-curl php8.4-mbstring php8.4-xml composer
Install Tereta/Project skeleton
composer create-project tereta/project .
composer server
php ./cli
Attribute-Driven
Controllers, modules, and DI wiring defined through PHP 8 attributes. No XML, no YAML, no magic.
Schema-Aware ORM
No model definitions needed. The ORM reads your database schema directly and resolves foreign keys automatically.
Modular Architecture
Each module is self-contained with its own controllers, services, DB schemas, and templates. Add or remove without touching the core.
Secure by Default
CSRF protection, secure session handling, and encrypted connections out of the box.
Web & CLI
Single codebase for both HTTP and command-line runtimes. Share services, models, and logic across both entry points.
Theming Engine
SCSS-based theme system with Vite build pipeline. CSS variables for multi-theme support without code changes.
Multistore
Run multiple stores from a single codebase. Domain-aware routing, per-store configuration, themes, and content with shared modules underneath.
How It Works
Define a Controller
#[Controller(alias: 'page')]
class View extends AbstractController
{
public function handle(): Model { ... }
}
Use the ORM
$user = Model::factory()
->create(['table' => 'customer'])
->where('email', $email)
->load();
$orders = $user->foreign('order');