Skip to main content

Overview

The dashboard analytics API provides a comprehensive view of user career progress, including:
  • Goal completion tracking
  • Skill development over time
  • Networking statistics
  • Event engagement metrics
  • Recommendation performance
Requires authentication and completed career onboarding.

Authentication

Requires a valid Supabase authentication token in the request headers.
Authorization: Bearer <supabase_access_token>

Rate Limiting

  • Limit: 20 requests per minute per user
  • Window: Sliding window (1 minute)
  • Response: HTTP 429 if rate limit exceeded

Request

HTTP Method

GET /api/dashboard/analytics

Query Parameters

includeRecommendations
boolean
default:"false"
Include personalized event recommendations in response
eventLimit
number
default:"50"
Number of upcoming events to analyze (max 100)

Response

Success Response (200)

success
boolean
required
Always true for successful requests
data
object
required

Error Responses

{
  "success": false,
  "error": "Authentication required"
}

Examples

Basic Analytics Request

curl -X GET "https://kurecal.app/api/dashboard/analytics" \
  -H "Authorization: Bearer <token>"

Analytics with Recommendations

curl -X GET "https://kurecal.app/api/dashboard/analytics?includeRecommendations=true&eventLimit=20" \
  -H "Authorization: Bearer <token>"

Display Goal Progress

const { data } = await fetch('/api/dashboard/analytics', {
  headers: { 'Authorization': `Bearer ${token}` }
}).then(r => r.json());

const { goalProgress } = data.analytics;

console.log(`Total Goals: ${goalProgress.totalGoals}`);
console.log(`Completed: ${goalProgress.completedGoals}`);
console.log(`In Progress: ${goalProgress.inProgressGoals}`);

goalProgress.goalBreakdown.forEach(goal => {
  console.log(`${goal.goal}: ${goal.progress}% (${goal.eventsAttended} events)`);
});

Analytics Computation

Goal Progress Calculation

Goal progress is calculated based on:
  • Events attended that align with goal
  • Skills gained related to goal
  • Time elapsed since goal set
  • Completion criteria (goal-specific)

Skill Development Tracking

Skill learning progress tracks:
  • Events attended for each skill
  • Practice time logged (if available)
  • Proficiency level changes
  • Peer comparison (optional)

Networking Metrics

Networking statistics include:
  • Direct connections made at events
  • Follow relationships established
  • Circle memberships joined
  • Event attendance overlap with network

Cache Strategy

Cache Headers

Cache-Control: private, max-age=120, stale-while-revalidate=300
X-Data-Freshness: 120s
X-Cache-Strategy: analytics-optimized
X-Processing-Time: 347

Cache Invalidation

Analytics cache is invalidated when:
  • User tracks/untracks an event
  • Career profile is updated
  • Goal completion status changes
  • Event attendance is marked
Cache TTL is 2 minutes with 5-minute stale-while-revalidate window for optimal performance.

Performance Considerations

Processing Time

  • Typical: 200-500ms
  • With recommendations: 400-800ms
  • Cold start: 800-1200ms (first request after cache expiry)

Optimization Strategies

  • Analytics computed using database aggregation functions
  • Tracked events fetched in lightweight mode (minimal fields)
  • Parallel computation of independent metrics
  • Incremental updates for frequently accessed data

Rate Limiting

To avoid hitting rate limits:
  • Cache analytics data on client for 2+ minutes
  • Use includeRecommendations=false when only analytics needed
  • Fetch analytics once per dashboard visit, not per component mount

Build docs developers (and LLMs) love