-
Notifications
You must be signed in to change notification settings - Fork 0
Frontend Application
- Introduction
- Project Structure
- Core Components
- Architecture Overview
- Detailed Component Analysis
- Dependency Analysis
- Performance Considerations
- Troubleshooting Guide
- Conclusion
- Appendices
This document describes the AgentID frontend React application, focusing on the user interface and component architecture. It explains the routing configuration, state management approach, and styling strategy using TailwindCSS.
The frontend is a Vite-powered React application with:
- Pages under src/pages for route handlers
- Reusable components under src/components
- Shared API client under src/lib/api.js
- Global styles under src/index.css
- Routing and navigation in src/App.jsx
graph TB
subgraph "Entry"
MAIN["main.jsx"]
APP["App.jsx"]
end
subgraph "Routing"
ROUTES["React Router Routes"]
NAV["Navigation"]
end
subgraph "Pages"
REG["Registry.jsx"]
DETAIL["AgentDetail.jsx"]
REGISTER["Register.jsx"]
DISCOVER["Discover.jsx"]
end
subgraph "Components"
BADGE["TrustBadge.jsx"]
REP["ReputationBreakdown.jsx"]
CAPS["CapabilityList.jsx"]
FLAG["FlagModal.jsx"]
end
subgraph "API"
API["api.js"]
end
MAIN --> APP
APP --> ROUTES
ROUTES --> REG
ROUTES --> DETAIL
ROUTES --> REGISTER
ROUTES --> DISCOVER
DETAIL --> BADGE
DETAIL --> REP
DETAIL --> CAPS
DETAIL --> FLAG
REG --> BADGE
DISCOVER --> BADGE
DISCOVER --> CAPS
REGISTER --> BADGE
REG --> API
DETAIL --> API
REGISTER --> API
DISCOVER --> API
- Navigation and Footer: Provide global site layout and links.
- Pages:
- Registry: Browse agents with filters, pagination
- AgentDetail: View agent profile, reputation, capabilities
- Register: Multi-step agent onboarding
- Discover: Capability-based agent discovery
- Reusable Components:
- TrustBadge: Visual trust status and score display
- ReputationBreakdown: Five-factor reputation scoring
- CapabilityList: Capability tags with categorization
- FlagModal: Enhanced modal for reporting agents
The app uses React Router for client-side routing and a shared Axios-based API client. Pages orchestrate state and render reusable components. Styling relies on TailwindCSS with a custom dark theme.
Routes:
- "/" → Registry
- "/agents/:pubkey" → AgentDetail
- "/register" → Register
- "/discover" → Discover
State: agents, loading, error, filters, pagination Behavior:
- Fetches paginated agent list with filters
- Renders skeletons while loading
- Pagination controls
State: agent, badge, reputation, attestations, flags Behavior:
- Parallel fetch of agent data
- Flag submission with cryptographic authentication
- Handles 404 and generic errors
Multi-step workflow:
- Collect pubkey and name
- Fetch challenge, user signs
- Optional metadata
- Review and submit
TrustBadge
- Props: status, name, score, registeredAt, totalActions
- Status-dependent styling (verified/unverified/flagged)
FlagModal
- Enhanced with Ed25519 signature requirements
- Cryptographic message construction
- Real-time message generation
- Runtime: React, ReactDOM, React Router, Axios
- Dev: Vite, TailwindCSS, ESLint
- Build: Multi-page with widget entry point
- Parallel API fetching in AgentDetail
- Pagination in Registry
- Skeleton loaders for perceived performance
- 401 responses clear stored token
- Check proxy configuration for network errors
- Form validation in Register steps
The AgentID frontend is a modular, theme-consistent React application with clear separation of concerns.
- Registry: Pass TrustBadge to each agent card
- AgentDetail: Compose TrustBadge, ReputationBreakdown, CapabilityList
- Register: Use FormField, TextAreaField, CapabilitiesInput