Shadboard Documentation

repository·main·Indexed 20 days ago

https://github.com/qualiora/shadboard

An open-source admin dashboard template built with Next.js 15, React 19, and Shadcn/UI. It features a production-ready foundation with Tailwind CSS 4, NextAuth.js for authentication, and a built-in theme customizer. The template includes pre-built productivity apps (Email, Chat, Calendar, Kanban), business pages, and a comprehensive authentication flow.

Tokens
18K
Snippets
45
Records
60
Agent score
71%

What's inside Shadboard

  1. Overview of Shadboard

    main
    Shadboard is an open-source admin dashboard template designed for building scalable, user-friendly web applications. It is built on a modern stack featuring Next.js 15 and React 19, utilizing Shadcn/ui and Radix UI for accessible, high-quality components. The template is highly customizable, supports internationalization (I18n), and includes integrated authentication and a theme customizer.
  2. Overview of Shadboard features and technology stack

    main

    Shadboard is an open-source admin dashboard template designed for building scalable web applications. It is built on a modern stack including Next.js 15, React 19, and Tailwind CSS 4.

    Core Capabilities

    • Theming & Layout: Supports Light/Dark mode, responsive design, and multiple layout options (Horizontal/Vertical).
    • Localization: Built-in support for LTR (Left-to-Right) and RTL (Right-to-Left) text directions, along with Internationalization (I18n) support.
    • Form & Auth: Integrates React Hook Form for state management/validation and NextAuth.js for secure authentication.
    • Component System: Uses Shadcn/ui for a highly customizable and modern UI component library.
    • Language Support: Compatible with both TypeScript and JavaScript.
  3. Core Technologies in Shadboard

    main

    Shadboard utilizes the following technology stack:

    • Frameworks: React 19, Next.js 15 (App Router support)
    • Styling & UI: Tailwind CSS 4, Radix UI, shadcn/ui
    • Authentication: NextAuth.js
    • Form & Validation: Zod, React Hook Form
    • Icons: Lucide, React Icons
    • Data Visualization & Tables: Recharts, TanStack Table
    • Components: Embla Carousel, FullCalendar
  4. Configure Route Protection via `routeMap`

    main

    Route protection is managed in src/configs/auth-routes.ts using a routeMap. The middleware checks the current pathname against this map to determine access.

    Route Types

    • "guest": Accessible only to unauthenticated users. Authenticated users are redirected away (e.g., to the dashboard).
    • "public": Accessible to both authenticated and unauthenticated users.
    • "protected" (Default): Any route not explicitly defined in the map is considered protected and requires authentication.

    Exceptions

    For "public" routes, you can define an exceptions array to protect specific sub-paths within that route.

    Example Configuration

    import type { RouteType } from "@/types"
    
    export const routeMap = new Map<string, RouteType>([
      ["/sign-in", { type: "guest" }],
      ["/home", { type: "public", exceptions: ["/home/items"] }],
      ["/docs", { type: "public" }],
    ])
    import type { RouteType } from "@/types"
    
    export const routeMap = new Map<string, RouteType>([
      ["/sign-in", { type: "guest" }], // Only unauthenticated users can access sign-in
      ["/register", { type: "guest" }], // Only unauthenticated users can access register
      ["/forgot-password", { type: "guest" }], // Only unauthenticated users can access forgot-password
      ["/verify-email", { type: "guest" }], // Only unauthenticated users can access verify-email
      ["/new-password", { type: "guest" }], // Only unauthenticated users can access new-password
      ["/home", { type: "public", exceptions: ["/home/items"] }], // Home is public, but /home/items is protected
      ["/docs", { type: "public" }], // Docs page is public
    ])
  5. Run the Shadboard starter-kit development server

    main

    To start the development server for the Shadboard starter-kit, use your preferred package manager to run the dev script. Once running, the application will be available at http://localhost:3000.

    npm run dev
    # or
    yarn dev
    # or
    pnpm dev
    # or
    bun dev
  6. Update Providers and Package Scripts

    main

    After adding authentication files, perform these final setup steps:

    1. Update Providers: In src/providers/index.tsx, ensure the NextAuth provider is included and that you pass the session prop.
    2. Update package.json: Add the following scripts to handle Prisma migrations and client generation:
      "scripts": {
          "migrate": "pnpm exec prisma migrate dev",
          "postinstall": "pnpm exec prisma generate"
      }
    3. Generate Prisma Client: Run pnpm exec prisma generate to initialize the client.
    "scripts": {
        "migrate": "pnpm exec prisma migrate dev",
        "postinstall": "pnpm exec prisma generate"
    }
  7. Install Shadboard Full Kit or Starter Kit

    main

    Follow these steps to set up your Shadboard project. You can choose between the Full Kit (includes all features, apps, and pages) or the Starter Kit (minimal setup for easy customization).

    1. Prerequisites

    Ensure your system meets these requirements:

    • Node.js: version 18.18 or later.
    • pnpm: The preferred package manager. Install it globally via npm:
      npm install -g pnpm
    • Operating System: macOS, Windows (including WSL), or Linux.
    • Code Editor: VSCode is recommended.

    2. Download and Extract

    1. Download the zipped project file.
    2. Extract the zip file. You will see typescript-version and javascript-version folders.
    3. Choose your preferred version (Full Kit or Starter Kit) and language (TypeScript or JavaScript).
    4. Open the selected folder in your code editor.

    3. Install and Run

    Navigate to your project directory in the terminal and execute the following commands:

    Install dependencies:

    pnpm install

    Launch the development server:

    pnpm run dev

    The application will be available at http://localhost:3000 by default.

    pnpm install
    pnpm run dev