{"id":34711549,"url":"https://github.com/baremetalphp/baremetalphp","last_synced_at":"2025-12-25T00:01:05.324Z","repository":{"id":328066526,"uuid":"1111369769","full_name":"baremetalphp/BareMetalPHP","owner":"baremetalphp","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-08T21:29:47.000Z","size":30,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-11T12:24:54.367Z","etag":null,"topics":["baremetalphp","framework","php"],"latest_commit_sha":null,"homepage":"https://baremetalphp.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baremetalphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-06T19:56:35.000Z","updated_at":"2025-12-08T23:40:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/baremetalphp/BareMetalPHP","commit_stats":null,"previous_names":["baremetalphp/baremetalphp"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/baremetalphp/BareMetalPHP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baremetalphp%2FBareMetalPHP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baremetalphp%2FBareMetalPHP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baremetalphp%2FBareMetalPHP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baremetalphp%2FBareMetalPHP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baremetalphp","download_url":"https://codeload.github.com/baremetalphp/BareMetalPHP/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baremetalphp%2FBareMetalPHP/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28013340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["baremetalphp","framework","php"],"created_at":"2025-12-25T00:00:57.137Z","updated_at":"2025-12-25T00:01:05.294Z","avatar_url":"https://github.com/baremetalphp.png","language":"PHP","readme":"# 🚀 Bare Metal PHP  \n### A modern PHP framework with a Go-powered application server\n\nBareMetalPHP is a lightweight, high-performance PHP framework designed around a simple idea:\n\n**PHP should run fast by default — without FPM, without heavy stacks, and without hacks.**\n\nInstead of relying on traditional PHP-FPM, BareMetalPHP includes an optional **Go application server** that manages persistent PHP workers. This provides:\n\n- Huge performance gains over cold-start PHP  \n- True parallelism (fast + slow worker pools)  \n- Zero-config hot reload  \n- Static asset offloading  \n- A fast, modern DX similar to Node, Go, or Rust  \n\nIf you want Laravel’s experience but not Laravel’s overhead, this is your framework.\n\n---\n\n## ✨ Key Features\n\n### 🟨 1. Go-Powered App Server (the BareMetal Runtime)\n\nBareMetalPHP includes a Go runtime that functions like a lightweight alternative to Swoole or Laravel Octane:\n\n- Persistent PHP worker pool  \n- Fast + slow request classification  \n- Hot reload for PHP \u0026 routes  \n- Static file serving  \n- Efficient Go→PHP bridge protocol  \n\nEnable it with:\n\n```env\nAPPSERVER_ENABLED=true\n```\n\nStart it with:\n\n```bash\nphp mini go:serve\n```\n\nDry run:\n\n```bash\nphp mini go:serve --dry-run\n```\n\n### 🎯 2. A modern, minimal PHP framework\n\nBareMetalPHP provides:\n- Simple router\n- Controller + method resolution\n- PSR-7-style Request \u0026 Response\n- Lightweight dependency injection container\n- View layer\n- Migrations + SQLite testing utilities\n- `mini` CLI (generators, migrations, test tools)\n\nIt is intentionally small, readable, and fast.\n\n### ✔️ 3. Fully tested\n\nThe framework is covered by a deterministic test suite:\n- Routing, container, HTTP kernel\n- Database + migrations + rollback\n- Go app server installer\n- Go -\u003e PHP worker bridge\n\nRun all tests:\n\n```bash\nvendor/bin/phpunit\n```\n\n### 🧰 Installation\n\nCreate a new BareMetalPHP project:\n\n```bash\ncomposer create-project baremetalphp/baremetalphp my-app\ncd my-app\n```\n\nRun the built-in PHP server:\n\n```bash\nphp mini serve\n```\n\n#### Install the Go application server\n\n```bash\nphp mini go:install\ngo mod tidy\nphp mini go:serve\n```\n\nDefault Go server URL:\n\n```bash\nhttp://localhost:8080\n```\n\n### ⚙️ Configuration `(config/appserver.php)`\n\n```php\nreturn [\n    'enabled'      =\u003e env('APPSERVER_ENABLED', false),\n    'fast_workers' =\u003e (int) env('APPSERVER_FAST_WORKERS', 4),\n    'slow_workers' =\u003e (int) env('APPSERVER_SLOW_WORKERS', 2),\n    'hot_reload'   =\u003e (bool) env('APPSERVER_HOT_RELOAD', true),\n\n    'static' =\u003e [\n        ['prefix' =\u003e '/assets/', 'dir' =\u003e 'public/assets'],\n        ['prefix' =\u003e '/build/',  'dir' =\u003e 'public/build'],\n        ['prefix' =\u003e '/css/',    'dir' =\u003e 'public/css'],\n        ['prefix' =\u003e '/js/',     'dir' =\u003e 'public/js'],\n        ['prefix' =\u003e '/images/', 'dir' =\u003e 'public/images'],\n        ['prefix' =\u003e '/img/',    'dir' =\u003e 'public/img'],\n    ],\n];\n```\n\nThe Go installer generates a matching `go_appserver.json` automatically.\n\n### 🧩 Architecture Overview\n\n```arduino\n                   ┌──────────────────────────────┐\n                   │        Go HTTP Server         │\n                   │  - static files               │\n     Request ─────▶│  - routing fallback           │──────────┐\n                   │  - hot reload watcher         │          │\n                   └──────────────────────────────┘          │\n                                                             ▼\n                                               ┌──────────────────────────┐\n                                               │   PHP Worker Pool        │\n                                               │  (persistent processes)  │\n                                               └──────────────────────────┘\n                                                             │\n                                                             ▼\n                                               ┌──────────────────────────┐\n                                               │ BareMetalPHP Framework  │\n                                               │  - routing               │\n                                               │  - container             │\n                                               │  - controllers           │\n                                               │  - views                 │\n                                               │  - database/migrations   │\n                                               └──────────────────────────┘\n\n```\n\n### 📦 Commands\n\n```bash\nphp mini serve\nphp mini make:controller Foo\nphp mini make:migration create_users\nphp mini migrate\nphp mini migrate:rollback\n\nphp mini install:go-appserver\nphp mini go:serve\nphp mini go:serve --dry-run\n```\n\n### 🔖 Version 0.2.0 Release Notes\n\n- Go application server is now a first-class feature\n- `go:serve` command added\n- `go:install` scaffolding generator added\n- `go_appserver.json` generated from PHP config\n- Persistent PHP worker bridge implemented\n- Better migration rollback logic\n- Higher overall test coverage\n\n### 🛣 Roadmap\n\n- Zero-downtime worker recycling\n- WebSockets via Go\n- Cache subsystem\n- Async jobs via Go sidecar\n- API rate limiting\n- Events + Subscribers\n- Optional queue runner\n\n### 🤝 Contributing\n\nContributions, ideas, and issues are welcome.\n\n### 📄 License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaremetalphp%2Fbaremetalphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaremetalphp%2Fbaremetalphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaremetalphp%2Fbaremetalphp/lists"}