Inventory dashboard with a React frontend and an Express backend API.
- Frontend URL (Vercel/Netlify):
REPLACE_WITH_FRONTEND_URL - Backend URL (Render):
REPLACE_WITH_BACKEND_URL
cd backend
npm install
npm startBackend runs on http://localhost:3000.
cd frontend
npm install
npm run devFrontend runs on http://localhost:5173.
- Create a new Web Service from this repo.
- Configure:
- Root Directory:
backend - Build Command:
npm install - Start Command:
npm start
- Root Directory:
- Deploy and copy your Render URL.
- Verify endpoints:
GET <BACKEND_URL>/inventoryPOST <BACKEND_URL>/inventory- Optional health check:
GET <BACKEND_URL>/health
Deploy the frontend directory and set:
- Environment variable:
VITE_API_BASE_URL=<BACKEND_URL>
Recommended settings:
- Build command:
npm run build - Publish directory:
dist
After deploy, verify:
- Dashboard loads at public URL.
- Inventory list loads from deployed backend.
- Add Item form creates a new item via deployed backend.
- In local development, the frontend uses Vite proxy for
/inventory. - In production, the frontend uses
VITE_API_BASE_URL. - Backend CORS is enabled to allow hosted frontend requests.