|
1 | 1 | # @agent-safe/web |
2 | 2 |
|
3 | | -Next.js frontend dashboard for AgentSafe. |
| 3 | +Next.js frontend dashboard for AgentSafe + SwarmGuard. |
4 | 4 |
|
5 | 5 | ## Pages |
6 | 6 |
|
7 | 7 | | Route | Description | |
8 | 8 | |-------|-------------| |
9 | | -| `/` | Dashboard – balance, risk status, recent events | |
10 | | -| `/transactions` | Transaction preview with simulation + risk scoring | |
11 | | -| `/governance` | Proposals feed, recommendations, veto/vote controls | |
12 | | -| `/swarm` | Real-time swarm agent activity feed | |
13 | | -| `/policies` | Policy engine configuration + kill switch | |
| 9 | +| `/dashboard` | Overview — swarm status, agent count, proposals, sponsor summary | |
| 10 | +| `/defense` | **SwarmGuard** — evaluate transactions, agent feed + consensus + intent preview | |
| 11 | +| `/governance` | **GovernanceSafe** — proposals list, AI recommendation, auto-vote toggle, veto | |
| 12 | +| `/policy` | Policy engine rules + consensus simulator | |
| 13 | +| `/integrations` | **Sponsor Proof Panel** — Base, QuickNode, Kite AI, Nouns, 0g | |
| 14 | +| `/swarm` | Legacy swarm activity feed | |
| 15 | +| `/transactions` | Legacy transaction preview with simulation + risk scoring | |
| 16 | +| `/policies` | Legacy policy settings + kill switch | |
14 | 17 |
|
15 | | -## Run |
| 18 | +## Setup |
16 | 19 |
|
17 | 20 | ```bash |
18 | | -pnpm dev # starts on http://localhost:3000 |
| 21 | +# 1. Copy env |
| 22 | +cp .env.example .env.local |
| 23 | + |
| 24 | +# 2. Install deps (from repo root) |
| 25 | +pnpm install |
| 26 | + |
| 27 | +# 3. Start backend (in another terminal) |
| 28 | +cd apps/backend && pnpm dev # http://localhost:4000 |
| 29 | + |
| 30 | +# 4. Start frontend |
| 31 | +cd apps/web && pnpm dev # http://localhost:3000 |
19 | 32 | ``` |
| 33 | + |
| 34 | +## Environment Variables |
| 35 | + |
| 36 | +| Variable | Default | Description | |
| 37 | +|----------|---------|-------------| |
| 38 | +| `NEXT_PUBLIC_BACKEND_URL` | `http://localhost:4000` | Backend API base URL | |
| 39 | +| `NEXT_PUBLIC_BASE_CHAIN_ID` | `8453` | Base chain ID | |
| 40 | + |
| 41 | +## Screenshots Checklist (for bounties) |
| 42 | + |
| 43 | +1. **`/integrations`** — Sponsor proof panel showing Base contracts, QuickNode health, Kite AI test, Nouns proposals |
| 44 | +2. **`/defense`** — Submit tx → SwarmGuard agent timeline + consensus + intent card |
| 45 | +3. **`/governance`** — Proposal list → "Get AI Recommendation" → VoteIntent display + veto |
| 46 | +4. **`/dashboard`** — Overview with live status from backend |
| 47 | + |
| 48 | +## Architecture |
| 49 | + |
| 50 | +- **Backend client**: `src/services/backendClient.ts` — typed API client with timeout + error handling |
| 51 | +- **Components**: `SwarmFeed.tsx`, `IntentCard.tsx`, `ProposalCard.tsx`, `StatusCard.tsx` |
| 52 | +- **App Router**: Next.js 15 with `src/app/` routing |
| 53 | +- **Shared types**: imported from `@agent-safe/shared` |
0 commit comments