# How to deploy a React app without DevOps

Deploy a React frontend by letting Ample detect whether it is a static Vite build or part of a server-rendered application.

## The short version

You do not need to hand-configure a server to deploy a React app. Ample inspects the project, runs its production build, and publishes the result using the runtime the project needs. A Vite React app is usually a static deployment, while a Next.js or custom React server uses a Node runtime.

## Who this is for

This guide is for React builders who can run the app locally but do not want to configure a VM, reverse proxy, certificate, and release process themselves.

## How to do it

1. **Confirm the React project type.** Check package.json and the framework config. Vite, Next.js, and custom Node servers have different production outputs even though they all use React.

2. **Run a production build locally.** Use the project's existing build script. Fix missing imports, type errors, and required public environment variables before deploying.
   ```sh
   $ npm run build
   ```

3. **Let Ample plan the runtime.** The plan records whether the app is static or needs Node, along with any linked API or database.
   ```sh
   $ ample plan --write
   ```

4. **Deploy.** Apply the plan and wait for the public URL. The platform activates the release after its health check succeeds.
   ```sh
   $ ample up
   ```

## What this supports

- Vite React static sites
- Next.js React applications
- React frontends linked to a separate API
- npm, pnpm, yarn, and bun projects

## Know the limits

- React alone does not identify the production runtime
- Browser-visible environment variables are public and must not contain secrets
- Workspace projects with internal packages should deploy from the workspace root

## Common failure modes

- **The browser loads an empty root** Check asset paths, client errors, and the built output rather than relying only on the development server.
- **The frontend calls localhost** Inject the deployed API URL through a framework-appropriate public environment variable or Ample link.
- **A workspace package cannot be resolved** Deploy from the workspace root and keep the workspace lockfile and sibling package available to the build.
