# NFC-Admin — 100% Live API

All pages load data from `http://66.116.206.165:8201/api/v1` (see `.env`).

## Setup

```env
VITE_API_BASE_URL=http://66.116.206.165:8201/api/v1
```

```text
npm install
npm run dev
```

Login: `admin@example.com` + password from backend `ADMIN_PASSWORD`.

## API mapping (every screen)

| Screen | API |
|--------|-----|
| Login / Topbar | `/auth/login`, `/auth/me` |
| Dashboard | `/nfc/cards`, `/analytics/*`, `/logs/activity` |
| My Cards / Write / Rewrite / Bulk | `/nfc/*` |
| Scan / Device / Geo analytics | `/analytics/scans`, `/devices`, `/geo` |
| Activity / Audit / Tracking | `/logs/activity`, `/logs/audit`, `/accessEvents` |
| API Integrations | `/api-keys`, `/webhooks` |
| Bar Council (all 14 pages) | `/advocates`, `/chambers`, `/feeRecords`, … |
| Hardware | `/devices`, `/organizations`, `/roles`, `/permissions` |
| Doors / Alerts / Entry | `/doors`, `/alerts`, `/accessEvents` |
| Wallet / Subscription / Billing | `/wallets`, `/walletTransactions`, `/plans`, `/subscriptions`, `/invoices` |
| Templates | `/nfcTemplates` |
| Leads | `/leads` |
| Help / Tickets | `/supportTickets`, `/faqs` |
| Reviews | `/reviews` |
| Court hearings | `/courtHearings` |
| Users | `/staff` |

## Hooks

- `useLiveRows('collection')` — any CRUD collection
- `useNfcCards()`, `useActivityLogs()`, `useAuditLogs()`, `useScanAnalytics()`, etc.

No mock fallbacks — empty database shows empty tables (add data via UI or API).

## Backend

New collections added for full coverage: `nfcTemplates`, `supportTickets`, `courtHearings`, `leads`, `reviews`.

Redeploy backend after pulling `router.py` changes.
