{"id":17551618,"url":"https://github.com/mati365/react-asynchronous-ssr-blog","last_synced_at":"2026-04-29T21:33:33.682Z","repository":{"id":69538162,"uuid":"154550360","full_name":"Mati365/react-asynchronous-ssr-blog","owner":"Mati365","description":"SSR rendering asynchronous react components in Express with Knex/Objection.js DB connection","archived":false,"fork":false,"pushed_at":"2019-02-23T08:59:52.000Z","size":1187,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T07:42:40.248Z","etag":null,"topics":["async","example","express","knex","objection","react","ssr"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Mati365.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":"2018-10-24T18:38:43.000Z","updated_at":"2020-09-28T12:58:25.000Z","dependencies_parsed_at":"2023-03-24T12:50:34.397Z","dependency_job_id":null,"html_url":"https://github.com/Mati365/react-asynchronous-ssr-blog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mati365/react-asynchronous-ssr-blog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mati365%2Freact-asynchronous-ssr-blog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mati365%2Freact-asynchronous-ssr-blog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mati365%2Freact-asynchronous-ssr-blog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mati365%2Freact-asynchronous-ssr-blog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mati365","download_url":"https://codeload.github.com/Mati365/react-asynchronous-ssr-blog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mati365%2Freact-asynchronous-ssr-blog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32445257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["async","example","express","knex","objection","react","ssr"],"created_at":"2024-10-21T04:46:56.323Z","updated_at":"2026-04-29T21:33:33.666Z","avatar_url":"https://github.com/Mati365.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-asynchronous-ssr-blog\nSPA blog using Asynchronous React SSR components to fetch data from API and display it for SEO. Supports tags, reactions.\n\n### Screens\n![Main](/doc/img/1.png)\n![Article](/doc/img/2.png)\n![Tag](/doc/img/3.png)\n\n### Run\n```\nyarn install\nyarn run start\n```\n\n### ENV\nexample:\n```\nDB_NAME=database\nDB_USER=user\nDB_PASSWORD=123456\nDB_HOST=localhost\nDB_PORT=5432\n\nAPI_URL=http://lvh.me:3000\n```\n\n### Async API response rendering\nServer renders something like it:\n```\n\u003cAsyncComponent\n  promiseFn={() =\u003e timeout(100, 'xD')}\n\u003e\n  {data =\u003e (\n    \u003cdiv\u003e{data}\u003c/div\u003e\n  )}\n\u003c/AsyncComponent\u003e\n```\n\ncollects promises:\n```\nconst data = await mapObjValuesToPromise(\n  R.identity,\n  asyncContext.promises,\n);\n```\nand renders whole tree again:\n```\n  const asyncContext = {\n    cache,\n    promises,\n    attachPromise: function addPromise(uuid, promise) {\n      promises[uuid] = promise;\n      return promise;\n    },\n  };\n\n  return (\n    \u003cAsyncContextProvider value={asyncContext}\u003e\n      {component}\n    \u003c/AsyncContextProvider\u003e\n  );\n```\nwith already downloaded data stored in context. It is slow but works\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmati365%2Freact-asynchronous-ssr-blog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmati365%2Freact-asynchronous-ssr-blog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmati365%2Freact-asynchronous-ssr-blog/lists"}