Getting started

Creating a Universal Scripts project is very easy. Using npx, just do:

npx create-react-app --scripts-version universal-scripts <app-name>

When it finishes you’ll have a project ready to start developing. Enter the project folder and run:

npm start

It will start a development server on localhost:3000, watching for changes in any files on your project, and live-reloading them, similar to other Create React App projects.

Folder structure

Your new project already contains some predefined folders:

TypeScript

If you would rather use TypeScript, you can create your project using our alternate TypeScript template, by doing:

npx create-react-app --scripts-version universal-scripts --template universal-ts <app-name>

All the config and structure is exactly the same, but using TypeScript.

Custom templates

Just like stock Create React App, we support the use of custom templates during project init.

Not all CRA templates will be compatible, though: they must contain the required entrypoints provided in our base template, cra-template-universal. If you want to create your custom template, we recommend using it as a starting point.

Next steps

Now let’s see how to handle data fetching both on the client and the server.