Skip to content

whleucka/echo

Repository files navigation

Echo PHP Framework

github badge

A modern PHP 8.4+ MVC framework with attribute-based routing, PHP-DI, and Twig. Runs in Docker (PHP 8.4-FPM, Nginx, MariaDB 11, Redis 7).

Work in Progress: APIs and internals may change. This project will eventually serve as a backend to my personal website.

Quick Start

git clone https://github.com/whleucka/echo.git && cd echo
cp .env.example .env                              # configure credentials
docker-compose up -d --build                      # php, nginx, db, redis
./bin/php composer install                        # enter php container
./echo migrate:fresh                              # migrate database
./echo storage:fix                                # fix permissions on storage and cache directories

Open http://localhost.

Development vs Production

Development (default, APP_DEBUG=true):

  • OPcache disabled: code changes take effect instantly, no container restarts
  • Xdebug enabled (port 9003, trigger mode with XDEBUG_SESSION cookie or query param)
  • Verbose errors displayed

Production (docker-compose.prod.yml):

  • OPcache enabled with aggressive caching
  • No Xdebug
  • Errors logged only
# Production deployment
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build

Documentation

Topic Description
Routing Attribute routing, groups, subdomain routing, middleware
Database / ORM Model (CRUD, relationships, aggregates) and QueryBuilder
Admin Modules ModuleController CRUD: tables, forms, JOINs, filters, actions, permissions
Events Event system: creating events/listeners, dispatching, built-in events
Helpers All global helper functions
Email Mailable API, send/queue
Caching Redis and file-based caching
Console All CLI commands
Testing PHPUnit setup and usage

Docker Commands

docker-compose exec -it php bash                   # PHP container
docker-compose exec -it db mariadb -u root -p      # database CLI
docker-compose exec -it redis redis-cli            # Redis CLI

Project Structure

app/                 # Application code (App\ namespace)
  Http/Controllers/  # Route controllers (auto-discovered)
  Models/            # Active Record models
  Events/            # Application events
  Listeners/         # Event listeners
  Helpers/           # Global helper functions
  Services/          # Business logic services
  Providers/         # Service providers
src/Framework/       # Framework internals (Echo\ namespace)
config/              # PHP config files
templates/           # Twig templates
migrations/          # Database migrations
tests/               # PHPUnit tests
docs/                # Documentation
bin/console          # CLI entry point
public/index.php     # Web entry point

Screenshots

image

License

MIT: see LICENSE.

About

Echo is a modern PHP framework for speed, simplicity, and flexibility. Build powerful web applications effortlessly.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors