FridgeRadar’s frontend is a single-page application built with React 18.3 and bundled by Vite 5.4. Client-side routing is handled by React Router 6.26, and all API communication goes through Axios 1.7 pointed at theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/EstefanoARG/FridgeRadar/llms.txt
Use this file to discover all available pages before exploring further.
/api/v1 base URL. In development, Vite’s built-in dev server proxies those requests directly to the FastAPI backend — no CORS headers or separate configuration required.
Requirements
Node.js 18+
Vite 5 requires Node 18 or later. Run
node -v to confirm your version before installing.npm
Comes bundled with Node.js. The project uses npm scripts (
dev, build, preview) defined in package.json.Development
Start the Vite development server
http://localhost:5173). The terminal will print the exact local URL once the server is ready.Understand the API proxy
During development, all requests that begin with A call from the React app to
/api are automatically forwarded to the FastAPI backend. This is configured in vite.config.js:/api/v1/auth/login is transparently proxied to http://localhost:8000/api/v1/auth/login. The backend must be running on port 8000 for API calls to succeed.The
changeOrigin: true option rewrites the Host header so it matches the target, which is required when the backend enforces origin checking.Building for Production
Create the production bundle
frontend/dist/ directory. The output is a set of static HTML, CSS, and JavaScript files ready to be served by any web server.Production Deployment
In production there is no Vite dev server, so you need a web server to both serve the staticdist/ files and proxy /api requests to the FastAPI backend. nginx is the recommended choice.
nginx Configuration
/api/v1 resolves correctly in both development (Vite proxy) and production (nginx proxy), so no environment-specific Axios configuration is needed.
Axios Base URL
The Axios client inside the React app is pre-configured with:/api/v1/auth/login. Both the Vite proxy (/api → http://localhost:8000) and the nginx location /api/ block ensure those paths resolve to the FastAPI backend without any changes to the frontend code between environments.
Key Dependencies
| Package | Version | Role |
|---|---|---|
react | 18.3.1 | UI component library |
react-dom | 18.3.1 | React DOM renderer |
react-router-dom | 6.26.0 | Client-side routing |
axios | 1.7.3 | HTTP client for API calls |
vite | 5.4.0 | Build tool and dev server |
@vitejs/plugin-react | 4.3.1 | Vite React plugin (Fast Refresh) |
Available npm Scripts
| Script | Command | Description |
|---|---|---|
dev | npm run dev | Start Vite dev server on port 5173 with HMR |
build | npm run build | Bundle for production into dist/ |
preview | npm run preview | Serve the dist/ build locally for verification |