```bash cd aidroute-frontend npm install ```
Create a .env file in the root directory:
```env
VITE_API_URL=http://localhost:8000/api
VITE_GOOGLE_MAPS_API_KEY=your_api_key_here ```
```bash npm run dev ```
Open http://localhost:3000 in your browser.
```bash npm run build ```
``` aidroute-frontend/ ├── public/ # Static assets ├── src/ │ ├── components/ # Reusable React components │ │ ├── Layout.jsx # Main app layout │ │ ├── Sidebar.jsx # Navigation sidebar │ │ ├── Header.jsx # Top header bar │ │ ├── EmergencyModal.jsx │ │ └── NotificationPanel.jsx │ ├── contexts/ # React contexts │ │ └── ThemeContext.jsx │ ├── pages/ # Page components │ │ ├── Login.jsx │ │ ├── Dashboard.jsx │ │ ├── Requests.jsx │ │ ├── Routes.jsx │ │ ├── Reports.jsx │ │ ├── Ethics.jsx │ │ └── Settings.jsx │ ├── utils/ # Utilities │ │ └── api.js # API configuration │ ├── App.jsx # Root component │ ├── main.jsx # Entry point │ └── index.css # Global styles ├── index.html ├── package.json ├── vite.config.js ├── tailwind.config.js └── postcss.config.js ```
- Role-based login (Admin/Hospital)
- Persistent authentication state
- Protected routes
- Real-time stats overview
- AI agent status indicators
- Urgent requests panel
- AI recommendations feed
- Emergency override modal
- Table and card view toggle
- Search and filter functionality
- Urgency color coding
- One-click AI triage trigger
- Map visualization (Google Maps ready)
- Live route tracking
- Route optimization button
- Detailed route information panel
- Interactive charts (Recharts)
- Request trends over time
- Tissue distribution pie chart
- Response time analytics
- PDF/CSV export
- Fairness score metrics
- Bias detection monitoring
- Recent fairness checks
- Compliance guidelines
- Audit history
- Notification preferences
- Dark/light theme toggle
- Privacy controls
- Data sharing options
Edit tailwind.config.js to customize color schemes:
```js colors: { primary: { ... }, // Cyan-blue scale accent: { ... }, // Indigo-purple scale } ```
Update src/utils/api.js to connect to your backend:
```js const API_URL = 'http://your-backend-url/api' ```
- Get API key from Google Cloud Console
- Add to
.env:VITE_GOOGLE_MAPS_API_KEY=... - Uncomment map components in Routes.jsx
- Install:
npm install @googlemaps/js-api-loader
Any email/password combination works for demo purposes.
- Chrome (recommended)
- Firefox
- Edge
- Safari
- Use React DevTools for component debugging
- Check browser console for API errors
- Network tab shows API calls
- Enable hot reload (automatic with Vite)
```bash
npm run dev -- --port 3001 ```
```bash
rm -rf node_modules package-lock.json npm install ```
```bash
npm run dev ```