{"id":18800829,"url":"https://github.com/bitovi/fast-react-static-renderer-app","last_synced_at":"2025-07-05T09:01:53.718Z","repository":{"id":54798290,"uuid":"503916546","full_name":"bitovi/fast-react-static-renderer-app","owner":"bitovi","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-31T16:33:21.000Z","size":183,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":26,"default_branch":"main","last_synced_at":"2024-12-29T19:07:59.400Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/bitovi.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}},"created_at":"2022-06-15T20:43:43.000Z","updated_at":"2022-08-05T17:05:51.000Z","dependencies_parsed_at":"2022-08-14T03:10:43.455Z","dependency_job_id":null,"html_url":"https://github.com/bitovi/fast-react-static-renderer-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitovi%2Ffast-react-static-renderer-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitovi%2Ffast-react-static-renderer-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitovi%2Ffast-react-static-renderer-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitovi%2Ffast-react-static-renderer-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitovi","download_url":"https://codeload.github.com/bitovi/fast-react-static-renderer-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239734482,"owners_count":19688256,"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":[],"created_at":"2024-11-07T22:20:15.112Z","updated_at":"2025-02-19T20:42:02.411Z","avatar_url":"https://github.com/bitovi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Getting Started\n\nFirst, create a .env.local file in project's root and add the following environment variables:\n\n- `CONTENTFUL_SPACE_ID`\n  - Description: Contentful space id\n- `CONTENTFUL_ACCESS_TOKEN`\n  - Description: Contentful access token\n  \n\nTo run the development server:\n\n```bash\nnpm run dev\n# or\nyarn dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) with your browser to see the result.\n\n## GraphQL to fetch Contentful data\n\n\n## Parallelize build\n\nIf your platform has thousands of pages or more, it might be worth it to parallelize the build process to save time and resources.\nTo do so, we divide the build into multiple batches of pages. The process is documented in https://github.com/bitovi/fast-react-static-renderer.\n\nIn this app, the parallelization is achieved in the `[page].tsx` file, with the `getStaticPaths` function.\n\n`getStaticPaths` is used to statically pre-render paths in a page with dynamic Routes. More info [Here](https://nextjs.org/docs/basic-features/data-fetching/get-static-paths)\n\n\n```javascript\nexport const getStaticPaths = async () =\u003e {\n  const pages_string = process.env[\"PAGE_DATA\"];\n  let pages: Content[] = [];\n  if (typeof pages_string === \"undefined\") {\n    console.log(\"WARN: PAGE_DATA env var not provided, getting all pages\");\n    pages = await getAllContents();\n  } else {\n    pages = JSON.parse(pages_string).pages as Content[];\n  }\n\n  const paths = pages.map((page) =\u003e {\n    return { params: { page: page.slug } };\n  });\n\n  return {\n    paths,\n    fallback: \"blocking\",\n  };\n};\n```\nThe PAGE_DATA environment variable injected by the build image determines which pages will be included in a particular build. The different builds will then be combined and result in the statically rendered application.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitovi%2Ffast-react-static-renderer-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitovi%2Ffast-react-static-renderer-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitovi%2Ffast-react-static-renderer-app/lists"}