dishub-analytics.dashboard 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # dishub-analytics.dashboard
2
+
3
+ A high-performance, standalone analytics dashboard component for React. Visualize your Dishub Analytics data with beautiful charts, real-time monitors, and behavioral heatmaps.
4
+
5
+ ## 🚀 Features
6
+
7
+ - **Real-time Overview**: Monitor active users and current pulse live.
8
+ - **Conversion Funnels**: Track user journey drop-offs and success rates.
9
+ - **Geographic Insights**: Interactive maps showing visitor distribution.
10
+ - **Technical Breakdown**: Browser, Device, and OS metrics.
11
+ - **Top Pages & Traffic**: See where your traffic comes from and where it goes.
12
+ - **Interactive Heatmaps**: Visualize user interaction patterns.
13
+ - **Customizable Timeframes**: 24h, 7d, 30d, or custom ranges.
14
+
15
+ ## 📦 Installation
16
+
17
+ ```bash
18
+ npm install dishub-analytics.dashboard
19
+ ```
20
+
21
+ Ensure you have the peer dependencies installed:
22
+
23
+ ```bash
24
+ npm install react react-dom lucide-react recharts framer-motion
25
+ ```
26
+
27
+ ## 🛠️ Usage
28
+
29
+ Simply import the `AnalyticsDashboard` and provide your configuration:
30
+
31
+ ```tsx
32
+ import { AnalyticsDashboard } from 'dishub-analytics.dashboard';
33
+
34
+ function MyDashboard() {
35
+ const config = {
36
+ apiKey: 'your_api_key',
37
+ endpoint: 'https://dishubanalitics-production.up.railway.app/api/v1',
38
+ realtimeEnabled: true,
39
+ // Pusher configuration for real-time updates
40
+ pusher: {
41
+ key: 'your_pusher_key',
42
+ cluster: 'your_cluster',
43
+ wsHost: 'your_host', // optional
44
+ wsPort: 443,
45
+ forceTLS: true
46
+ }
47
+ };
48
+
49
+ return (
50
+ <div className="p-8 bg-slate-50 min-h-screen">
51
+ <AnalyticsDashboard config={config} />
52
+ </div>
53
+ );
54
+ }
55
+ ```
56
+
57
+ ## 🎨 Styling
58
+
59
+ The dashboard uses Tailwind CSS for its internal components. Ensure your project is set up with Tailwind to render the styles correctly.
60
+
61
+ ## 📄 License
62
+
63
+ MIT © [Dishub](https://dishub.city)
@@ -0,0 +1,7 @@
1
+ import { DashboardConfig } from './types';
2
+
3
+ export interface AnalyticsDashboardProps {
4
+ config: DashboardConfig;
5
+ className?: string;
6
+ }
7
+ export declare function AnalyticsDashboard({ config, className }: AnalyticsDashboardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { FunnelData } from '../types';
2
+
3
+ interface ConversionFunnelProps {
4
+ funnel: FunnelData;
5
+ }
6
+ export declare function ConversionFunnel({ funnel }: ConversionFunnelProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,13 @@
1
+ interface GeoDistributionProps {
2
+ geo: Array<{
3
+ country: string;
4
+ countryCode?: string;
5
+ count: number;
6
+ }>;
7
+ cities: Array<{
8
+ city: string;
9
+ count: number;
10
+ }>;
11
+ }
12
+ export declare function GeoDistribution({ geo, cities }: GeoDistributionProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,6 @@
1
+ interface HeatmapVisualizerProps {
2
+ path: string;
3
+ tenantUrl: string;
4
+ }
5
+ export declare function HeatmapVisualizer({ path, tenantUrl }: HeatmapVisualizerProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ import { AnalyticsStats } from '../types';
2
+
3
+ interface RealtimeMonitorProps {
4
+ stats: AnalyticsStats | null;
5
+ }
6
+ export declare function RealtimeMonitor({ stats }: RealtimeMonitorProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare function RecentEvents({ events }: {
2
+ events: any[];
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ interface RecentVisitorsProps {
2
+ sessions: any[];
3
+ }
4
+ export declare function RecentVisitors({ sessions }: RecentVisitorsProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,5 @@
1
+ interface SessionTimelineProps {
2
+ session: any;
3
+ }
4
+ export declare function SessionTimeline({ session }: SessionTimelineProps): import("react/jsx-runtime").JSX.Element | null;
5
+ export {};
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface StatCardProps {
4
+ label: string;
5
+ value: string | number;
6
+ icon: React.ReactNode;
7
+ color: 'blue' | 'purple' | 'green' | 'orange' | 'red';
8
+ pulse?: boolean;
9
+ }
10
+ export declare function StatCard({ label, value, icon, color, pulse }: StatCardProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,9 @@
1
+ interface TopPagesProps {
2
+ pages: Array<{
3
+ path: string;
4
+ count: number;
5
+ }>;
6
+ totalViews: number;
7
+ }
8
+ export declare function TopPages({ pages, totalViews }: TopPagesProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,12 @@
1
+ interface TrafficSourcesProps {
2
+ sources: Array<{
3
+ source: string;
4
+ count: number;
5
+ }>;
6
+ referrers: Array<{
7
+ url: string;
8
+ count: number;
9
+ }>;
10
+ }
11
+ export declare function TrafficSources({ sources, referrers }: TrafficSourcesProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,12 @@
1
+ import { AnalyticsStats, FunnelData, DashboardConfig } from '../types';
2
+
3
+ export declare function useAnalyticsData(config: DashboardConfig, timeframe: string, segment: string, trafficType: string, customRange?: {
4
+ start: string;
5
+ end: string;
6
+ }): {
7
+ stats: AnalyticsStats | null;
8
+ funnel: FunnelData | null;
9
+ loading: boolean;
10
+ error: string | null;
11
+ refresh: () => Promise<void>;
12
+ };
@@ -0,0 +1,13 @@
1
+ export * from './types';
2
+ export * from './Dashboard';
3
+ export * from './utils';
4
+ export * from './hooks/useAnalyticsData';
5
+ export * from './components/StatCard';
6
+ export * from './components/RealtimeMonitor';
7
+ export * from './components/TopPages';
8
+ export * from './components/GeoDistribution';
9
+ export * from './components/TrafficSources';
10
+ export * from './components/RecentVisitors';
11
+ export * from './components/SessionTimeline';
12
+ export * from './components/ConversionFunnel';
13
+ export * from './components/HeatmapVisualizer';