Skip to content

dbjpanda/dashboard-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Dashboard Starter

A modern, beautiful dashboard starter template with mock authentication and a complete UI component library. Built with React, TypeScript, TanStack Router, and Tailwind CSS.

Features

  • 🎨 Beautiful UI Components - Full shadcn/ui component library with dark/light theme
  • πŸ” Zustand Authentication - Mock auth using Zustand with localStorage persistence
  • 🏒 Organization Management - Multi-organization support with switcher
  • πŸ“± Responsive Design - Works perfectly on desktop, tablet, and mobile
  • ⚑ Fast Development - Hot reload with Vite
  • 🎯 Type Safe - Full TypeScript support
  • 🎨 Customizable - Easy to modify and extend
  • πŸ” Command Palette - Quick navigation with keyboard shortcuts
  • πŸ“š Cursor AI Ready - Comprehensive rules for AI-assisted development

Tech Stack

  • Framework: React 19
  • Build Tool: Vite 7
  • Routing: TanStack Router
  • Styling: Tailwind CSS 4
  • UI Components: Radix UI + shadcn/ui
  • State Management: Zustand
  • Icons: Lucide React
  • Type Checking: TypeScript

Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

  1. Clone or navigate to the dashboard-starter directory:
cd dashboard-starter
  1. Install dependencies:
npm install
  1. Start the development server:
npm run dev

The app will open at http://localhost:5173 (or another port if 5173 is in use).

Project Structure

dashboard-starter/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ auth/              # Authentication forms (signin, signup)
β”‚   β”‚   β”œβ”€β”€ layout/            # Layout components (sidebar, header, footer)
β”‚   β”‚   β”œβ”€β”€ shared/            # Shared components (theme provider, toggle)
β”‚   β”‚   └── ui/                # UI component library (shadcn/ui)
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ use-auth.ts        # Authentication hook (uses Zustand)
β”‚   β”‚   β”œβ”€β”€ use-organization.ts # Organization management hook
β”‚   β”‚   β”œβ”€β”€ use-mobile.ts      # Mobile detection hook
β”‚   β”‚   └── use-command-palette.ts # Command palette hook
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ mock-data.ts       # Mock data (users, organizations, stats)
β”‚   β”‚   └── utils.ts           # Utility functions
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ __root.tsx         # Root route
β”‚   β”‚   β”œβ”€β”€ index.tsx          # Home page (redirects)
β”‚   β”‚   β”œβ”€β”€ (auth)/            # Auth routes (login, signup)
β”‚   β”‚   └── (app)/             # Protected app routes
β”‚   β”‚       β”œβ”€β”€ layout.tsx     # App layout with sidebar
β”‚   β”‚       └── overview/      # Overview dashboard page
β”‚   β”œβ”€β”€ stores/
β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”œβ”€β”€ auth-store.ts      # Authentication state (Zustand)
β”‚   β”‚   └── organization-store.ts  # Organization state (Zustand)
β”‚   β”œβ”€β”€ main.tsx               # App entry point
β”‚   β”œβ”€β”€ index.css              # Global styles
β”‚   └── vite-env.d.ts
β”œβ”€β”€ public/                    # Static assets
β”œβ”€β”€ index.html
β”œβ”€β”€ package.json
β”œβ”€β”€ vite.config.ts
β”œβ”€β”€ tsconfig.json
└── README.md

Usage

Authentication

The dashboard uses Zustand for state management with localStorage persistence. Authentication is mocked - you can sign in with any email and password (minimum 8 characters).

Store: src/stores/auth-store.ts Hook: useAuth() from src/hooks/use-auth.ts Login: Navigate to /login Signup: Navigate to /signup

See ZUSTAND_AUTH.md for detailed documentation.

Mock Data

All data is mocked and stored in src/lib/mock-data.ts. This includes:

  • User Data: Name, email (stored in localStorage after login)
  • Organizations: Demo Company, Acme Corp, Tech Startup
  • Dashboard Stats: Projects count, team members, etc.

Adding New Pages

  1. Create a new route file in src/routes/app/:
// src/routes/app/settings/index.tsx
import { createFileRoute } from '@tanstack/react-router';

export const Route = createFileRoute('/app/settings/')({
  component: SettingsPage,
});

function SettingsPage() {
  return (
    <div>
      <h1>Settings</h1>
      {/* Your content */}
    </div>
  );
}
  1. Add the route to the sidebar in src/components/layout/sidebar.tsx:
const navigationItems = [
  {
    title: "Overview",
    url: "/overview",
    icon: LayoutDashboard,
  },
  {
    title: "Settings",
    url: "/settings",
    icon: Settings,
  },
]

Customization

Change Theme Colors

Edit src/index.css to modify the color scheme:

@layer base {
  :root {
    --primary: 262.1 83.3% 57.8%;
    /* ... other colors */
  }
}

Modify Mock Data

Edit src/lib/mock-data.ts to change default organizations, stats, or user data.

Add Backend Integration

Replace the mock authentication with your real API:

  1. Update src/stores/auth-store.ts to call your backend API
  2. Add JWT token management to the auth store
  3. Update src/hooks/use-organization.ts to fetch real data
  4. Remove src/lib/mock-data.ts once you have real data

See ZUSTAND_AUTH.md for integration examples.

Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm run lint - Run ESLint

UI Components

The dashboard includes a complete UI component library from shadcn/ui:

  • Buttons, Inputs, Forms
  • Dialogs, Modals, Popovers
  • Tables, Cards, Badges
  • Navigation, Menus, Breadcrumbs
  • Charts, Progress bars
  • And many more...

All components are fully typed and customizable. See src/components/ui/ for the complete list.

Keyboard Shortcuts

  • Cmd/Ctrl + K - Open command palette

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

License

MIT License - feel free to use this starter for your projects!

Support

For questions or issues, please open an issue in the repository.


Note: This is a frontend-only dashboard starter. All data is mocked and stored in localStorage. You'll need to integrate with your backend API to make it production-ready.

Cursor AI Integration

This starter includes comprehensive Cursor AI rules in .cursor/rules/:

  • project_guide.mdc - Main guide with architecture, patterns, and best practices
  • authentication.mdc - Authentication patterns and integration guides
  • components.mdc - Component conventions and styling patterns
  • routing.mdc - TanStack Router conventions and examples

Using with Cursor AI

The AI automatically uses these rules to provide context-aware assistance:

"How do I add a new protected page?"
"Show me the authentication pattern"
"How should I structure this component?"

See .cursor/rules/README.md for complete documentation.

Next Steps

  1. Add Your Backend API - Replace mock data with real API calls
  2. Add More Pages - Build out your dashboard with additional routes
  3. Customize Styling - Adjust colors, fonts, and layouts to match your brand
  4. Add Analytics - Integrate analytics tracking
  5. Deploy - Deploy to Vercel, Netlify, or your preferred hosting platform

Happy building! πŸš€

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors