https://github.com/codemonster-ru/ssr-bridge
A universal PHP bridge for interacting with Node.js SSR services (locally or via HTTP)
https://github.com/codemonster-ru/ssr-bridge
annabel bridge framework-integration frontend-integration integration laravel nodejs php react react-ssr server-side-rendering solid solid-ssr ssr svelte svelte-ssr symfony vue vue-ssr
Last synced: 3 months ago
JSON representation
A universal PHP bridge for interacting with Node.js SSR services (locally or via HTTP)
- Host: GitHub
- URL: https://github.com/codemonster-ru/ssr-bridge
- Owner: codemonster-ru
- License: mit
- Created: 2025-09-23T11:53:50.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-09-23T12:46:47.000Z (4 months ago)
- Last Synced: 2025-09-23T14:44:35.361Z (4 months ago)
- Topics: annabel, bridge, framework-integration, frontend-integration, integration, laravel, nodejs, php, react, react-ssr, server-side-rendering, solid, solid-ssr, ssr, svelte, svelte-ssr, symfony, vue, vue-ssr
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# SSR Bridge
[](https://packagist.org/packages/codemonster-ru/ssr-bridge)
[](https://packagist.org/packages/codemonster-ru/ssr-bridge)
[](https://packagist.org/packages/codemonster-ru/ssr-bridge)
[](https://github.com/codemonster-ru/ssr-bridge/actions/workflows/tests.yml)
A universal PHP bridge for interacting with **Node.js SSR services**.
## ๐ฆ Installation
```bash
composer require codemonster-ru/ssr-bridge
```
## ๐ Usage
```php
use Codemonster\Ssr\SsrBridge;
// Local mode (Node.js runs directly)
$bridge = new SsrBridge('local', null, __DIR__.'/../node_modules/ssr-service/dist/ssr.js');
$html = $bridge->render('Home', ['message' => 'Hello']);
// HTTP mode (connecting to the remote SSR API)
$bridge = new SsrBridge('http', 'http://127.0.0.1:3000');
$html = $bridge->render('Home', ['message' => 'Hello']);
```
## โจ Features
- Local SSR execution via the `node` process
- Connection to a remote HTTP SSR server API
- Easy integration into any PHP project (Laravel, Symfony, Annabel, etc.)
## ๐งช Testing
You can run tests with the command:
```bash
composer test
```
## ๐จโ๐ป Author
[**Kirill Kolesnikov**](https://github.com/KolesnikovKirill)
## ๐ License
[MIT](https://github.com/codemonster-ru/ssr-bridge/blob/main/LICENSE)