Getting started

🚀 Thanks to StackBlitz, you can now try Rakkas online, right in your browser!

The easiest way to try Rakkas out on your computer is to use the project initializer:

# Create the project directory
mkdir my-app && cd my-app
# Scaffold the demo app: Follow the prompts for the rest
npx create-rakkas-app@latest

create-rakkas-app project initializer comes with many features, all off which are optional but we strongly recommend enabling TypeScript and the generation of a demo project on your first try because self-documenting type definitions allow for a smoother learning curve and the demo project source code comes with plenty of comments. You may not need this guide!

👷 If you prefer a manual setup, you can install rakkasjs, @rakkasjs/runner-node, react, react-dom, and react-helmet-async as production dependencies, and @rakkasjs/cli as a dev dependency:

npm install --save rakkasjs @rakkasjs/runner-node react react-dom react-helmet-async
npm install --save-dev @rakkasjs/cli

Then you can start a development server on localhost:3000 with npx rakkas dev, build with npx rakkas build, and launch with npx @rakkasjs/runner-node.

Project structure

By default, create-rakkas-app generates a project with the following structure:

PathDescription
/package.jsonnpm package file
/rakkas.config.js¹Rakkas configuration file
/publicStatic files to be served from /
/src/client.js¹Client-side customization hooks
/src/server.js¹Server-side customization hooks
/src/pagesPages and layouts (client-side routes)
/src/apiEndpoints and middlewares (server-side routes)

¹ The extension can also be .ts, .jsx, or .tsx.