The complete Bini.js ecosystem — everything you need to build full-stack React apps for web, desktop, and mobile from one codebase.
The two packages that scaffold and ship a Bini.js project.
Build full-stack React apps for web, desktop, and mobile — from one codebase. Scaffolds a complete Vite + React + Hono project with file-based routing, API routes, Tauri native builds, and a deploy script wired in from the first commit.
Zero-config deployment for Bini.js projects — web, desktop, and mobile, all from one CLI. Scans your project, generates the right hosting configuration for your target platform, and pushes it straight to GitHub.
These plugins are automatically included and configured in every Bini.js project.
File-based routing, nested layouts, folder-scoped loading/error/404 boundaries, MDX & Markdown pages, and Hono-powered API routes for Vite. Like Next.js App Router, but pure SPA — zero server required.
Hono-native environment variable system. getEnv(c, key) and requireEnv(c, key) read from the Hono request context, so variables resolve correctly on Node.js, Bun, Deno, Vercel Edge, Netlify Edge, and Cloudflare Workers — with zero dotenv parsing at runtime.
Automatic Tauri plugin wiring for desktop and mobile. Detects the web APIs you call — geolocation, clipboard, notifications, dialogs, and more — and wires Rust plugins, Cargo.toml, capabilities, and Android/iOS manifests. Dev-only; tauri build stays a complete no-op.
Zero-dependency, secure-by-default production server for bini-router apps. Streams static files with ETag caching, serves /api/* routes, provides SPA fallback, and adds configurable body/handler timeouts and graceful shutdown.
A Next.js-style error overlay and animated loading badge. Shows your Bini.js logo during development — animates on load and HMR updates, morphs into a clickable error pill on failure, and opens a full panel with stack trace and code frame.
Pre-renders every route — static and dynamic — to static HTML as part of npm run build. Real server-rendered markup with StaticRouter and React 19's renderToPipeableStream, plus shell pages with hydration markers for dynamic routes. No separate export command needed.
Plugins are added in vite.config.ts under the plugins array:
biniroute() returns an array of plugins — the router plugin plus the bundled MDX compiler — so it must be spread with ...biniroute(), not added as a single item.These Vite plugins are automatically included based on your project configuration:
Bini.js is compatible with most Vite and Rollup plugins. Here are some popular ones:
Zero-config PWA plugin. Adds service worker and manifest support for offline capabilities.
Transform SVGs into React components. Import SVGs directly as components.
Compress your bundle with Gzip or Brotli. Reduces bundle size for faster loading.
Visualize and analyze your bundle. See which packages take up the most space.
Bini.js uses Hono for API routes. You can use any Hono middleware in your src/app/api/ files.
Cross-Origin Resource Sharing middleware for Hono. bini-router and bini-server already enable permissive CORS by default — use this when you need finer-grained control.
JWT authentication middleware. Protect your API routes with JSON Web Tokens.
Simple logging middleware. Log incoming requests with method, path, and response time.
Zod validation middleware for Hono. Validate request body, query, and headers with Zod schemas.
hono or install additional packages like @hono/zod-validator. See the Hono middleware documentation for the complete list.Example of using Hono middleware together with bini-env in an API route: