SaaS Platform Dashboard
A modern, clean, and compact dashboard for managing your SaaS platform built with React, TypeScript, and Tailwind CSS.
Features
๐ฏ Core Management
- Users Management: Add, edit, delete, and manage user permissions
- Organizations: Multi-tenant organization management
- Applications: Deploy and manage TypeScript applications
- Database Tables: View and manage PostgreSQL database tables
- API Keys: Generate and manage API keys for external integration
- Settings: Configure platform-wide settings
๐จ Modern UI/UX
- Clean, minimalist design with Tailwind CSS
- Responsive layout for mobile and desktop
- Interactive data tables with pagination
- Real-time status updates
- Toast notifications for user feedback
- Loading states and error handling
๐ Performance
- Built with React 18 and TypeScript
- Optimized with Vite for fast development
- React Query for efficient data fetching
- Code splitting and lazy loading
- Component-based architecture
Quick Start
Prerequisites
- Node.js 18+
- npm or yarn
- Access to SaaS platform API endpoints
Installation
Clone and Setup
cd dashboard
npm install
Configure Environment
cp .env.example .env
# Edit .env with your API endpoints
Start Development Server
npm run dev
Build for Production
npm run build
Environment Variables
# API Configuration
VITE_API_URL=http://localhost:8888
VITE_AUTH_API_URL=http://localhost:8888/auth
VITE_STORAGE_URL=http://localhost:8888/storage
# Environment
VITE_NODE_ENV=development
# Debug
VITE_DEBUG=false
Project Structure
dashboard/
โโโ src/
โ โโโ components/ # Reusable components
โ โ โโโ Layout.tsx # Main app layout
โ โ โโโ DashboardStats.tsx
โ โ โโโ DataTable.tsx # Generic data table component
โ โโโ pages/ # Page components
โ โ โโโ Dashboard.tsx # Main dashboard
โ โ โโโ Users.tsx # User management
โ โ โโโ Organizations.tsx
โ โ โโโ Applications.tsx
โ โ โโโ Database.tsx
โ โ โโโ ApiKeys.tsx
โ โ โโโ Settings.tsx
โ โ โโโ Login.tsx # Authentication
โ โโโ hooks/ # Custom React hooks
โ โ โโโ useAuth.ts # Authentication hook
โ โโโ services/ # API services
โ โ โโโ api.ts # API client
โ โโโ types/ # TypeScript type definitions
โ โ โโโ index.ts
โ โโโ utils/ # Utility functions
โ โ โโโ helpers.ts
โ โโโ styles/ # CSS and styling
โ โ โโโ globals.css
โ โโโ App.tsx # Main app component
โ โโโ main.tsx # Entry point
โโโ public/ # Static assets
โโโ Dockerfile # Docker configuration
โโโ nginx.conf # Nginx configuration
โโโ package.json # Dependencies and scripts
โโโ README.md # This file
Pages Overview
๐ Dashboard
- Platform statistics and metrics
- User growth charts
- Application and deployment trends
- Recent activity feed
๐ฅ Users Management
- List all platform users
- Add/edit/delete users
- Manage user status (active/inactive/suspended)
- View user details and activity
๐ข Organizations
- Multi-tenant organization management
- Create and configure organizations
- Manage organization members
- View organization applications
๐ป Applications
- Deploy and manage applications
- View deployment status and logs
- Configure application settings
- Monitor application health
๐๏ธ Database
- View database tables and schemas
- Monitor table sizes and row counts
- SQL query interface
- Data export capabilities
๐ API Keys
- Generate API keys for external services
- Manage key permissions and expiration
- Monitor key usage and activity
- Revoke and delete keys
โ๏ธ Settings
- Platform configuration
- Security settings
- Database maintenance
- Notification preferences
Components
DataTable
Generic, reusable data table component with:
- Pagination support
- Search and filtering
- Sortable columns
- Custom cell rendering
- Loading and empty states
Layout
Main application layout featuring:
- Responsive sidebar navigation
- User profile and logout
- Mobile-friendly menu
- Breadcrumb support
DashboardStats
Statistics cards displaying:
- Platform metrics
- Growth indicators
- Real-time data updates
- Interactive charts
Technical Stack
Frontend
- React 18: Component framework
- TypeScript: Type safety
- Vite: Build tool and dev server
- Tailwind CSS: Utility-first CSS
- React Router: Client-side routing
- React Query: Data fetching and caching
- Lucide React: Icon library
- React Hook Form: Form management
- Recharts: Data visualization
Build Tools
- Vite: Fast build and HMR
- TypeScript: Static typing
- ESLint: Code linting
- PostCSS: CSS processing
Development
Scripts
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Lint code
npm run lint
# Fix linting issues
npm run lint:fix
Code Quality
- ESLint configuration for code consistency
- TypeScript strict mode for type safety
- Component-based architecture
- Custom hooks for logic reuse
Authentication
The dashboard uses JWT tokens for authentication:
- Login endpoint validates credentials
- Token stored in localStorage
- Automatic token refresh
- Protected routes with redirect
- Logout clears token and redirects
API Integration
All API calls are handled through a centralized service:
- Axios HTTP client
- Request/response interceptors
- Automatic token injection
- Error handling and user feedback
- Request deduplication and caching
Deployment
Docker
# Build Docker image
docker build -t saas-dashboard .
# Run container
docker run -p 80:80 saas-dashboard
Static Files
After building, static files are in dist/:
- Can be served by any web server
- Nginx configuration included
- SPA routing support
- Optimized assets with gzip
Customization
Styling
- Tailwind CSS for utility classes
- Custom components with CSS modules
- Theme configuration in
tailwind.config.js
- Responsive design breakpoints
Components
- Modular component architecture
- Props-based customization
- Composition over inheritance
- Reusable utility components
Security
- XSS protection with React
- CSRF protection via API endpoints
- Secure token storage
- Input validation and sanitization
- HTTPS-only in production
Performance
- Code splitting and lazy loading
- Efficient data fetching with React Query
- Optimized bundle size with Vite
- Caching strategies
- Image and asset optimization
Contributing
- Follow the existing code style
- Use TypeScript for type safety
- Write tests for new features
- Update documentation
- Keep components small and focused
Browser Support
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Mobile browsers
License
This dashboard is part of the SaaS Platform project.