turborepo-vite-elysia-spa

📁 ahmed-lotfy-dev/turborepo-vite-elysia-spa 📅 2 days ago
2
总安装量
2
周安装量
#65165
全站排名
安装命令
npx skills add https://github.com/ahmed-lotfy-dev/turborepo-vite-elysia-spa --skill turborepo-vite-elysia-spa

Agent 安装分布

kilo 2
windsurf 2
amp 2
openclaw 2
opencode 2

Skill 文档

Turborepo Vite Elysia SPA

Overview

Create a Bun monorepo with latest generator output, not manual scaffolding. Use official generators first, then apply backend wiring and security defaults.

Required Workflow

  1. Confirm target path and whether existing apps/backend or apps/frontend should be replaced.
  2. Run official generators only:
  • bun create elysia apps/backend
  • bun create vite apps/frontend --template react-ts
  1. Install required backend dependencies and dev dependencies with Bun.
  2. Add/verify backend infrastructure: Better Auth, Drizzle, Postgres, MCP endpoint, OpenAPI docs, CORS allowlist, CSRF middleware, and security headers.
  3. Keep frontend as SPA (Vite React TS) unless explicitly requested otherwise.
  4. Wire root monorepo scripts and Turbo tasks if monorepo orchestration is requested.
  5. Provide run steps and env vars required for local development.

Hard Rules

  • Do not hand-roll generated app baselines when Bun is available.
  • Do not keep stale/legacy package versions from old manual scaffolds.
  • Do not clobber existing apps without explicit confirmation.
  • Prefer replacing app folders (apps/backend, apps/frontend) over patching old generated output when user asks for latest versions.

Backend Wiring Checklist

  • Better Auth mounted and configured with Drizzle adapter.
  • Drizzle schema and config present.
  • Postgres connection via env DATABASE_URL.
  • MCP plugin wired through elysia-mcp (not raw McpServer plugin use).
  • OpenAPI docs route enabled.
  • CORS allowlist bound to frontend origin env.
  • CSRF protection on non-auth cookie-based mutation routes.
  • Security headers middleware enabled.

Frontend SPA Checklist

  • React + TypeScript Vite template.
  • vite scripts present (dev, build, preview).
  • Simple SPA entrypoint validated.

Run and Verify

  • bun install
  • bun run dev (or per-app scripts)
  • bun run db:generate and bun run db:migrate in backend when DB is configured.

References

  • Read references/workflow.md for exact commands, package lists, and file expectations.