This document outlines how to build and deploy the Circle Frontend.
The project uses Vite for bundling.
-
Install Dependencies
npm install
-
Type Check & Compile It's recommended to run a type check before building to catch any TypeScript errors.
npm run build
(Note:
npm run buildexecutestsc -b && vite build)Output: A
dist/folder containing the optimized production assets (HTML, CSS, JS). -
Preview Build To test the production build locally:
npm run preview
This project includes a vercel.json and is optimized for Vercel.
- Push your code to GitHub.
- Import project into Vercel.
- Build Command:
npm run build - Output Directory:
dist - Environment Variables: Add your
VITE_API_BASE_URLin the project settings.
Since the output is static, you can deploy the dist/ folder to any static hosting provider.
Important for Client-Side Routing:
Ensure your host is configured to redirect all 404s to index.html. This is necessary for React Router to handle deep links.
Example Nginx Config:
location / {
try_files $uri $uri/ /index.html;
}