Introduction
Quick Start
How to get started with mion full stack APIs.
mion has starter projects that set up a fully typed frontend and backend in one step. Each keeps the mion API in its own api/ folder, so you can deploy the frontend and the API independently.
npm create @mionjs/starter-vue my-app
npm create @mionjs/starter-react my-app
npm create @mionjs/starter-nuxt my-app
Vue Starter
A Vue 3 SPA + Vite starter with the mion API running on Node, Bun or Cloudflare Workers.
- Vue Router
- One
vite.config.ts: the API runs insidevite dev, andvite buildoutputs the SPA and the API, one target per build - Fully typed
@mionjs/client - oxlint with the mion lint rules,
.vuefiles included - Vitest + Playwright e2e tests preconfigured
my-app/
├── app/ # Vue 3 SPA source
│ ├── pages/ # Route views
│ ├── mion-client.ts # Typed mion client wired to the API
│ ├── orders-batch.ts # batch + inputFrom example
│ └── main.ts # SPA entry + Vue Router setup
├── api/ # mion API
│ ├── src/
│ │ ├── router.ts # createMionRouter()
│ │ ├── api.ts # Route tree + mion.initRoutes()
│ │ ├── models.ts # Shared API models
│ │ ├── features/ # Feature modules (handlers, models, repos)
│ │ ├── server.node.ts # Node.js entry
│ │ ├── server.bun.ts # Bun entry
│ │ └── cloudflare-worker.ts
│ └── tests/ # Vitest API and client tests
├── e2e/ # Playwright tests
├── tsconfig.json # One tsconfig for the app and the API
├── wrangler.toml # Cloudflare Worker serving the SPA and the API
└── vite.config.ts # Vue + mion Vite plugin, API build to dist-server/
React Starter
A React 19 SPA + Vite starter with the mion API running on Node.
- React Router in SPA mode
- One
vite.config.ts: the API runs insidevite dev, andvite buildoutputs the SPA and the API - Fully typed
@mionjs/client - oxlint with the mion lint rules
- Vitest + Playwright e2e tests preconfigured
my-app/
├── app/ # React SPA source
│ ├── pages/ # Route views
│ ├── mion-client.ts # Typed mion client wired to the API
│ ├── orders-batch.ts # batch + inputFrom example
│ └── main.tsx # SPA entry + React Router setup
├── api/ # mion API
│ ├── src/
│ │ ├── router.ts # createMionRouter()
│ │ ├── api.ts # Route tree + mion.initRoutes()
│ │ ├── models.ts # Shared API models
│ │ ├── features/ # Feature modules (handlers, models, repos)
│ │ └── server.node.ts # Node.js entry
│ └── tests/ # Vitest API and client tests
├── e2e/ # Playwright tests
├── tsconfig.json # One tsconfig for the app and the API
└── vite.config.ts # React + mion Vite plugin, API build to dist-server/
Nuxt Starter
A Nuxt 4 SPA starter with the mion API running on Node, Bun or Cloudflare Workers.
- Nuxt in SPA mode (
ssr: false);nuxt generateoutputs a static SPA - The API runs inside
nuxt dev - Fully typed
@mionjs/client - ESLint with the Nuxt and mion lint rules
- Vitest + Playwright e2e tests preconfigured
my-app/
├── app/ # Nuxt SPA source
│ ├── pages/ # File-based routes
│ └── lib/
│ ├── mion-client.ts # Typed mion client wired to the API
│ └── orders-batch.ts # batch + inputFrom example
├── api/ # mion API
│ ├── src/
│ │ ├── router.ts # createMionRouter()
│ │ ├── api.ts # Route tree + mion.initRoutes()
│ │ ├── models.ts # Shared API models
│ │ ├── features/ # Feature modules (handlers, models, repos)
│ │ ├── server.node.ts # Node.js entry
│ │ ├── server.bun.ts # Bun entry
│ │ └── cloudflare-worker.ts
│ ├── tests/ # Vitest API and client tests
│ └── vite.config.ts # API build, one target per run
├── e2e/ # Playwright tests
├── tsconfig.mion.json # One tsconfig for the app and the API, used by mion
└── nuxt.config.ts # Nuxt config, mion Vite plugin
In every starter, the mion Vite plugin compiles validation and the JSON round trip at build time, for faster cold starts. To deploy where runtime
new Function() is blocked, set emitMode: 'both' (the Vue starter's Workers build already does).