npx create-rasengan@latest
GETTING STARTED
Get started with Rasengan.js
Rasengan.js takes care of all the complex parts of web development — routing, rendering, optimization, and performance — so you don’t have to. It scans your React components, automatically applies best practices, and generates the most efficient output for your project.
With Rasengan.js, you can focus on building your app, while it handles the difficult technical details behind the scenes. It’s —fast, flexible, and reliable— with minimal setup and zero hassle. 🚀
Pre-requisites
- Node.js 20.18 or later.
- macOS, Windows, and Linux are supported.
Installation
Automatic Installation
The best way to start a new Rasengan.js project is with create-rasengan CLI, which sets everything up for you automatically.
Just follow the following steps to get started:
- What would you like to name your project? - Which language would you like to use for your project? - Which template would you like to use?
cd my-app npm install
npm run dev
Manual Installation
This method is not recommended for beginners. It is recommended to use the automatic installation method.
The following steps will guide you through setting up a new Rasengan.js project manually using TypeScript.
mkdir my-app cd my-app npm init -y npm install rasengan@latest @rasenganjs/serve@latest react@latest react-dom@latest npm install --save-dev cross-env vite@latest @types/react @types/react-dom @types/node typescript
"scripts": { "dev": "rasengan dev", "build": "rasengan build", "serve": "rasengan-serve ./dist" }
mkdir public src touch rasengan.config.js
import { defineConfig } from "rasengan"; export default defineConfig({});
mkdir src/app touch src/app/home.page.tsx src/app/app.router.ts touch src/main.tsx src/template.tsx src/index.ts
import { type PageComponent } from "rasengan"; const Home: PageComponent = () => { return ( <main>Home Page</main> ) } Home.path = "/"; Home.metadata = { title: "Home", description: "Home page", } export default Home;
import { RouterComponent, defineRouter } from "rasengan"; import Home from "@/app/home.page"; class AppRouter extends RouterComponent {} export default defineRouter({ pages: [Home] })(AppRouter);
import { type AppProps } from "rasengan"; import AppRouter from "@/app/app.router"; export default function App({ Component, children }: AppProps) { return <Component router={AppRouter}>{children}</Component>; }
import { type TemplateProps } from "rasengan"; export default function Template({ Head, Body, Script }: TemplateProps) { return ( <html lang="en"> <Head> <meta charSet="UTF-8" /> <link rel="icon" type="image/svg+xml" href="/rasengan.svg" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> </Head> <Body> <Script /> </Body> </html> ); }
import { renderApp } from 'rasengan/client'; import App from './main'; renderApp(App, { reactStrictMode: true });
touch tsconfig.json rasengan-env.d.ts
{ "compilerOptions": { "baseUrl": ".", "target": "ES2020", /* Bundler mode */ "moduleResolution": "bundler", "module": "ESNext", "jsx": "react-jsx", /* Aliases for intellisence */ "paths": { "@/*": ["src/*"] } }, "include": ["src", "rasengan-env.d.ts"], "extends": "./node_modules/rasengan/tsconfig.base.json" }
/// <reference types="rasengan/types/client" />
npm run dev
