tereta / project
Project skeleton for the Tereta Framework β bootstraps a new application with core tereta/* packages, CLI and web entry points, Docker dev environment, and a sample configuration.
Requires
- php: >=8.4
- ext-ctype: *
- ext-curl: *
- ext-dom: *
- ext-fileinfo: *
- ext-iconv: *
- ext-mbstring: *
- ext-pdo: *
- tereta/application: ^1.0.3
- tereta/cache: ^1.0.2
- tereta/cli: ^1.0
- tereta/config: ^1.0.3
- tereta/core: ^1.0.5
- tereta/customer: ^1.0
- tereta/db: ^1.0
- tereta/di: ^1.0.1
- tereta/email: ^1.0
- tereta/fs: ^1.0.1
- tereta/logger: ^1.0.2
- tereta/markdown: ^1.0
- tereta/page: ^1.0.2
- tereta/recaptcha: ^1.0.4
- tereta/route: ^1.0.8
- tereta/security: ^1.0.3
- tereta/session: ^1.0
- tereta/support: ^1.0
- tereta/theme: ^1.0.1
- tereta/utilities: ^1.0.4
Requires (Dev)
- phpstan/phpstan: ^2.1.48
- phpunit/phpunit: ^11.5.55
- squizlabs/php_codesniffer: ^3.13.5
- tereta/devtools: ^1.0.3
- wikimedia/composer-merge-plugin: ^2.1.0
This package is not auto-updated.
Last update: 2026-04-17 10:48:18 UTC
README
π Π ΡΡΡΠΊΠΈΠΉ | English
Table of Contents
- Overview
- Quick Start
- Project Structure
- Environment and Requirements
- Tests
- Deploy and Production (CI/CD)
- Author and License
Overview
Modular, attribute-driven PHP framework with web and CLI runtimes. It allows developers to build applications with minimal configuration, leveraging the powerful features of PHP 8.4+ and extending functionality through modules and attributes. Best suited for commercial projects where extensibility, flexibility and cost-effective development matter.
Key responsibilities:
- Bootstrap web and CLI runtime flows
- Load runtime configuration from
.config.php(can be moved outside the web root via require) - Wire core modules (routing, DB, customer, theme, admin packages)
- Provide extension points via module classes and attributes
Quick Start
1. Create a new project from the skeleton:
composer create-project tereta/project .
This bootstraps a fresh project with all tereta/* core packages installed into vendor/, entry points (cli.php, pub/index.php), and a sample configuration.
Alternatively, for framework contributors, clone the monorepo:
git clone https://gitlab.com/tereta/framework.git .
composer install
2. Configure the project:
cp .config.sample.php .config.php
chmod -R 755 var/
Edit .config.php to set database DSN, SMTP credentials, reCAPTCHA keys, etc.
3. Run locally:
php -S localhost:8000 -t pub # without Docker
composer docker:up # with Docker
composer setup performs the full bootstrap in one go (install, Docker up, DB schema refresh, theme install & build):
composer setup
4. Build the theme separately (if needed):
composer theme:install
composer theme:build
5. On macOS with Docker, generate local SSL certificates for dev domains:
composer docker:certificate -- domain.dev domain.com
6. Run tests and static analysis:
composer test
Project Structure
The skeleton is intentionally small β framework modules live in vendor/tereta/* and are installed via Composer. Your application code lives in src/.
.
βββ cli.php # CLI entry point
βββ pub/
β βββ index.php # Web application entry point
β βββ media/ # User-uploaded media (gitignored)
β βββ theme/ # Built theme assets (gitignored)
β βββ site.webmanifest
βββ src/ # Your application code (PSR-4 autoloaded from `/`)
βββ packages/ # Local path-repo packages (optional, gitignored by default)
βββ resources/ # Project resources (pages, templates) β gitignored
βββ theme/ # Theme sources (SCSS, JS) β see tereta/theme
βββ dev/
β βββ docker/ # Docker Compose + tools (certificates, nginx, php-fpm)
β βββ cicd/ # CI/CD helpers
β βββ git/ # Git hooks and scripts
β βββ phpstan/ # PHPStan bootstrap
βββ docs/ # Documentation (RU translation lives here)
βββ var/ # Runtime state: cache, logs (gitignored, must be writable)
βββ vendor/ # Composer dependencies (incl. tereta/* core modules)
βββ .config.sample.php # Configuration template β copy to .config.php
βββ .config.web.php # Web-only overrides
βββ composer.json
βββ README.md
Core framework modules (installed via Composer under vendor/tereta/):
| Package | Responsibility |
|---|---|
tereta/application | Web and CLI runtime bootstrap |
tereta/cache | Caching services and adapters |
tereta/cli | CLI commands, input/output |
tereta/config | Configuration pool |
tereta/core | Shared models, traits, interfaces |
tereta/customer | Auth, registration, account flows |
tereta/db | DB abstraction, models, schemas |
tereta/di | Dependency injection container |
tereta/email | Email transports and factory |
tereta/fs | File and directory utilities |
tereta/logger | Logging channels |
tereta/markdown | Markdown processing |
tereta/page | Page controllers |
tereta/recaptcha | reCAPTCHA validation |
tereta/route | Routing, requests, responses |
tereta/security | CSRF, security headers |
tereta/session | Session management |
tereta/support | Support pages |
tereta/theme | Rendering, theme DI, SCSS build |
tereta/thread | Threads/discussions |
tereta/utilities | Misc helpers |
Environment and Requirements
Required:
- PHP 8.4+
- Extensions:
ctype,dom,iconv,mbstring,pdo,fileinfo,curl - Write access to
var/
Optional:
- Node.js + npm (theme build)
- Docker Compose (local development environment)
- MySQL or PostgreSQL (for DB)
Common issues:
Configuration file not foundβ create.config.phpfrom.config.sample.php- DB connection error β check
pdo.dsnand credentials in.config.php - Static files not loading with built-in server β run with
-t pubexactly as shown above
Tests
Run all checks (PHPCS + PHPStan + PHPUnit):
composer test
Individually:
composer phpcs # Code style (PSR-12)
composer phpstan # Static analysis (level 7)
composer phpunit # Unit tests
Tests are located in:
src/*/*/Tests
packages/*/src/Tests
Deploy and Production
(CI/CD)
CI/CD is configured via GitLab CI (.gitlab-ci.yml). The pipeline includes:
Test stage:
lintβ code style check (PHPCS) and static analysis (PHPStan)unitβ theme build and PHPUnit execution
Deploy stage:
devbranch β automatic deploy to development environmentmainbranch β manual deploy to production
Deploy is performed via SSH. Required CI/CD variables:
SSH_PRIVATE_KEYβ private key (file)SSH_HOST,SSH_PORT,SSH_USERβ connection parametersSSH_DIRECTORYβ project directory on the server
Production checklist:
- PHP 8.4+ on the server
composer install --no-devfor production- Theme built (
composer theme:build) var/writable by the web server
Author and License
Author: Tereta Alexander
Website: tereta.dev
License: Apache License 2.0. See LICENSE.
www.ββββββββββββββββββββββββ βββββββββββββββββ ββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββ
βββ ββββββ ββββββββββββββ βββ ββββββββ
βββ ββββββ ββββββββββββββ βββ ββββββββ
βββ βββββββββββ βββββββββββ βββ βββ βββ
βββ βββββββββββ βββββββββββ βββ βββ βββ
.dev
Copyright (c) 2024-2026 Tereta Alexander