A modern, self-hostable analytics dashboard built with React, TypeScript, and Tailwind CSS. Perfect for SaaS developers who want to integrate analytics directly into their admin panels.
- SaaS Applications - Embed analytics in your admin dashboard
- Privacy-Focused Apps - Self-hosted analytics without third-party tracking
- Developer Tools - Lightweight, customizable analytics solution
- Internal Dashboards - Beautiful UI ready for production use
- π¨ Modern UI - Dark theme with responsive design
- π Real-Time Analytics - Session tracking, visits, and page views
- π Geolocation - Country and city-level insights
- π± Device Detection - Browser, OS, and device analytics
- π€ Bot Filtering - Automatic bot detection and filtering
- β‘ Fast & Lightweight - Built with Vite for optimal performance
- π Privacy-First - Self-hosted, no third-party tracking
- π― Type-Safe - Full TypeScript support
- Node.js 18+ and npm
- Umami Cloud API account or self-hosted Umami instance
-
Clone the repository
git clone https://github.com/yourusername/umami-analytics-dashboard.git cd umami-analytics-dashboard -
Install dependencies
npm install
-
Configure environment variables
Create a
.envfile in the project root:# Umami API Configuration VITE_UMAMI_API_URL=https://api.umami.is/v1 VITE_UMAMI_API_KEY=your-api-key-here VITE_UMAMI_WEBSITE_ID=your-website-id-here # Data Mode (mock or real) VITE_USE_MOCK_DATA=false
-
Start development server
npm run dev
-
Open your browser Navigate to http://localhost:5173
Deploy as a separate analytics application for your admin panel.
npm run build
# Deploy the dist/ folder to your hosting providerImport the components into your existing React application:
import { SessionsTable, SessionStats } from '@umami-analytics-dashboard/components';
function AdminDashboard() {
return (
<div>
<SessionStats />
<SessionsTable />
</div>
);
}Embed as an iframe in any application:
<iframe src="https://your-analytics-instance.com"
width="100%"
height="800px"
frameborder="0">
</iframe>| Category | Technology |
|---|---|
| Framework | React 19 |
| Language | TypeScript |
| Styling | Tailwind CSS v4 |
| Build Tool | Vite |
| Icons | Phosphor Icons |
| Avatars | DiceBear Lorelei |
| Flags | react-country-flag |
src/
βββ api/ # API layer & data fetching
β βββ client/ # HTTP client with authentication
β βββ config/ # API endpoints & configuration
β βββ hooks/ # React hooks (useSessions, useWebsites, etc.)
β βββ types/ # TypeScript definitions
βββ components/ # UI components
β βββ SessionsTable.tsx # Main analytics table
β βββ SessionStats.tsx # KPI cards
β βββ SessionAvatar.tsx # User avatars
β βββ CountryFlag.tsx # Country visualization
βββ config/ # Configuration
βββ utils/ # Helper functions
Displays key performance indicators:
- Total Sessions
- Active Sessions
- Total Visits
- Total Views
Comprehensive session analytics with:
- User avatars (consistent generation)
- Geolocation data (country & city)
- Browser, OS, and device detection
- Time-based filtering
- Bot filtering
| Variable | Description | Example |
|---|---|---|
VITE_UMAMI_API_URL |
Umami API endpoint | https://api.umami.is/v1 |
VITE_UMAMI_API_KEY |
Your Umami API key | api_xxx... |
VITE_UMAMI_WEBSITE_ID |
Website/domain ID | xxx-xxx-xxx |
VITE_USE_MOCK_DATA |
Use mock data for dev | true/false |
Mock Mode (Development):
- Uses generated test data
- No API connection required
- Perfect for UI development
Real Mode (Production):
- Connects to Umami API
- Live analytics data
- Requires valid API credentials
- Desktop: Full 4-column statistics grid
- Tablet: Adaptive 2-column layout
- Mobile: Optimized mobile experience
- All Devices: Horizontal scroll for tables
npm run buildThis creates an optimized build in the dist/ directory.
npm install -g vercel
vercelnpm install -g netlify-cli
netlify deployUpload the contents of the dist/ folder to any static hosting service:
- AWS S3 + CloudFront
- GitHub Pages
- Any static file server
- API keys stored in environment variables
- No hardcoded credentials
.envfiles gitignored by default- Secure API communication
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint- β TypeScript strict mode
- β ESLint with TypeScript rules
- β Consistent code formatting
- β Comprehensive error handling
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
- Umami - Privacy-focused analytics platform
- DiceBear - Avatar generation
- Phosphor Icons - Icon library
- Tailwind CSS - Utility-first CSS
- React - UI library
Have questions or need help?
- π Check out the documentation
- π Open an issue on GitHub
- π¬ Start a discussion
Built with β€οΈ for developers who care about privacy and great UX
