{"id":26737315,"url":"https://github.com/denchiklut/ssr-boilerplate","last_synced_at":"2025-04-14T13:33:05.939Z","repository":{"id":38440414,"uuid":"356964177","full_name":"denchiklut/ssr-boilerplate","owner":"denchiklut","description":"SSR boilerplate ","archived":false,"fork":false,"pushed_at":"2025-03-26T01:58:39.000Z","size":1415,"stargazers_count":34,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T02:39:58.300Z","etag":null,"topics":["babel","boilerplate","express","hmr","jest","pwa","react","react-testing-library","ssr","suspense","typescript","webpack","webpack-dev-middleware","webpack-hot-middleware"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/denchiklut.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}},"created_at":"2021-04-11T19:47:28.000Z","updated_at":"2025-03-26T01:58:43.000Z","dependencies_parsed_at":"2023-09-23T07:15:21.021Z","dependency_job_id":"cdd0c576-4702-4877-9301-260c7e52edfb","html_url":"https://github.com/denchiklut/ssr-boilerplate","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denchiklut%2Fssr-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denchiklut%2Fssr-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denchiklut%2Fssr-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denchiklut%2Fssr-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denchiklut","download_url":"https://codeload.github.com/denchiklut/ssr-boilerplate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248888815,"owners_count":21178111,"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","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":["babel","boilerplate","express","hmr","jest","pwa","react","react-testing-library","ssr","suspense","typescript","webpack","webpack-dev-middleware","webpack-hot-middleware"],"created_at":"2025-03-28T02:39:30.404Z","updated_at":"2025-04-14T13:33:05.890Z","avatar_url":"https://github.com/denchiklut.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSR Boilerplate\n\n[![license](https://img.shields.io/github/license/nhn/tui.editor.svg)](https://github.com/nhn/tui.editor/blob/master/LICENSE) [![PRs welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg)](https://github.com/nhn/tui.editor/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)\n\nYou can use this project as a boilerplate for your SSR applications. Feel free to suggest improvements\nIf you are looking for **renderToPipeableStream** setup switch to the [feat/pipable-stream](https://github.com/denchiklut/ssr-boilerplate/tree/feat/pipable-stream) branch\n\n## Features\n\n-   [x] `SSR`\n-   [x] `HMR`\n-   [x] Code splitting\n-   [x] `SPA` mode\n-   [x] `Polyfills`\n-   [x] `PWA`\n-   [x] React forget\n-   [x] local `https`\n-   [x] `PipeableStream` support\n\n### SSR Suspense\n\n-   If you want to try React 18's SSR Suspense api such as `renderToPipeableStream`, switch to the [feat/pipable-stream](https://github.com/denchiklut/ssr-boilerplate/tree/feat/pipable-stream) branch.\n-   Also, there is en example for setting up suspense api with CSS-in-JS library in our case [MUI](https://github.com/denchiklut/ssr-boilerplate/tree/feat/suspense-mui) just switch to the [feat/suspense-mui](https://github.com/denchiklut/ssr-boilerplate/tree/feat/suspense-mui) branch.\n-   I also wrote a small article about `SSR with React 18`. For those interested in further information, feel free to check my [post on medium](https://medium.com/@ollylut/ssr-with-react-18-c8961d764a94)\n\n## Startup project\n\n### Step 1. Project setup\n\nBefore starting work with the project, run the command:\n\n```\nyarn install\n```\n\n### Step 2. Https setup\n\nIf you need to use https, follow these steps:\n\n1. in `setup.sh` change the `domain` variable to your domain\n2. run the command `yarn setup`\n3. finally add your CLIENT_HOST variable to .env file as `https://\u003cYOUR-domain\u003e:PORT`\n\n### Step 2. Environment variables\n\nYou can use .env file to specify environment variables. This file is ignored by git.\n\n#### Adding new `env` variable\n\n1. Add it to `.env` file\n2. For TS completion and validation add it to `envSchema` in `src/common/env/index.ts`\n3. If this variable needs to be accessible from both `client` \u0026 `server` make sure it's name starts with prefix `CLIENT_`\n4. You can change client (`CLIENT_`) prefix in `webpack/plugins/define.plugin.ts`\n5. You can access environment variable via `getENV` function.\n   This function will return a proper value based on environment (client/server) and cast it to a proper type based on `envSchema` from `step 2` (string/number/boolean)\n6. Important note! Unlike with Next.js apps, environment variables in this setup are `not baked` into the `bundle` at build time. This allows you to `build` the app `once` (e.g., for staging) and `reuse` the same build in other environments, such as production, without needing to rebuild for each environment.\n\n#### Global variables\n\nNote that additionally there will be few useful `global variables` available for you.\n\n-   `IS_DEV`, `IS_PROD`, `IS_SERVER`, `IS_SPA`\n\n### Step 3. Starting the project\n\nTo start the project in **SSR** mode, run the command\n\n```\nyarn dev\n```\n\nTo start the project in **SPA** mode, run the command\n\n```\nyarn spa\n```\n\nTo start the project in **Prod** mode, run the command\n\n```\nyarn start\n```\n\nReady! The app will start on `http://localhost:3000`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenchiklut%2Fssr-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenchiklut%2Fssr-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenchiklut%2Fssr-boilerplate/lists"}