Rails patterns, JavaScript runtimes.
Write Rails applications that run everywhere: browsers, Node.js, Bun, Deno, Cloudflare Workers, and Vercel Edge Functions. Same models, controllers, and views—different runtimes.
npx github:ruby2js/juntos --demo blog
cd blog
npx juntos dev -d dexie
npx juntos testThat's it. Open http://localhost:5173 to see your app.
Juntos (no Ruby required):
npx juntos dev -d dexie # Browser with IndexedDB
npx juntos up -d sqlite # Node.js with SQLite
npx juntos deploy -d neon # Vercel Edge
npx juntos deploy -d d1 # Cloudflare WorkersAlso deploys to mobile (Capacitor) and desktop (Electron, Tauri)—platforms Rails can't reach. See Deployment Guide.
Rails (requires Ruby):
bundle install
bin/rails db:prepare
bin/rails serverInitialize Juntos in an existing project:
npx github:ruby2js/juntos init # Current directory
npx github:ruby2js/juntos init my-app # Specific directoryThis creates the configuration files needed for Juntos:
package.json(or merges dependencies into existing)vite.config.jsvitest.config.jstest/setup.mjsbin/juntos
Try them in your browser — no install required.
| Demo | Description |
|---|---|
blog |
Articles and comments with real-time updates |
chat |
Real-time messaging with Turbo Streams |
notes |
JSON API with React frontend |
photo-gallery |
Device APIs and Electron support |
dictaphone |
Audio recording with AI transcription and Active Storage |
workflow |
React Flow integration |
ssg-blog |
Static site generation with 11ty |
astro-blog |
Content with client-side functionality |
npx github:ruby2js/juntos --demo chat
npx github:ruby2js/juntos --demo notes my-notes # Custom directory
npx github:ruby2js/juntos --demo blog --no-install # Skip npm installVerify everything works with just Node.js using Docker:
docker run -it --rm -p 5173:5173 -p 3000:3000 node:22 bash -c '
cd /tmp &&
npx github:ruby2js/juntos --demo blog &&
cd blog &&
echo "Ready. Try: npx juntos dev -d dexie" &&
exec bash
'Then inside the container:
npx juntos test # Run tests
npx juntos dev -d dexie # Dev server → http://localhost:5173
npx juntos up -d sqlite # Production → http://localhost:3000No Ruby installed. Rails patterns just work.
https://www.ruby2js.com/docs/juntos
Juntos transpiles Ruby to JavaScript using Ruby2JS. Your Rails models, controllers, and views become JavaScript that runs anywhere.
- Models → JavaScript classes with ActiveRecord-like queries
- Controllers → Request handlers with before_action, params, flash
- Views → ERB templates become JavaScript render functions
- Routes → Rails-style routing with path helpers
No lock-in: npx juntos eject writes the transpiled JavaScript to disk. You can continue development in pure JavaScript without ever touching Ruby again.
MIT