Structured Vite template for type-safe full-stack apps. Multiple source folders. Directory-based routing. Nested layouts. Runtime validation. Generated fetch clients. Multiple frameworks.
It's a structured Vite template that gives your Vite project a scalable shape:
- Multiple source folders for distinct areas (website, admin dashboard, API).
- Each folder splits into
api/andpages/, creating a clean boundary between server and client. - Generators that produce validation schemas, fetch clients, and
OpenAPIspecs from your types.
pnpm dlx kosmojs app # or any name for your project
# or `npx kosmojs app` / `yarn dlx kosmojs app`After the project is created, navigate to your app directory:
cd ./appAll subsequent operations run from inside this directory.
Use your favorite package manager:
pnpm install
# or `npm install` / `yarn install`pnpm +folder
# or `npm run +folder` / `yarn +folder`The source folder may have added new dependencies. Run the package manager again:
pnpm install
# or `npm install` / `yarn install`pnpm dev
# or `npm run dev` / `yarn dev`Each source folder runs on its own port with its own base URL.
-
🗂️ Multiple Source Folders
Organize distinct concerns - public site, customer app, admin dashboard - all connected in one Vite project. -
🛣️ Directory-Based Routing
Your folder structure defines your routes. Works identically for both API endpoints and client pages -
🛡️ End-to-End Type Safety
WriteTypeScripttypes once, get runtime validation automatically. No separate schemas to maintain. -
🔗 Generated Fetch Clients + OpenAPI spec
Fully-typed fetch clients with client-side validation. Invalid requests never reach your server. -
🎨 Multiple Frameworks
Currently supportsSolidJS,ReactandVue. Additional frameworks may be added based on community interest. -
🔧 Built on Proven Tools
Koafor APIs,Vitefor frontend,TypeScriptfor safety. No proprietary abstractions.
- Monorepo-like projects where frontend and API must live side by side.
- Teams needing strong typing and runtime validation without duplicating schemas.
- Developers who want framework freedom while keeping consistent structure.
- Projects that must scale from prototype → production with a deterministic structure.
Contributions are welcome! Check out the issues and submit PRs. Please follow the project's coding style and include tests when possible.
MIT © Slee Woo