{"id":20859833,"url":"https://github.com/filrak/nuxt-layers-multisite","last_synced_at":"2025-05-12T08:32:48.122Z","repository":{"id":262708845,"uuid":"887447840","full_name":"filrak/nuxt-layers-multisite","owner":"filrak","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-13T21:14:15.000Z","size":94,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-13T21:31:13.847Z","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/filrak.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":"2024-11-12T19:01:47.000Z","updated_at":"2024-11-13T21:14:18.000Z","dependencies_parsed_at":"2024-11-13T21:35:03.729Z","dependency_job_id":"12ca1486-a9b9-4dc9-9136-10d3284dbb77","html_url":"https://github.com/filrak/nuxt-layers-multisite","commit_stats":null,"previous_names":["filrak/nuxt-layers-multisite"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filrak%2Fnuxt-layers-multisite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filrak%2Fnuxt-layers-multisite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filrak%2Fnuxt-layers-multisite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filrak%2Fnuxt-layers-multisite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filrak","download_url":"https://codeload.github.com/filrak/nuxt-layers-multisite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225130705,"owners_count":17425506,"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-18T04:53:18.424Z","updated_at":"2024-11-18T04:53:18.920Z","avatar_url":"https://github.com/filrak.png","language":"TypeScript","funding_links":[],"categories":["Starter Kits"],"sub_categories":[],"readme":"# Nuxt Multisite Inheritance Example\n\nThis template shows how to approach a problem of unifying multiple applications with a sgnificant amount of shared functionalities on the UI/feature layer.\n\nThe goal of this template is to reuse as much as possible from the *base* application that is a common part and then easily override/extend the differentiating parts per site.\n\nThe example shows how to build **multiple applications deployed separately from a single codebase**, rather than using a single application instance to serve multiple sites (multitenancy).\n\nSome examples on where this could be useful:\n- Multi-brand eCommerce setups \n- Multi-channel applications (web, mobile, kiosk etc)\n- Multi-tenant applications (with some slight adjustments)\n\nThis is a simplified version of what we developed at [Alokai](https://alokai.com) as a solution for large eCommerce companies with complex frontend applications.\n\n## How it works?\n\nThe mechanism here is quite simple and based on the inheritance mechanism coming from Nuxt Layers.\n\n- The *core* logic being a common piece that can be shared across multiple sites is placed in the `layers/base` folder.\n- Every file you put in a different folder within `layers` directory will override the base one (keep in mind that relative paths are still pointing to the layer where the file is placed)\n\nYou change the site by changing the `DEPLOYED_STORE` environment variable and setting it to the name of the folder within `layers` directory you want to deploy.\n\neg. `DEPLOYED_STORE=butterfly` will deploy the `butterfly` site.\n\n## What's included\n\n- File inheritance for all nuxt directories and files using layers\n- Layer-specific features (`layers/butterfly/components/Product.vue`)\n- Global CSS override example with variables (`assets/css/variables.css`)\n- Example on how to use the same codebase and template swith different underlying data models coming from different API's using normalizers (`server/api/*)`\n\n\n## Setup\n\nMake sure to install dependencies:\n\n```bash\n# npm\nnpm install\n\n# pnpm\npnpm install\n\n# yarn\nyarn install\n\n# bun\nbun install\n```\n\n## Prequisite\n\nChoose the site you want to develop or build. Keep in mind that you might need to reload the dev server when you change it.\n\nUse the name of the directory from the `layers` folder instead of `{layer-name}`\n```\n//.env\nDEPLOYED_STORE={layer-name}\n```\n\n## Development Server\n\nStart the development server on `http://localhost:3000`:\n\n```bash\n# npm\nnpm run dev\n\n# pnpm\npnpm dev\n\n# yarn\nyarn dev\n\n# bun\nbun run dev\n```\n\n## Production\n\nBuild the application for production:\n\n```bash\n# npm\nnpm run build\n\n# pnpm\npnpm build\n\n# yarn\nyarn build\n\n# bun\nbun run build\n```\n\nLocally preview production build:\n\n```bash\n# npm\nnpm run preview\n\n# pnpm\npnpm preview\n\n# yarn\nyarn preview\n\n# bun\nbun run preview\n```\n\n## Questions?\n\nJust ping me on [Bluesky](https://bsky.app/profile/filrakow.ski), [X](https://x.com/filrakowski), [Linkedin](https://www.linkedin.com/in/filip-rakowski-a43671129/) or create an issue in this repo if you think others would benefit from having the answer to that questions being posted in public.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilrak%2Fnuxt-layers-multisite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilrak%2Fnuxt-layers-multisite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilrak%2Fnuxt-layers-multisite/lists"}