{"id":34998031,"url":"https://github.com/codemonster-ru/ssr-service","last_synced_at":"2026-04-14T05:31:50.203Z","repository":{"id":316112870,"uuid":"1056734885","full_name":"codemonster-ru/ssr-service","owner":"codemonster-ru","description":"Universal SSR engine and CLI with Vite integration for modern JavaScript frameworks","archived":false,"fork":false,"pushed_at":"2025-09-25T20:23:30.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-25T22:30:41.703Z","etag":null,"topics":["cli","express","javascript","nodejs","react","server-side-rendering","ssr","typescript","universal","vite","vue"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/codemonster-ru.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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-09-14T17:41:51.000Z","updated_at":"2025-09-25T20:23:33.000Z","dependencies_parsed_at":"2025-09-25T22:36:08.606Z","dependency_job_id":null,"html_url":"https://github.com/codemonster-ru/ssr-service","commit_stats":null,"previous_names":["codemonster-ru/ssr","codemonster-ru/ssr-service"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/codemonster-ru/ssr-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonster-ru%2Fssr-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonster-ru%2Fssr-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonster-ru%2Fssr-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonster-ru%2Fssr-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemonster-ru","download_url":"https://codeload.github.com/codemonster-ru/ssr-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonster-ru%2Fssr-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31784251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: 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":["cli","express","javascript","nodejs","react","server-side-rendering","ssr","typescript","universal","vite","vue"],"created_at":"2025-12-27T02:53:58.629Z","updated_at":"2026-04-14T05:31:50.198Z","avatar_url":"https://github.com/codemonster-ru.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @codemonster-ru/ssr-service\n\n[![npm\nversion](https://img.shields.io/npm/v/@codemonster-ru/ssr-service.svg?style=flat-square)](https://www.npmjs.com/package/@codemonster-ru/ssr-service)\n[![Tests](https://github.com/codemonster-ru/ssr/actions/workflows/tests.yml/badge.svg)](https://github.com/codemonster-ru/ssr/actions)\n[![License](https://img.shields.io/npm/l/@codemonster-ru/ssr-service.svg?style=flat-square)](LICENSE)\n\n🚀 A universal SSR service for [Annabel Framework](https://github.com/codemonster-ru/annabel) **and standalone use**.\n\nAllows you to render Vue (and potentially React, Svelte, Solid, etc.) components on the server (Server-Side Rendering) and use them in PHP applications via SSR Bridge or as a separate Node.js SSR service.\n\n## ✨ Possibilities\n\n-   Rendering Vue components (and other frameworks via Vite) on the server (Node.js).\n-   `POST /render` API for getting the finished HTML.\n-   Automatic HTML assembly:\n    -   Injects `\u003cscript type=\"module\"\u003e` for entry and chunks.\n    -   Injects `\u003clink rel=\"stylesheet\"\u003e` for CSS.\n    -   Adds `\u003clink rel=\"modulepreload\"\u003e` and `\u003clink rel=\"preload\"\u003e` for JS, CSS, fonts, images (configurable).\n-   Easy integration with PHP via [`Annabel\\SSR\\Bridge`](https://github.com/codemonster-ru/annabel).\n-   Can be run:\n    -   Locally inside [Annabel Skeleton](https://github.com/codemonster-ru/annabel-skeleton).\n    -   As a standalone server (Node.js, Docker, PM2, systemd).\n\n## 📦 Installation\n\nGlobal:\n\n```bash\nnpm install -g @codemonster-ru/ssr-service\n```\n\nOr locally in the project:\n\n```bash\nnpm install @codemonster-ru/ssr-service\n```\n\n## 🚀 Launch\n\n### Via CLI\n\n```bash\nssr server\n```\n\nBy default the service runs at `http://localhost:3001`.\n\nOptions:\n\n```bash\nssr server --port 4000 --serverEntry ./dist/server/entry-server.js\n```\n\n### Via Node.js (locally)\n\n```bash\nnpx ssr server\n```\n\n### In development mode (tsx/ts-node)\n\n```bash\ncross-env DEV_ROOT=./playgrounds/vue DEV_ENTRY_SERVER=./src/entry-server.ts tsx src/server.ts\n```\n\n### In production\n\n```bash\nnpm run build\nnpm start\n```\n\n## 🔧 Configuration\n\nAll parameters can be set via **CLI**, **.env** or directly via `loadConfig`.\n\n| Param                   | Default                       | Description                                                                |\n| ----------------------- | ----------------------------- | -------------------------------------------------------------------------- |\n| `MODE`                  | `production`                  | Development or production or test                                          |\n| `CLI_MODE`              | `false`                       | To complete SSR correctly in CLI                                           |\n| `CLIENT_PATH`           | `dist/client`                 | Path to client build (static files)                                        |\n| `SERVER_ENTRY`          | `dist/server/entry-server.js` | Path to server entry (SSR build)                                           |\n| `MANIFEST_PATH`         | `dist/client/manifest.json`   | Path to `manifest.json`                                                    |\n| `DEV_ROOT`              | —                             | Project root for dev-mode (where `vite.config.ts` is)                      |\n| `DEV_ENTRY_SERVER`      | `./src/entry-server.ts`       | Entry for dev SSR                                                          |\n| `PORT`                  | `3001`                        | SSR server port                                                            |\n| `CLIENT_ENTRY`          | `/assets/entry-client.js`     | Fallback client entry if no manifest.json                                  |\n| `SCRIPT_ATTRS`          | `\"\"`                          | Attributes for all `\u003cscript\u003e` tags (`defer`, `async`, `crossorigin`, etc.) |\n| `DISABLE_PRELOAD`       | `false`                       | Disable all preloads                                                       |\n| `DISABLE_JS_PRELOAD`    | `false`                       | Disable only JS preload                                                    |\n| `DISABLE_CSS_PRELOAD`   | `false`                       | Disable only CSS preload                                                   |\n| `DISABLE_FONT_PRELOAD`  | `false`                       | Disable only font preload                                                  |\n| `DISABLE_IMAGE_PRELOAD` | `false`                       | Disable only image preload                                                 |\n\n## 🔗 Using with PHP (via Bridge)\n\n```php\n// Local\n$bridge = new \\Annabel\\SSR\\Bridge('local');\n$html = $bridge-\u003erender('\u003ch1\u003e{{ title }}\u003c/h1\u003e', ['title' =\u003e 'Hello from PHP']);\n\n// Remote\n$bridge = new \\Annabel\\SSR\\Bridge('http', 'http://127.0.0.1:3001');\n$html = $bridge-\u003erender('\u003ch1\u003e{{ title }}\u003c/h1\u003e', ['title' =\u003e 'Hello from PHP']);\n```\n\n## 📑 Example HTML Output\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n    \u003chead\u003e\n        \u003cmeta charset=\"utf-8\" /\u003e\n        \u003ctitle\u003eVue SSR playground\u003c/title\u003e\n\n        \u003cmeta name=\"description\" content=\"Description of the page\" /\u003e\n        \u003cmeta property=\"og:title\" content=\"Vue SSR playground\" /\u003e\n\n        \u003clink rel=\"modulepreload\" href=\"/assets/entry-client.abc.js\" /\u003e\n        \u003clink rel=\"modulepreload\" href=\"/assets/chunk-xyz.def.js\" /\u003e\n        \u003clink rel=\"preload\" as=\"style\" href=\"/assets/style.css\" /\u003e\n        \u003clink rel=\"preload\" as=\"font\" href=\"/assets/font.woff2\" crossorigin /\u003e\n        \u003clink rel=\"preload\" as=\"image\" href=\"/assets/logo.png\" /\u003e\n\n        \u003clink rel=\"stylesheet\" href=\"/assets/style.css\" /\u003e\n        \u003clink rel=\"stylesheet\" href=\"/assets/chunk-xyz.css\" /\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003cdiv id=\"app\"\u003e\u003c!-- SSR HTML --\u003e\u003c/div\u003e\n        \u003cscript\u003e\n            window.__COMPONENT__ = 'App';\n            window.__PROPS__ = { message: 'Hello' };\n        \u003c/script\u003e\n        \u003cscript type=\"module\" defer src=\"/assets/entry-client.abc.js\"\u003e\u003c/script\u003e\n        \u003cscript type=\"module\" defer src=\"/assets/chunk-xyz.def.js\"\u003e\u003c/script\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## 📖 Documentation\n\n-   [Annabel Framework](https://github.com/codemonster-ru/annabel)\n-   [Annabel Skeleton](https://github.com/codemonster-ru/annabel-skeleton)\n\n## 👨‍💻 Author\n\n[**Kirill Kolesnikov**](https://github.com/KolesnikovKirill)\n\n## 📜 License\n\n[MIT](https://github.com/codemonster-ru/ssr/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemonster-ru%2Fssr-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemonster-ru%2Fssr-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemonster-ru%2Fssr-service/lists"}