{"id":29024481,"url":"https://github.com/dconco/phpspa","last_synced_at":"2026-02-06T04:00:47.321Z","repository":{"id":296380808,"uuid":"993171797","full_name":"dconco/phpspa","owner":"dconco","description":"A component-based library for building modern, reactive user interfaces in pure PHP. Inspired by React. ✨","archived":false,"fork":false,"pushed_at":"2026-01-31T21:14:13.000Z","size":4266,"stargazers_count":59,"open_issues_count":0,"forks_count":10,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-31T21:33:57.579Z","etag":null,"topics":["component-library","php","phpspa","react","spa"],"latest_commit_sha":null,"homepage":"https://phpspa.tech","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dconco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security/content-security-policy.md","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},"funding":{"github":["dconco"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"dconco","thanks_dev":null,"custom":null}},"created_at":"2025-05-30T10:37:49.000Z","updated_at":"2026-01-25T19:35:30.000Z","dependencies_parsed_at":"2025-11-30T07:07:20.913Z","dependency_job_id":null,"html_url":"https://github.com/dconco/phpspa","commit_stats":null,"previous_names":["dconco/phpspa"],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/dconco/phpspa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dconco%2Fphpspa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dconco%2Fphpspa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dconco%2Fphpspa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dconco%2Fphpspa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dconco","download_url":"https://codeload.github.com/dconco/phpspa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dconco%2Fphpspa/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29149577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T02:39:25.012Z","status":"ssl_error","status_checked_at":"2026-02-06T02:37:22.784Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["component-library","php","phpspa","react","spa"],"created_at":"2025-06-26T04:01:59.688Z","updated_at":"2026-02-06T04:00:47.294Z","avatar_url":"https://github.com/dconco.png","language":"PHP","funding_links":["https://github.com/sponsors/dconco","https://buymeacoffee.com/dconco"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/dconco/dconco/refs/heads/main/phpspa-icon.jpg\" alt=\"PhpSPA - Component-Based PHP Library\" style=\"width: 100%; max-width: 1200px; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.1); margin-bottom: 1rem;\"\u003e\n\n### _Component-Based PHP Library for Modern Web Applications_\n\n**Build dynamic, interactive web applications using reusable PHP components with state management and SPA-like behavior — no JavaScript frameworks required.**\n\n\u003cbr\u003e\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)](LICENSE)\n[![Documentation](https://img.shields.io/badge/docs-read%20the%20docs-blue.svg?style=for-the-badge)](https://phpspa.tech)\n[![GitHub stars](https://img.shields.io/github/stars/dconco/phpspa?style=for-the-badge\u0026color=yellow)](https://github.com/dconco/phpspa)\n[![PHP Version](https://img.shields.io/packagist/v/dconco/phpspa?style=for-the-badge\u0026color=purple)](https://packagist.org/packages/dconco/phpspa)\n[![Downloads](https://img.shields.io/packagist/dt/dconco/phpspa?style=for-the-badge\u0026color=orange)](https://packagist.org/packages/dconco/phpspa)\n[![PHP Tests](https://github.com/dconco/phpspa/actions/workflows/php-tests.yml/badge.svg)](https://github.com/dconco/phpspa/actions/workflows/php-tests.yml)\n[![PHP Version Require](https://poser.pugx.org/dconco/phpspa/require/php)](https://packagist.org/packages/dconco/phpspa)\n[![Latest Stable Version](https://poser.pugx.org/dconco/phpspa/v)](https://packagist.org/packages/dconco/phpspa)\n[![Code Size](https://img.shields.io/github/languages/code-size/dconco/phpspa?label=Project%20Size)](https://github.com/dconco/phpspa)\n![Lines of Code](https://raw.githubusercontent.com/dconco/phpspa/master/badge/loc.svg)\n![GitHub Language Count](https://img.shields.io/github/languages/count/dconco/phpspa?label=Total%20Languages%20Used)\n\n\u003cbr\u003e\n\n## ✨ **Key Features**\n\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd align=\"center\" width=\"25%\"\u003e\n\t\t\t\u003cstrong\u003e🧩 Components\u003c/strong\u003e\n\t\t\t\u003cbr\u003e\n\t\t\t\u003cem\u003eReusable \u0026 Modular\u003c/em\u003e\n\t\t\t\u003cbr\u003e\n\t\t\tBuild once, use everywhere\n\t\t\u003c/td\u003e\n\t\t\u003ctd align=\"center\" width=\"25%\"\u003e\n\t\t\t\u003cstrong\u003e🧠 State\u003c/strong\u003e\n\t\t\t\u003cbr\u003e\n\t\t\t\u003cem\u003eReactive Updates\u003c/em\u003e\n\t\t\t\u003cbr\u003e\n\t\t\tAuto-sync state changes\n\t\t\u003c/td\u003e\n\t\t\u003ctd align=\"center\" width=\"25%\"\u003e\n\t\t\t\u003cstrong\u003e⚡ Performance\u003c/strong\u003e\n\t\t\t\u003cbr\u003e\n\t\t\t\u003cem\u003eZero Full Reloads\u003c/em\u003e\n\t\t\t\u003cbr\u003e\n\t\t\tSPA-like experience\n\t\t\u003c/td\u003e\n\t\t\u003ctd align=\"center\" width=\"25%\"\u003e\n\t\t\t\u003cstrong\u003e🎯 Simple\u003c/strong\u003e\n\t\t\t\u003cbr\u003e\n\t\t\t\u003cem\u003eMinimal Setup\u003c/em\u003e\n\t\t\t\u003cbr\u003e\n\t\t\tWorks out of the box\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c/div\u003e\n\n---\n\n## 🚀 **Getting Started**\n\n\u003cdiv align=\"center\"\u003e\n\n### 🎯 **Ready to Jump In? Start with our Template!**\n\n_Get up and running in 30 seconds with a complete PhpSPA example_\n\n\u003c/div\u003e\n\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd width=\"50%\" align=\"center\"\u003e\n\t\t\t\u003cstrong\u003e📦 Clone Template\u003c/strong\u003e\u003cbr\u003e\n\t\t\t\u003cem\u003ePre-configured project structure\u003c/em\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd width=\"50%\" align=\"center\"\u003e\n\t\t\t\u003cstrong\u003e⚡ Instant Setup\u003c/strong\u003e\u003cbr\u003e\n\t\t\t\u003cem\u003eDependencies + server ready\u003c/em\u003e\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n**Step 1: Clone the Template**\n\n```bash\ncomposer create-project phpspa/phpspa my-phpspa-app\ncd my-phpspa-app\n```\n\n**Step 3: Start Development Server**\n\n```bash\ncomposer start\n```\n\n\u003cdiv align=\"center\"\u003e\n\n🎉 **That's it!** Your PhpSPA application is now running locally.\n\n**Open your browser and start building amazing components!**\n\n\u003c/div\u003e\n\n---\n\n### 🚀 **Quick Start**\n\nIf you want to set up PhpSPA manually, maybe in an existing project, follow these steps:\n\n#### Install\n\n```bash\ncomposer require dconco/phpspa\n```\n\n#### Namespace\nFirst you need to include the namespace at the beginning of your app.\n\n```php\n\u003c?php\n\nuse PhpSPA\\App;\nuse PhpSPA\\Component;\nuse function Component\\useState;\n\nrequire_once 'vendor/autoload.php';\n```\n\n#### Create Component\n\n```php\nfunction HomePage() {\n\t$counter = useState(\"count\", 0);\n\n\treturn \u003c\u003c\u003cHTML\n\t\t\u003ch1\u003eCounter: {$counter}\u003c/h1\u003e\n\t\t\u003cbutton onclick=\"setState('count', {$counter} + 1)\"\u003e+\u003c/button\u003e\n\t\t\u003cComponent.Link to=\"/about\" children=\"About\" /\u003e\n\tHTML;\n}\n```\n\n#### Setup App\n\n```php\n$app = new App(fn() =\u003e '\u003cdiv id=\"app\"\u003e\u003c/div\u003e');\n\n$app-\u003eattach((new Component('HomePage'))-\u003eroute('/'));\n$app-\u003erun();\n```\n\n---\n\n## ⚡ Native Compression (C++ FFI)\n\nTo enable the fastest HTML/CSS/JS compression, add this to your `php.ini`:\n\n```ini\nffi.enable=true\nextension=ffi\n```\n\nThen add this line to your code:\n\n```php\nuse PhpSPA\\Compression\\Compressor;\n\n$app-\u003ecompression(Compressor::LEVEL_AGGRESSIVE, true)\n```\n\nYou’ll see `X-PhpSPA-Compression-Engine: native` in response headers when active.\n\n---\n\n## 🎨 **What You Get**\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cstrong\u003e🧱 Component Architecture\u003c/strong\u003e\n      \u003cbr\u003e\n      Clean, reusable PHP components\n    \u003c/td\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cstrong\u003e🔄 Reactive State\u003c/strong\u003e\n      \u003cbr\u003e\n      Auto-updating UI with simple state management\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cstrong\u003e🌍 SPA Navigation\u003c/strong\u003e\n      \u003cbr\u003e\n      Smooth page transitions without reloads\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cstrong\u003e🪶 Lightweight\u003c/strong\u003e\n      \u003cbr\u003e\n      PhpSPA is dependency-free, which makes it extra fast\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cstrong\u003e🛡️ SEO Ready\u003c/strong\u003e\n      \u003cbr\u003e\n      Server-rendered for search engines\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cstrong\u003e⚙️ Framework Agnostic\u003c/strong\u003e\n      \u003cbr\u003e\n      Works with any PHP setup\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n---\n\n## 📚 **Learn More**\n\n🔗 **[Complete Documentation](https://phpspa.tech)** — Full tutorials, examples and guides\n\n👉 **[API References](https://phpspa.tech/references)** — Detailed API documentation for all PhpSPA features\n\n📦 **[Packagist](https://packagist.org/packages/dconco/phpspa)** — Installation and versions\n\n---\n\n## 🤝 **Contributing**\n\nWe welcome contributions from the community! Whether you want to add new hooks, fix bugs, or improve documentation, your help is appreciated.\n\n👉 **[Read our Contributing Guide](CONTRIBUTING.md)** to get started\n\n---\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n## ✨ Crafted with Precision By\n\n\u003ca href=\"https://github.com/dconco\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/dconco/dconco/refs/heads/main/profile3.png\" width=\"150\"\u003e\n\u003c/a\u003e\n\n### Dave Conco\n\n_Building modern web applications with the simplicity of PHP_\n\n\u003c!-- This is the interactive badge bar --\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/dconco\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/GitHub-@dconco-181717?style=flat\u0026logo=github\u0026logoColor=white\" alt=\"GitHub\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://twitter.com/dave_conco\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Twitter-@dave_conco-1DA1F2?style=flat\u0026logo=twitter\u0026logoColor=white\" alt=\"Twitter\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"mailto:me@dconco.tech\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Email-Me%21-D14836?style=flat\u0026logo=gmail\u0026logoColor=white\" alt=\"Email\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://dconco.tech\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Website-Portfolio-FF7139?style=flat\u0026logo=Firefox-Browser\u0026logoColor=white\" alt=\"Website\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003c!-- This HR is styled with a gradient to match the picture border --\u003e\n\u003chr style=\"height: 2px; border: none; background: linear-gradient(90deg, transparent, #667eea, #764ba2, transparent); margin: 2rem 0;\"\u003e\n\n**⭐ If you find PhpSPA useful, please give it a star!**\n\n[![MIT License](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](LICENSE)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdconco%2Fphpspa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdconco%2Fphpspa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdconco%2Fphpspa/lists"}