# Standalone Micro Apps

Builds standalone micro apps with SSR, Workers, CDN, SEO and gateway routes.

- Repository: https://github.com/lobehub/lobehub (83676 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add lobehub/lobehub --skill split-micro-app -g -a claude-code -y`
Codex: `npx skills add lobehub/lobehub --skill split-micro-app -g -a codex -y`
Cursor: `npx skills add lobehub/lobehub --skill split-micro-app -g -a cursor -y`
Gemini CLI: `npx skills add lobehub/lobehub --skill split-micro-app -g -a gemini-cli -y`

## Description

Use for standalone micro apps: React Router SSR/SSG, Cloud overlays, Workers, CDN/R2, SEO/OG, gateway routes, previews, Docker integration and SSR bundle isolation.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Micro App: Split, SSR, SEO, Gateway

Canonical living examples, both extracted 2026-08, read the real files, this skill records
the decisions and landmines, not copies of the code:

- **`apps/workbench`** (`/acceptance`, `/agent/:aid/docs/:docId`; `/verify` only redirects retired report links into Acceptance), all code in this repo, builds and deploys from OSS CI.
- **`apps/share`** (`/share/t/:id`, `/share/page/:id`), renders Cloud-only surfaces, so it
  builds and deploys from **lobehub-cloud** CI. See §1b before touching it.
- **`apps/auth`** (`/signin`, `/signup`, …), the SSG variant: `ssr: false` + `prerender`, so
  the worker carries no React at all (7KB). 18 locales x 4 routes of prerendered documents.
  Also renders Cloud-only surfaces (§1b). See §3b.

## Hosting

One app, two serve paths. Do not mix them.

| Surface             | Who serves it                           | Build                                                                                                                                                                                               |
| ------------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Cloud               | Gateway (torii) → Worker (SSR)          | Cloud Next does **not** `build:spa:<name>`, copy `_spa-<name>`, rewrite to `/spa-<name>`, or CDN-upload that prefix                                                                                 |
| OSS / 子部署 Docker | Next in the same image, client-rendered | `build:docker` runs `build:spa:<name>`; `<NAME>_REQUIRED=1` on `generateSpaTemplates`; Dockerfile copies `apps/<name>/package.json` before `pnpm i` and `public/_spa-<name>` into the runtime image |

The rest: https://github.com/lobehub/lobehub/blob/HEAD/.agents/skills/split-micro-app/SKILL.md
