Production-ready SaaS admin template built with React 19, TypeScript 6, Vite 8, and Ant Design v6.
| Why it matters | How it helps |
|---|---|
| β‘οΈ Modern stack | React 19 + Vite 8 + TypeScript 6 = instant HMR and full type safety |
| π¨ Polished UI | Ant Design v6 components, theme switcher, and adaptive layouts |
| π Real workflows | Auth, protected routes, SaaS dashboard, and customer lifecycle management |
| π§± Strong DX | File-based routing, lazy route loading, Zustand stores, mock APIs, and zero-config startup |
- Dashboard β KPI cards, lightweight revenue trend chart, customer source breakdown, and automated health insights
- Customers β Advanced filtering, ownership, status transitions, detail drawer, and activity timeline
- Team Roles β Nested role listing, detailed role insights, and permission matrix editor
| Technology | Version | Purpose |
|---|---|---|
| React | 19.2.7 | UI Framework |
| TypeScript | 6.0.3 | Type Safety |
| Vite | 8.1.0 | Build Tool |
| Ant Design | 6.5.0 | UI Components |
| React Router | 7.18.0 | Routing |
| Zustand | 5.0.14 | State Management |
| Axios | 1.18.1 | HTTP Client |
src/
βββ components/
β βββ layout/ # Shell layout: header, sidebar, breadcrumbs, content
β βββ auth/ # Shared auth UI pieces
βββ config/
β βββ theme.ts # Theme configuration types and utilities
β βββ theme-presets.ts # Preset theme definitions
βββ views/
β βββ auth/ # Login & register pages (unprotected)
β βββ dashboard/ # SaaS dashboard page + routes
β βββ customers/ # Customer management module + routes
βββ router/ # Auto-imported route definitions & guards
βββ store/ # Zustand stores (config + user)
βββ utils/ # API client, mock helpers, shared utils
βββ App.tsx # Root layout orchestration
- Node.js 20.19+ or 22.12+
- npm
git clone https://github.com/larry-xue/react-admin-dashboard.git
cd react-admin-dashboard
npm install
npm run devVisit http://localhost:5173.
| Role | Username | Password | Shortcut |
|---|---|---|---|
| Admin | admin |
admin123 |
/auth/login?demo=admin |
| User | user |
user123 |
/auth/login?demo=user |
| Demo | demo |
demo123 |
/auth/login?demo=demo |
- Login/register flows with Ant Design forms
ProtectedRoutewrapper guarding all non-/auth/**routes- Tokens stored in Zustand + localStorage with auto-injection via Axios interceptors
- Vite
import.meta.globauto-loads every*.router.tsx metadrives sidebar label/icon/hide/order plus page title- Nested routes supported out of the box (see
customersmodule)
- Light / Dark / Compact algorithms controlled via Zustand store
- Persistent theme preferences using localStorage
- Preset themes: Blue, Green, Purple, Orange, Teal, Red, Cyan
- Custom colors: Support for primary, secondary, success, warning, error, info, background, and text colors
- Runtime theme switching and color customization via store
- Sticky header, collapsible sidebar, breadcrumb trail, and flexible content area
- Breakpoint-aware spacing and auto-collapse on mobile
- Dark-mode-aware charts and cards (Ant Design charts + tokens)
- Create a directory under
src/views/your-page - Build your page component in
index.tsx - Define a
*.router.tsxfile:
// src/views/example/example.router.tsx
import { ExampleOutlined } from '@ant-design/icons'
import { AdminRouterItem } from '../../router'
import ExamplePage from '.'
const exampleRoutes: AdminRouterItem[] = [
{
path: 'example',
element: <ExamplePage />,
meta: {
label: 'Example',
title: 'Example Page',
key: '/example',
icon: <ExampleOutlined />,
order: 3,
},
},
]
export default exampleRoutesimport useConfigStore from './store/config'
// Switch to a preset theme
const setTheme = useConfigStore(state => state.setTheme)
setTheme('blue') // or 'green', 'purple', 'orange', 'teal', 'red', 'cyan'import useConfigStore from './store/config'
// Customize a specific color
const setCustomColor = useConfigStore(state => state.setCustomColor)
setCustomColor('primary', '#1890ff')
setCustomColor('success', '#52c41a')
// Available color keys: primary, secondary, success, warning, error, info, background, textModify src/config/theme-presets.ts to change preset theme colors, or modify src/store/config.ts to change the default theme:
// In src/store/config.ts
const defaultThemeConfig = createDefaultThemeConfig()
defaultThemeConfig.colors.primary = '#your-color'
defaultThemeConfig.colors.secondary = '#your-secondary-color'.env (create if missing):
VITE_API_BASE_URL=http://localhost:3000/api
VITE_USE_MOCK=true # use built-in mock auth/datanpm run dev # start dev server
npm run build # production build
npm run preview # preview the production build
npm run lint # ESLint check (ts/tsx)Output lives in dist/. Any static host works:
- Vercel β zero-config for Vite
- Netlify β continuous deployments
- GitHub Pages β static hosting
PRs and issues are welcome! Please:
- Fork the repo & create a feature branch
- Add tests or docs where it makes sense
- Run
npm run lintbefore submitting
MIT Β© Yujian Xue
Acknowledgements: Ant Design, Vite, React Router, Zustand