{"id":28274719,"url":"https://github.com/jquery-dlya-slabih/vite-react-ssr","last_synced_at":"2026-04-14T19:31:32.679Z","repository":{"id":271868708,"uuid":"914805018","full_name":"jquery-dlya-slabih/vite-react-ssr","owner":"jquery-dlya-slabih","description":"Server side rendering template","archived":false,"fork":false,"pushed_at":"2025-05-20T10:00:09.000Z","size":1948,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-10T22:10:24.525Z","etag":null,"topics":["playwright","react","react-query","react-router","ssr","tailwind","testing-library","typescript","valibot","vite"],"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/jquery-dlya-slabih.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2025-01-10T10:43:42.000Z","updated_at":"2025-06-01T23:02:37.000Z","dependencies_parsed_at":"2025-03-01T14:27:08.925Z","dependency_job_id":"06d68e51-8da6-436a-90b1-98641893f345","html_url":"https://github.com/jquery-dlya-slabih/vite-react-ssr","commit_stats":null,"previous_names":["jquery-dlya-slabih/ssr","jquery-dlya-slabih/vite-react-ssr"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/jquery-dlya-slabih/vite-react-ssr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquery-dlya-slabih%2Fvite-react-ssr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquery-dlya-slabih%2Fvite-react-ssr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquery-dlya-slabih%2Fvite-react-ssr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquery-dlya-slabih%2Fvite-react-ssr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jquery-dlya-slabih","download_url":"https://codeload.github.com/jquery-dlya-slabih/vite-react-ssr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquery-dlya-slabih%2Fvite-react-ssr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31812968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","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":["playwright","react","react-query","react-router","ssr","tailwind","testing-library","typescript","valibot","vite"],"created_at":"2025-05-21T02:12:46.460Z","updated_at":"2026-04-14T19:31:32.663Z","avatar_url":"https://github.com/jquery-dlya-slabih.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ssr\n\nServer side rendering template with ton of features.\n\n## Locking Environment Versions\n\nIt's considered good practice to lock the versions of your environment tools, such as Node.js and pnpm. To do this,\nyou can specify the required versions in the `engines` field in `package.json` and configure enforcement using the\n`.npmrc` file in your project's root.\n\nIf needed, you can disable strict version checks by setting `engine-strict=false` in `.npmrc`.\n\n## For dev\n\n1. clone project `git clone https://github.com/jquery-dlya-slabih/ssr.git`\n2. install pnpm 10.x version `npm install -g pnpm@10.11.0`\n3. install deps `pnpm install`\n4. run dev `pnpm dev`\n\n## For prod\n\n### With docker\n\n1. `npm run docker:build`\n2. `npm run docker:start`\n\n### Without docker\n\n1. install deps `pnpm install --frozen-lockfile`\n2. pnpm build\n3. pnpm prod\n\n## Commands\n\n| description                         | command                    |\n| ----------------------------------- | -------------------------- |\n| run dev build with dev server       | `pnpm dev`                 |\n| run prod build                      | `pnpm build`               |\n| run prod server (prod build needed) | `pnpm prod`                |\n| run linting                         | `pnpm lint`                |\n| run prettier check                  | `pnpm prettier:check`      |\n| run prettier write                  | `pnpm prettier:write`      |\n| run type checking                   | `pnpm types`               |\n| run bundle analyzer                 | `pnpm analyze`             |\n| run unit tests                      | `pnpm test`                |\n| show unit tests information         | `pnpm test:ui`             |\n| run e2e tests                       | `pnpm e2e`                 |\n| run e2e tests in ui                 | `pnpm e2e:ui`              |\n| show e2e tests information          | `pnpm e2e:report`          |\n| run e2e codegen                     | `pnpm e2e:codegen`         |\n| generate assets for pwa             | `pnpm generate-pwa-assets` |\n| run docker image build              | `pnpm docker:build`        |\n| start docker container              | `pnpm docker:run`          |\n| stop docker container               | `pnpm docker:stop`         |\n\n## Serving static files\n\nIf you're using **NGINX** or another solution for static file **serving** and **compression**, you can remove these lines\nfrom `server.ts` and delete the **compression** dependency from `package.json`.\n\n```ts\nif (isProduction) {\n  app.use(compression());\n  app.use(express.static('dist'));\n}\n```\n\nYou may need to additionally reconfigure the public path. This can be done by setting `base` in the `vite.config.ts` file.\nThe same goes for using the **vite-plugin-static-copy** plugin. It’s better to put the `robots.txt` file in the\nrequired section of the site at the CD stage. And remove the logic for copy file in the root from the CI stage.\n\n## Hooks\n\nThere is a `pre-push` hook in the `.githooks` folder. If you want to add another hook, for example `pre-commit`, then you need:\n\n1. create a file with name `pre-commit` in `.githooks` folder\n2. in project root use command `chmod +x .githooks/pre-commit`\n3. fill new hook with any commands, like `pre-push` hook\n\nIf you want to delete all hooks:\n\n1. remove `.githooks` folder\n2. remove `prepare` command in `package.json`\n3. in project root use command `git config --unset core.hooksPath`\n\n## HTTPS\n\n1. use command `sudo nano /etc/hosts`\n2. add `127.0.0.1 ssr-local.com`\n3. save file\n4. use command `pnpm dev`\n\nA DNS reset may be necessary. On macOS, the simplest solution is to restart the system.\n\n## Aliasing\n\nFor aliasing just add alias in file `tsconfig.app.json`.\n\n## Test users\n\n| login  | password   |\n| ------ | ---------- |\n| avat   | avatpass   |\n| emilys | emilyspass |\n\n## Redis\n\nCache for all HTML pages. Cache expiration eq 10 min.\n\n1. install redis `brew install redis`\n2. run redis `redis-server`\n3. change value of `REDIS` env in `.env` to `true`\n4. use `pnpm dev` command\n\nFor reset all cache use `/reset_redis_cache` handler.\n\n## Docker\n\n`Docker` should only be used in `production`. There’s no practical reason to use it in `development` mode.\n\nIf you encounter a **pnpm** installation error like: `Error: Error when performing the request to\nhttps://registry.npmjs.org/pnpm/-/pnpm-10.11.0.tgz; for troubleshooting help,\nsee https://github.com/nodejs/corepack#troubleshooting.`). Try running the `docker:build` command again.\n\n## Server timing API\n\nTo enable https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Server-Timing just use query flag `timing=true`.\n\nExample:\n\n- W/o timing https://ssr-local.com:3000, https://ssr-local.com:3000/posts/5;\n- With timing https://ssr-local.com:3000/?timing=true, https://ssr-local.com:3000/posts/5?timing=true.\n\nTo view data, go to chrome **devtools**, **network** tab, next select your **html**-file and choose **timing** tab.\n\n## Tests\n\n- Test runner https://vitest.dev/\n- Render react components https://testing-library.com/docs/react-testing-library/intro/\n- Custom matchers to test the state of the DOM https://github.com/testing-library/jest-dom\n- E2E tests https://playwright.dev/\n\n## Generating pwa assets\n\nFor generating pwa assets:\n\n1. add to `public` folder your icon, name of icon must be `favicon.svg`\n2. use command `pnpm generate-pwa-assets`\n\nIf you have any problems with canvas on macOS, use command `brew install pkg-config cairo pango libpng jpeg giflib librsvg`.\n\n## Lightning CSS\n\nTailwind CSS v4.0 is designed for and tested on modern browsers, and the core functionality of the framework\nspecifically depends on these browser versions:\n\n- Chrome 111 (released March 2023)\n- Safari 16.4 (released March 2023)\n- Firefox 128 (released July 2024)\n\nFor this reason, we need to transpile the code to older browsers. List of supported browsers\n[here](https://browserslist.dev/?q=ZGVmYXVsdHMgYW5kIGZ1bGx5IHN1cHBvcnRzIGVzNi1tb2R1bGU%3D).\n\nAlternatively, if you only need to support browsers compatible with Tailwind, you can safely remove Lightning CSS.\n\n## Contributing\n\nFeel free to open an issue or submit PRs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjquery-dlya-slabih%2Fvite-react-ssr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjquery-dlya-slabih%2Fvite-react-ssr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjquery-dlya-slabih%2Fvite-react-ssr/lists"}