Dashboard API Infrastructure
Component Detail
Infrastructure
low complexity
backend
2
Dependencies
0
Dependents
0
Entities
0
Integrations
Description
Next.js API route handlers for the admin dashboard endpoints (/api/v1/admin/dashboard). Handles request authentication, role authorization, input validation via Zod, and response serialization. Implements SWR-compatible Cache-Control headers to support client-side revalidation without redundant server load.
dashboard-api-infrastructure
Responsibilities
- Define and export the /api/v1/admin/dashboard route handler
- Validate and parse query parameters (organizationId, dateRange) using Zod
- Enforce JWT authentication and role authorization before delegating to Analytics Service
- Set appropriate Cache-Control and ETag headers for SWR revalidation compatibility
Interfaces
GET /api/v1/admin/dashboard
GET /api/v1/admin/dashboard/trend
GET /api/v1/admin/dashboard/associations
validateDashboardQueryParams(query)
serializeDashboardResponse(kpiData)
Relationships
Dependencies (2)
Components this component depends on