Tereta Framework

A modular, attribute-driven PHP 8.4+ framework built for speed, clarity, and production use.

Quick Start

git clone https://gitlab.com/tereta/framework.git . composer install cp .config.sample.php .config.php php -S localhost:8000 -t pub

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.

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');

Built-In Modules

Application Web & CLI bootstrap
Route Domain-aware routing & request models
Db ORM, schema management, migrations
Di Dependency injection & factories
Customer Auth, registration, Google sign-in
Theme SCSS + Vite rendering engine
Cache Cache services & adapters
Email Transport interfaces & factory
Session Session lifecycle & storage
Security CSRF, headers, encryption
Page Static & dynamic page rendering
Cli Command parsing & output