Overview
The dashboard is your home base in Maxw AI, offering quick access to:- Recent classes from Canvas
- Upcoming assignments and due dates
- Pending tasks from your todo list
- Navigation to all major features
Dashboard Layout
The dashboard uses a clean, organized layout with these main sections:Dashboard Header
A personalized greeting displays:- Time-based greeting: “Good morning”, “Good afternoon”, or “Good evening”
- Your first name: Pulled from your user profile
- Welcome message: “Welcome back to your workspace”
Dashboard Cards
Information is organized into cards with consistent styling:- Icon-based headers
- Card titles
- Main content area
- Optional action links
Dashboard Sections
Recent Classes
Displays your most recent Canvas courses:Recent Classes
- Shows up to 4 most recent courses
- Each course card displays:
- Course name (clickable to view details)
- Course code
- Grid layout (2 columns)
- Hover effect for interactivity
- Empty state: “No classes found”
Upcoming Assignments
Shows your next assignments from Canvas:Upcoming Assignments
- Displays up to 3 upcoming assignments
- Each assignment shows:
- Assignment name (links to Canvas)
- Points possible
- Due date (human-readable format)
- “View all classes” action link
- Empty state: “No upcoming assignments! Enjoy your break.”
- “Today” for assignments due today
- “Tomorrow” for assignments due tomorrow
- “Next [Day]” for assignments due within the week
- Full date for assignments further out
humanReadableDate() utility function.
Tasks Summary
Quick overview of your todo list:Tasks
- Shows first 3 pending tasks
- Each task displays:
- Checkbox icon (visual only)
- Task title (“Untitled task” if no title)
- “Go to list” action link to full todo page
- Empty state: “No pending tasks. Good job!”
Component Structure
DashboardHeader Component
Location:apps/web/src/components/dashboard/dashboard-header.tsx
Features:
- Uses Better-Auth session for user data
useMemohook for efficient greeting calculation- Responsive typography with serif font for title
- Muted foreground color for secondary text
DashboardCard Component
Location:apps/web/src/components/dashboard/dashboard-card.tsx
Shared card wrapper providing:
- Consistent styling across all cards
- Icon-based headers
- Action link support
- Content area with custom class names
icon: Tabler icon componenttitle: Card header textactions: Array of action linkscontentClassName: Custom styles for content area
RecentClasses Component
Location:apps/web/src/components/dashboard/recent-classes.tsx
Props:
courses: Array ofCanvasCourseobjects
- 2-column responsive grid
- Course name and course code
- Hover effects for links
- Truncated text with
line-clamp-1
UpcomingAssignments Component
Location:apps/web/src/components/dashboard/upcoming-assignments.tsx
Props:
assignments: Array ofCanvasTodoItemobjects
- External links to Canvas (open in new tab)
- Points and due date display
- Human-readable date formatting
- Responsive layout
TodoSummary Component
Location:apps/web/src/components/dashboard/todo-summary.tsx
Data source: Uses useTodos() hook from apps/web/src/app/todo/use-todos
Features:
- Filters for unchecked tasks
- Limits to 3 items
- Visual checkbox indicators
- Fallback for untitled tasks
Data Flow
Canvas Data
Canvas information is loaded server-side:- Dashboard page calls
getAllCanvasCourses() - Fetches courses from Canvas API
- Retrieves upcoming assignments via Canvas Todo API
- Passes data as props to dashboard components
Todo Data
Todo information uses client-side fetching:TodoSummarycomponent callsuseTodos()hook- Hook queries backend API for user’s todos
- React Query manages caching and updates
- Component filters and displays first 3 pending items
User Data
User information from Better-Auth:DashboardHeaderusesauthClient.useSession()- Retrieves current user session
- Extracts user name for personalized greeting
- Session persists across navigation
Navigation Links
The dashboard provides quick navigation:Classes
View all Canvas courses and course materials
Todo List
Manage tasks and assignments
Study
Access study sets and flashcards
Responsive Design
The dashboard adapts to different screen sizes:- Desktop: Multi-column grid layouts, full content visible
- Tablet: Adjusted column counts, maintained spacing
- Mobile: Single-column stacking, touch-optimized interactions
grid-cols-1 md:grid-cols-2 lg:grid-cols-3- Responsive padding and margins
- Mobile-first design approach
Empty States
When no data is available, friendly messages appear:- No classes: “No classes found.”
- No assignments: “No upcoming assignments! Enjoy your break.”
- No tasks: “No pending tasks. Good job!”
Visual Design
Color Scheme
- Primary text: Default foreground color
- Secondary text: Muted foreground
- Cards: Card background with border
- Hover states: Accent background at 50% opacity
Typography
- Header: Large serif font (4xl) for warmth
- Card titles: Medium weight, appropriate sizing
- Body text: Regular weight, readable line heights
- Muted text: Subtle secondary information
Icons
Icons from Tabler Icons:IconBooks: Recent classesIconSchool: Upcoming assignmentsIconListCheck: Tasks summary
Accessibility
- Semantic HTML structure with proper headings
- ARIA labels on interactive elements
- Keyboard navigation support
- Focus indicators on links and buttons
- Sufficient color contrast for readability
Performance Optimization
Efficient Rendering
useMemofor greeting calculation (prevents unnecessary recalculation)- Component-level data fetching (parallel loading)
- React Query caching for todo data
- Limited item counts (3-4 items per section)
Data Loading
- Server-side Canvas data (faster initial load)
- Client-side todo data (dynamic updates)
- Cached session data (no repeated auth checks)
- Conditional rendering based on data availability
Integration Points
With Canvas LMS
Dashboard displays:- Active courses from Canvas API
- Upcoming assignments from Canvas Todo API
- Direct links to Canvas content
- Real-time course information
With Todo System
Dashboard shows:- Pending tasks from todo database
- Task titles and completion status
- Link to full todo application
- Live updates via React Query
With Study Tools
Future integration:- Recent study sets
- Study progress and streaks
- Upcoming study sessions
- Study goals and achievements
Customization Options
Potential Enhancements
- Customizable card order
- Widget selection (show/hide cards)
- Number of items per card (3, 5, 10)
- Theme customization
- Dashboard layouts (compact, comfortable, spacious)
User Preferences
Store in user settings:- Preferred greeting style
- Default view on login
- Card visibility preferences
- Item count per section
Best Practices
- Check dashboard daily: Stay updated on assignments and tasks
- Use quick links: Navigate efficiently to detailed views
- Review empty states: When sections are clear, you’re caught up
- Click through: Dashboard is a preview—click for full details
- Personalize later: Customize when customization options are added
Technical Implementation
Component Hierarchy
Data Sources
- Canvas courses:
getAllCanvasCourses()server action - Canvas assignments: Canvas Todo API via server action
- Todos:
useTodos()hook →/api/todosendpoint - User session: Better-Auth session hook
Styling Approach
All styling uses TailwindCSS 4:- Utility-first classes
- Custom components from shadcn/ui
- Consistent spacing and sizing
- Dark mode support via CSS variables
Future Enhancements
Planned dashboard features:- Study progress widget: Weekly study time and goals
- Grade tracking: GPA and grade trends
- Calendar view: Visual timeline of assignments and tasks
- Notifications: Upcoming deadlines and reminders
- Quick actions: Create task, start study session from dashboard
- Analytics: Productivity insights and completion rates