Tutorial: User Dashboard
Build a comprehensive user dashboard with analytics, settings, and activity tracking.
What You'll Build#
- Dashboard overview with metrics
- Usage analytics charts
- Account settings page
- Activity feed
- Responsive sidebar navigation
Prerequisites#
- Next.js project with authentication (see Authentication Tutorial)
- Prisma with PostgreSQL
- Bootspring initialized
Time Required#
Approximately 40 minutes.
Step 1: Plan with Architecture Expert#
Start by consulting the architecture-expert:
Loading code block...
The agent will provide:
- Component architecture
- Data requirements
- API endpoints
- State management approach
Step 2: Design the Database Schema#
Ask the database-expert:
Loading code block...
Update your Prisma schema:
Loading code block...
Run the migration:
Loading code block...
Step 3: Create Dashboard Layout#
Ask the frontend-expert:
Loading code block...
Dashboard Layout#
Loading code block...
Sidebar Component#
Loading code block...
Dashboard Header#
Loading code block...
Step 4: Create Dashboard Overview#
Dashboard API#
Loading code block...
Dashboard Page#
Loading code block...
Stats Cards Component#
Loading code block...
Step 5: Create Usage Analytics Chart#
Loading code block...
Install recharts:
Loading code block...
Step 6: Create Activity Feed#
Loading code block...
Step 7: Create Settings Page#
Loading code block...
Step 8: Test the Dashboard#
-
Start the development server:
Loading code block... -
Sign in and navigate to
/dashboard -
Verify:
- Sidebar navigation works
- Stats cards display data
- Usage chart renders
- Activity feed shows entries
- Settings page loads
Verification Checklist#
- Layout is responsive
- Protected routes work
- Data fetching is efficient
- Charts render correctly
- Navigation is intuitive
Security Review#
Loading code block...
What You Learned#
- Dashboard layout architecture
- Server components for data fetching
- Client components for interactivity
- Usage tracking implementation
- Settings management