The easiest way to build React apps with server-side rendering
The @lazarv/react-server is a tool that simplifies the process of building React apps with server-side rendering. It leverages the developer-friendly Vite for React development and incorporates the latest features of React 19. The framework offers a range of features aimed at enhancing the development experience and streamlining the creation of React applications.
Install
Use a package manager to add @lazarv/react-server to your project. For example, using pnpm:
pnpm add @lazarv/react-server
Create your app
Create an entry point for your app and export your root component as default.
Run your app
Start your app using the react-server command. If you prefer not to install the package and want a quick trial, use npx:
npx @lazarv/react-server ./App.jsx
Build
For a production build, run the build command. This will generate the necessary files for server and client-side rendering:
react-server build
Run in production
After a successful production build, start your app with the start command:
react-server start
File-system based routing
To enable file-system based routing, create a configuration file and specify the root property to define the starting point for processing files:
react-server.config.json
The @lazarv/react-server facilitates React app development by combining the ease of Vite for React with the latest features of React 19. It offers a variety of features like server components, server actions, file-system based routing, and enhanced performance optimizations. Installation is straightforward, and the framework provides a seamless development experience for React applications.