Skip to content

Dashboard Tutorial

Build an authenticated dashboard with interactive islands.

Overview

In this tutorial, you'll build a team dashboard featuring:

  • User authentication with sessions
  • Protected routes using middleware
  • Interactive widgets using islands architecture
  • Shared state between islands using signals
  • Real-time updates with WebSockets
  • Production deployment

Prerequisites

Before starting this tutorial, you should have:

What You'll Build

┌─────────────────────────────────────────────────────────────┐
│  Dashboard                         Welcome, John    [Logout]│
├────────────┬────────────────────────────────────────────────┤
│            │                                                │
│  Overview  │   ┌─────────┐ ┌─────────┐ ┌─────────┐         │
│  Analytics │   │  Users  │ │ Revenue │ │ Orders  │         │
│  Settings  │   │  1,234  │ │ $54,321 │ │   892   │         │
│            │   │  ↑ 12%  │ │  ↑ 8%   │ │  ↓ 3%   │         │
│            │   └─────────┘ └─────────┘ └─────────┘         │
│            │                                                │
│            │   ┌─────────────────────────────────────────┐ │
│            │   │            Revenue Chart                │ │
│            │   │    ╱╲    ╱╲                             │ │
│            │   │   ╱  ╲╱╱  ╲╱╲    ╱╲                     │ │
│            │   │  ╱          ╲╲╱╱  ╲                     │ │
│            │   └─────────────────────────────────────────┘ │
│            │                                                │
│            │   ┌──────────────────┐ ┌──────────────────┐   │
│            │   │  Activity Feed   │ │ Recent Actions   │   │
│            │   │  John: Created   │ │ ...              │   │
│            │   │  Jane: Updated   │ │                  │   │
│            │   └──────────────────┘ └──────────────────┘   │
└────────────┴────────────────────────────────────────────────┘

Chapters

ChapterTopicWhat You'll Learn
1. SetupProject SetupInitialize project, database, auth utilities
2. AuthenticationAuth FlowLogin, registration, sessions, protected routes
3. IslandsInteractive WidgetsStats, charts, activity feed as islands
4. AnalyticsShared StateDate picker, metric selector, shared signals
5. DeploymentProductionDocker, VPS, cloud platforms

Key Concepts Covered

Authentication

  • Password hashing with bcrypt
  • Session-based auth with cookies
  • Protected routes with middleware
  • Login/register/logout flows

Islands Architecture

  • Selective hydration strategies
  • Different hydration triggers (load, visible, idle)
  • Shared state between islands using signals
  • Optimistic UI updates

Real-Time Features

  • Live data updates with polling
  • WebSocket connections
  • Auto-scrolling activity feeds

Quick Start

bash
# Create new project
bunx create-ereo@latest dashboard-app
cd dashboard-app

# Install dependencies
bun add @ereo/auth bcrypt
bun add -d @types/bcrypt

# Start development
bun dev

Final Code

The complete dashboard example is available in the repository:

bash
git clone https://github.com/ereoJS/ereoJS
cd ereo/packages/examples/dashboard
bun install
bun dev

Next Steps

After completing this tutorial:


Start the Tutorial →

Released under the MIT License.