Dashboard API
Dashboard data aggregation and overview endpoint
Dashboard API
The Dashboard API provides aggregated data for the user dashboard, including today's classes, upcoming deadlines, recent notes, and recent study materials.
Dashboard Response Model
- todaysClasses: Array of today's class events (max 3 items)
- upcomingDeadlines: Array of upcoming deadline events (max 3 items)
- recentNotes: Array of recently created notes (max 10 items)
- recentStudyAssets: Array of recent study materials (max 10 items)
Calendar Event Model
- id: Unique event identifier (string)
- title: Event title (string)
- description: Event description (string, optional)
- startDate: Event start date/time (string, ISO datetime)
- endDate: Event end date/time (string, optional, ISO datetime)
- eventType: Type of event (string: "CLASS" | "DEADLINE" | "EXAM" | "MEETING" | "STUDY_SESSION")
- location: Event location (string, optional)
- priority: Event priority level (string: "LOW" | "MEDIUM" | "HIGH")
- color: Display color for event (string)
- courseId: Associated course ID (string, optional)
- userId: Owner user ID (string)
- createdAt: ISO datetime when created (string)
- updatedAt: ISO datetime when last updated (string)
Study Asset Model
- id: Unique asset identifier (string)
- title: Asset title (string)
- description: Asset description (string, optional) - for flashcards and quizzes
- content: Asset content (string, optional) - for study guides
- type: Type of study asset (string: "flashcard_set" | "quiz" | "study_guide")
- difficulty: Difficulty level (string: "EASY" | "MEDIUM" | "HARD") - for flashcards and quizzes
- courseId: Associated course ID (string, optional)
- course: Associated course information (object, optional)
- createdAt: ISO datetime when created (string)
- updatedAt: ISO datetime when last updated (string)
Course Info Model
- id: Course identifier (string)
- name: Course name (string)
- color: Course display color (string)
- emoji: Course emoji (string)
Endpoint
The dashboard API has a single endpoint that requires authentication and is scoped to the authenticated user.
Get Dashboard Data
Retrieve comprehensive dashboard overview including today's classes, upcoming deadlines, recent notes, and recent study materials.
GET /api/dashboardResponse (200)
{
"todaysClasses": [
{
"id": "event_abc123",
"title": "Biology Lecture",
"description": "Cell structure and function",
"startDate": "2024-01-15T10:00:00.000Z",
"endDate": "2024-01-15T11:30:00.000Z",
"eventType": "CLASS",
"location": "Science Building Room 101",
"priority": "MEDIUM",
"color": "blue",
"courseId": "course_abc123",
"userId": "user_123",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
],
"upcomingDeadlines": [
{
"id": "event_def456",
"title": "Biology Assignment Due",
"description": "Cell biology research paper",
"startDate": "2024-01-20T23:59:00.000Z",
"endDate": null,
"eventType": "DEADLINE",
"location": null,
"priority": "HIGH",
"color": "red",
"courseId": "course_abc123",
"userId": "user_123",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
],
"recentNotes": [
{
"id": "note_abc123",
"title": "Lecture 1: Introduction to Biology",
"content": "Overview of biological concepts...",
"transcript": "Welcome to biology class...",
"audioPath": "audio/user_123/note_abc123.mp3",
"youtubeUrl": null,
"status": "COMPLETED",
"courseId": "course_abc123",
"userId": "user_123",
"createdAt": "2024-01-10T00:00:00.000Z",
"updatedAt": "2024-01-10T12:00:00.000Z"
}
],
"recentStudyAssets": [
{
"id": "flashcard_set_abc123",
"title": "Biology Chapter 1 Flashcards",
"description": "Cell structure and function",
"type": "flashcard_set",
"difficulty": "MEDIUM",
"courseId": "course_abc123",
"course": {
"id": "course_abc123",
"name": "Biology 101",
"color": "green",
"emoji": "🧬"
},
"createdAt": "2024-01-08T00:00:00.000Z",
"updatedAt": "2024-01-08T15:00:00.000Z"
},
{
"id": "quiz_def456",
"title": "Biology Chapter 1 Quiz",
"description": "Test your knowledge of cell biology",
"type": "quiz",
"difficulty": "MEDIUM",
"courseId": "course_abc123",
"course": {
"id": "course_abc123",
"name": "Biology 101",
"color": "green",
"emoji": "🧬"
},
"createdAt": "2024-01-09T00:00:00.000Z",
"updatedAt": "2024-01-09T10:00:00.000Z"
},
{
"id": "study_guide_ghi789",
"title": "Biology Study Guide",
"content": "Comprehensive study guide for biology...",
"type": "study_guide",
"courseId": "course_abc123",
"course": {
"id": "course_abc123",
"name": "Biology 101",
"color": "green",
"emoji": "🧬"
},
"createdAt": "2024-01-07T00:00:00.000Z",
"updatedAt": "2024-01-07T20:00:00.000Z"
}
]
}Errors:
401: Unauthorized - Authentication required
Data Specifications
Today's Classes
- Limit: Maximum 3 events
- Filter: Only events with
eventType: "CLASS" - Date Range: Events starting today (from start of day to start of next day)
- Sort Order: Ascending by start date (earliest first)
Upcoming Deadlines
- Limit: Maximum 3 events
- Filter: Only events with
eventType: "DEADLINE" - Date Range: Events starting after current time (future deadlines only)
- Sort Order: Ascending by start date (soonest first)
Recent Notes
- Limit: Maximum 10 notes
- Filter: All notes belonging to the user
- Sort Order: Descending by creation date (newest first)
Recent Study Assets
- Limit: Maximum 10 items total
- Content Types: Flashcard sets, quizzes, and study guides combined
- Sort Order: Descending by creation date (newest first)
- Type Field: Each item includes a
typefield indicating "flashcard_set", "quiz", or "study_guide"
Response Format
Unlike other API endpoints, the dashboard endpoint returns data directly without wrapping it in a success/data structure. The response is a plain object containing the four main data arrays.
Authentication
The dashboard endpoint requires session-based authentication. Users must be authenticated through the /api/auth/signin endpoint first. Unauthorized requests return a 401 error.
Use Cases
The dashboard data is designed to provide users with:
- Quick Schedule Overview: See today's classes at a glance
- Deadline Awareness: Stay on top of upcoming assignment due dates
- Recent Activity: Quick access to recently created notes
- Study Material Access: Easy navigation to recently created study materials
Related Resources
Dashboard data integrates with:
- Calendar API: Today's classes and deadlines come from calendar events
- Notes API: Recent notes display
- Flashcards API: Recent flashcard sets in study assets
- Quizzes API: Recent quizzes in study assets
- Study Guides API: Recent study guides in study assets
- Courses API: Course information attached to all content