Skip to content

Getting Started With React (SPA)

New Project

If you like simplicity and don’t feel the need for SSR, you should try our React + Vite + Freestyle Template.

Existing Project

If you’re already using React + Vite, you’ll need to make a few changes to your project to get started.

  1. Copy the serve.ts into your root directory.

  2. Copy the freestyle.config.ts into your root directory.

  3. Install Freestyle

Terminal window
npm install freestyle-sh

Development

First, install your dependencies

npm install

To start the dev server run:

Terminal window
npx freestyle dev

Production / Deployment

To build your app for production, run:

Terminal window
npx freestyle build

This will create a dist folder with your built app.

To deploy your app, run:

Terminal window
npx freestyle deploy