{"id":18585327,"url":"https://github.com/tyhopp/next-microfrontend","last_synced_at":"2025-08-23T03:33:27.073Z","repository":{"id":168091309,"uuid":"643701031","full_name":"tyhopp/next-microfrontend","owner":"tyhopp","description":"Try out a Next.js-based microfrontend architecture","archived":false,"fork":false,"pushed_at":"2023-05-26T06:59:27.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-16T06:08:44.693Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":false,"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/tyhopp.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":"2023-05-22T01:09:26.000Z","updated_at":"2024-01-09T02:29:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"cb7d0538-3719-4f03-b0c1-6052c02940ec","html_url":"https://github.com/tyhopp/next-microfrontend","commit_stats":null,"previous_names":["tyhopp/next-microfrontend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tyhopp/next-microfrontend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyhopp%2Fnext-microfrontend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyhopp%2Fnext-microfrontend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyhopp%2Fnext-microfrontend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyhopp%2Fnext-microfrontend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tyhopp","download_url":"https://codeload.github.com/tyhopp/next-microfrontend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyhopp%2Fnext-microfrontend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271737486,"owners_count":24812130,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-07T00:33:03.737Z","updated_at":"2025-08-23T03:33:27.036Z","avatar_url":"https://github.com/tyhopp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# next-microfrontend\n\nTry out a Next.js-based microfrontend architecture.\n\nThe idea is applications can be separately developed and composed together in a `main` application.\n\n## Usage\n\n1. Clone this repository\n2. `npm install turbo --global` to install [Turborepo](https://turbo.build/repo/docs/installing) (per-project installs [destabilize lockfiles](https://github.com/vercel/turbo/issues/3328))\n3. `npm install` to install project dependencies\n4. `npm run dev` to run the main application locally\n\n## Thoughts\n\n- The approach works, but integrating routes for sub-applications and the main application by hand could be a problem at scale\n- A tool could be written to automatically perform integration on a best-effort basis (and then manually intervene as needed after), but that requires sub-applications to strictly follow a determinable structure\n- Prior commits demonstrate that using Next.js' [generateStaticParams](https://nextjs.org/docs/app/api-reference/functions/generate-static-params) and [dynamic route segments](https://nextjs.org/docs/app/building-your-application/routing/defining-routes#dynamic-segments) APIs can be used to allow sub-apps to provide route creation logic. There are two problems in practice:\n  - It is more magical than statically defined routes, which makes it less clear what routes are expected to exist, and less clear to integrate\n  - It makes code in sub-apps hard to organize (the `[slug]` nomenclature in paths means code has to live elsewhere and be imported into subpaths, instead of the other way around)\n- I think if we take this approach then we should avoid dynamic route segments as a way to semi-decouple route creation\n  - Instead, we could statically create routes in both the sub-app and main app, and export pages instead of widgets\n  - Without a tool, this means a lot of tedious integration work re-creating routes in the main application","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyhopp%2Fnext-microfrontend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyhopp%2Fnext-microfrontend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyhopp%2Fnext-microfrontend/lists"}