Skip to content

react-app

One Vite app carrying the whole front end: an RTK Query data layer over the API, better-auth sessions and route guards, the login and signup screens as routes, a shadcn-style UI kit with light and dark themes, and generated API types. Optionally, a public marketing site at / and an admin console at /admin.

Terminal window
stack new react-app ./web --name shop-web --with marketing,admin

Stack: Vite 8, React 19, react-router, Redux Toolkit and RTK Query, better-auth, Tailwind CSS 4 with Radix components, Formik and Zod, OpenObserve RUM. Served by nginx in Docker.

Dev server yarn dev on port 3000
Routes src/routes/: app pages, auth/, legal/, marketing/, admin/
Shared code src/shared/: ui, api, auth, layouts, types, telemetry
Talks to the API at VITE_APP_API_URL, auth at ${VITE_APP_API_URL}/auth
Build output a static bundle; VITE_* values are baked in at build time
Tests none shipped: format:check, lint, typecheck and build

Start with react-app: one origin, one build, one image. Auth screens are routes (/login), so the session guard navigates within the app and there’s no cross-subdomain cookie to configure. Choose react-monorepo when surfaces must ship on different cadences, scale separately or be locked down on their own (see Choosing templates).

The shared code is the same files: react-app is derived from react-monorepo, which flattens its packages into src/shared/*.