A modern React dashboard template with authentication module and professional business theme. Built with clean MVVM architecture, ready for customization.
- π Authentication: Complete login system with Firebase integration
- π¨ Modern UI: Built with Tailwind CSS + shadcn/ui components
- π Theme Support: Dark/Light mode with professional blue color scheme
- π± Responsive Design: Optimized for all devices
- ποΈ MVVM Architecture: Clean separation of concerns
- π₯ Firebase Ready: Pre-configured Firebase authentication with user-friendly setup UI
- π¦ Type-Safe: Full TypeScript support
- β‘ Setup Friendly: Clear error messages and setup instructions when Firebase is not configured
- Framework: React 19 + TypeScript
- Build Tool: Vite 7
- Styling: Tailwind CSS 4 + shadcn/ui
- State Management: React Context + Custom Hooks
- Routing: React Router v7
- Form Handling: React Hook Form + Zod validation
- Authentication: Firebase Auth
- Icons: Lucide React
- Notifications: Sonner
- Package Manager: pnpm
src/
βββ app/
β βββ config/ # App configuration (theme, menu)
β βββ layouts/ # Layout components
β βββ modules/
β β βββ auth/ # Authentication module (MVVM)
β β βββ components/ # UI components
β β βββ hooks/ # Custom hooks
β β βββ models/ # Data models & schemas
β β βββ pages/ # Page components
β β βββ services/ # API services
β β βββ utils/ # Utility functions
β β βββ viewmodels/ # Business logic
β βββ shared/ # Shared components & contexts
β β βββ components/
β β βββ contexts/
β β βββ hocs/
β β βββ hooks/
β βββ router.tsx # Route configuration
βββ components/ui/ # shadcn/ui components
βββ lib/
β βββ services/ # External services (Firebase)
β βββ utils.ts # Utility functions
βββ main.tsx # App entry point
- Node.js 18+
- pnpm (recommended) or npm
- Clone the repository:
git clone <repository-url> cd react-dashboard-template
- Install dependencies:
pnpm install
- Set up environment variables:
cp .env.example .env
- Start development server:
pnpm dev
- Configure Firebase:
- When you first run the app, you'll see a user-friendly setup screen
- Follow the on-screen instructions to configure Firebase
- Create a Firebase project at https://console.firebase.google.com
- Enable Authentication > Sign-in method > Email/Password
- Copy your Firebase config to
.env:
VITE_FIREBASE_API_KEY=your_api_key VITE_FIREBASE_AUTH_DOMAIN=your_auth_domain VITE_FIREBASE_PROJECT_ID=your_project_id VITE_FIREBASE_STORAGE_BUCKET=your_storage_bucket VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id VITE_FIREBASE_APP_ID=your_app_id
- Restart the development server after adding Firebase configuration
The auth module follows MVVM architecture:
- Models: Data structures and validation schemas (Zod)
- Views: React components (Login form, inputs, etc.)
- ViewModels: Business logic and state management
- Services: Firebase authentication API calls
src/app/modules/auth/pages/login.tsx- Login pagesrc/app/modules/auth/viewmodels/login.viewmodel.ts- Login business logicsrc/app/modules/auth/services/auth.service.ts- Auth API callssrc/app/modules/auth/models/auth.schema.ts- Validation schemassrc/lib/services/firebase.ts- Firebase configurationsrc/app/shared/components/firebase-setup-required.tsx- Setup UI component
The template includes a user-friendly setup screen that appears when Firebase is not configured:
- Detects missing Firebase environment variables
- Displays step-by-step setup instructions
- Provides direct links to Firebase Console
- Shows example
.envconfiguration - Copy-to-clipboard functionality for easy setup
This ensures new users have a smooth onboarding experience instead of cryptic error messages.
To add a new module (e.g., dashboard, users, etc.):
- Create module directory:
mkdir -p src/app/modules/your-module/{components,hooks,models,pages,services,viewmodels}- Add routes in
src/app/router.tsx - Add menu items in
src/app/config/menu.ts - Follow the MVVM pattern from the auth module
The template uses a professional business theme with blue as the primary color.
Theme configuration is in:
- CSS Variables:
src/index.css- Contains all color definitions in OKLCH format - Theme Object:
src/app/config/theme.ts- Color palette constants
Light Mode:
- Primary: Professional Blue (
oklch(0.5 0.15 250)) - Secondary: Slate Gray
- Radius: 0.5rem (slightly rounded corners)
Dark Mode:
- Primary: Brighter Blue (
oklch(0.6 0.18 250)) - Background: Dark slate
- Proper contrast for readability
To change the theme colors:
- Edit CSS variables in
src/index.css(lines 43-182) - Update the theme object in
src/app/config/theme.ts - Both light and dark modes can be customized independently
.status-active,.status-pending,.status-error,.status-info,.status-neutral.bg-business-gradient,.bg-business-gradient-dark.card-hover- Smooth hover effects for cards.glass,.glass-dark- Glass morphism effects
Build for production:
pnpm build
Preview production build:
pnpm preview
Build Docker image:
docker build -t react-dashboard-template .Run container:
docker run -p 3000:80 react-dashboard-template
MIT