> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whisky.casino/llms.txt
> Use this file to discover all available pages before exploring further.

# Whisky Explorer

> Web-based dashboard for monitoring games, pools, and analytics

# Whisky Explorer

The Whisky Explorer is a comprehensive web-based dashboard that provides real-time monitoring, analytics, and management tools for the Whisky Gaming Protocol. It serves as the monitoring layer, offering transparency and visibility into all protocol activities.

## Overview

The Explorer provides:

* **Live Monitoring**: Real-time game and pool monitoring
* **Analytics Dashboard**: Comprehensive data visualization
* **Pool Management**: Liquidity pool administration
* **Transaction Tracking**: Detailed transaction history

## Features

### Real-time Dashboard

* Live game feeds and statistics
* Pool liquidity monitoring
* Player activity tracking
* Protocol performance metrics

### Analytics & Charts

* Volume and profit charts
* Player leaderboards
* Platform performance metrics
* Historical data analysis

### Pool Management

* Create and configure pools
* Deposit and withdraw liquidity
* Monitor pool performance
* Manage pool settings

### Transaction Explorer

* Detailed transaction history
* Game result verification
* Pool change tracking
* Fee distribution monitoring

## Access

### Production

```
https://explorer.whisky.casino
```

### Development

```bash theme={null}
# Clone the repository
git clone https://github.com/weknowyourgame/whisky-explorer.git
cd whisky-explorer

# Install dependencies
npm install

# Start development server
npm run dev
```

## Main Sections

### Dashboard

The main dashboard provides an overview of protocol activity:

* **Recent Games**: Latest settled games with results
* **Top Players**: Leaderboard of highest performers
* **Pool Overview**: Liquidity and volume statistics
* **Platform Stats**: Creator and platform performance

### Games

Track individual games and their outcomes:

* **Game History**: Complete history of all games
* **Game Details**: Individual game information and verification
* **Result Verification**: Cryptographic proof of fairness
* **Player Activity**: Individual player game history

### Pools

Manage and monitor liquidity pools:

* **Pool List**: All available gaming pools
* **Pool Details**: Individual pool statistics and settings
* **Liquidity Management**: Deposit and withdraw functionality
* **Pool Analytics**: Performance metrics and charts

### Players

Monitor player activity and performance:

* **Player Search**: Find specific players by address
* **Player Profiles**: Detailed player statistics
* **Performance Charts**: Player performance over time
* **Game History**: Complete player game history

### Platforms

Track platform and creator performance:

* **Platform Rankings**: Top platforms by volume
* **Creator Analytics**: Individual creator performance
* **Revenue Tracking**: Fee collection and distribution
* **Activity Metrics**: Platform engagement statistics

## Key Components

### Navigation

The Explorer features a comprehensive navigation system:

```tsx theme={null}
// Main navigation structure
<Navigation>
  <NavItem href="/">Dashboard</NavItem>
  <NavItem href="/games">Games</NavItem>
  <NavItem href="/pools">Pools</NavItem>
  <NavItem href="/players">Players</NavItem>
  <NavItem href="/platforms">Platforms</NavItem>
  <NavItem href="/analytics">Analytics</NavItem>
</Navigation>
```

### Real-time Updates

The Explorer uses WebSocket connections for real-time updates:

```tsx theme={null}
// Real-time game updates
useEffect(() => {
  const ws = new WebSocket('wss://explorer.whisky.casino/ws')
  
  ws.onmessage = (event) => {
    const data = JSON.parse(event.data)
    
    if (data.type === 'GAME_SETTLED') {
      updateGameList(data.game)
    } else if (data.type === 'POOL_UPDATED') {
      updatePoolData(data.pool)
    }
  }
  
  return () => ws.close()
}, [])
```

### Data Visualization

Charts and graphs for analytics:

```tsx theme={null}
// Volume chart component
function VolumeChart({ data, timeRange }) {
  return (
    <LineChart data={data}>
      <XAxis dataKey="date" />
      <YAxis />
      <Tooltip />
      <Line type="monotone" dataKey="volume" stroke="#8884d8" />
    </LineChart>
  )
}
```

## Usage Examples

### Viewing Recent Games

1. Navigate to the Dashboard
2. Scroll to "Recent Games" section
3. Click on any game to view details
4. Verify the game result using cryptographic proof

### Monitoring a Pool

1. Go to Pools section
2. Select a specific pool
3. View real-time statistics:
   * Total liquidity
   * Recent activity
   * Volume charts
   * Fee collection

### Tracking a Player

1. Navigate to Players section
2. Search for player by wallet address
3. View player profile:
   * Total games played
   * Win/loss ratio
   * Profit/loss statistics
   * Game history

### Creating a Pool

1. Click "Create Pool" button
2. Select token type (USDC, SOL, etc.)
3. Set minimum and maximum wager limits
4. Configure pool fees
5. Deploy the pool

## API Integration

The Explorer integrates with the Whisky API for data:

```typescript theme={null}
// API client for Explorer
class ExplorerAPI {
  private baseUrl: string
  private apiKey: string

  constructor(baseUrl: string, apiKey: string) {
    this.baseUrl = baseUrl
    this.apiKey = apiKey
  }

  async getRecentGames(limit = 10) {
    const response = await fetch(
      `${this.baseUrl}/events/settledGames?itemsPerPage=${limit}`,
      {
        headers: {
          'X-API-Key': this.apiKey
        }
      }
    )
    return response.json()
  }

  async getPoolStats(poolAddress: string) {
    const response = await fetch(
      `${this.baseUrl}/total?pool=${poolAddress}`,
      {
        headers: {
          'X-API-Key': this.apiKey
        }
      }
    )
    return response.json()
  }

  async getPlayerStats(playerAddress: string) {
    const response = await fetch(
      `${this.baseUrl}/player?user=${playerAddress}`,
      {
        headers: {
          'X-API-Key': this.apiKey
        }
      }
    )
    return response.json()
  }
}
```

## Data Sources

### Blockchain Data

* Direct Solana RPC queries
* Program account monitoring
* Transaction history tracking

### API Data

* Whisky API integration
* Aggregated statistics
* Historical analytics

### Real-time Feeds

* WebSocket connections
* Live game updates
* Pool change notifications

## Security Features

### Data Verification

* Cryptographic proof verification
* Transaction signature validation
* Account state verification

### Access Control

* API key authentication
* Rate limiting
* Request validation

### Privacy Protection

* Wallet address anonymization
* Sensitive data filtering
* GDPR compliance

## Performance Optimization

### Caching Strategy

```typescript theme={null}
// Redis caching for frequently accessed data
const cache = new Redis({
  host: 'localhost',
  port: 6379
})

async function getCachedData(key: string) {
  const cached = await cache.get(key)
  if (cached) {
    return JSON.parse(cached)
  }
  
  const data = await fetchData(key)
  await cache.set(key, JSON.stringify(data), 'EX', 300) // 5 minutes
  return data
}
```

### Database Optimization

* Indexed queries for fast lookups
* Partitioned tables for historical data
* Connection pooling for efficiency

### CDN Integration

* Static asset delivery
* Global content distribution
* Cache optimization

## Monitoring & Alerts

### System Monitoring

* API response times
* Database performance
* Error rates and types
* User activity metrics

### Alert System

* Pool liquidity alerts
* Transaction failure notifications
* System downtime alerts
* Performance degradation warnings

### Logging

* Structured logging
* Error tracking
* User activity logs
* Performance metrics

## Customization

### Theme Customization

```typescript theme={null}
// Custom theme configuration
const customTheme = {
  colors: {
    primary: '#667eea',
    secondary: '#764ba2',
    background: '#1a202c',
    text: '#ffffff'
  },
  fonts: {
    body: 'Inter, sans-serif',
    heading: 'Inter, sans-serif'
  }
}
```

### Component Customization

* Customizable dashboard layouts
* Configurable chart types
* Flexible data display options
* Brand integration capabilities

## Development

### Local Development

```bash theme={null}
# Clone repository
git clone https://github.com/weknowyourgame/whisky-explorer.git
cd whisky-explorer

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env.local
# Edit .env.local with your configuration

# Start development server
npm run dev
```

### Environment Variables

```bash theme={null}
# API Configuration
NEXT_PUBLIC_API_URL=https://api.whisky.casino
API_KEY=your-api-key-here

# Solana Configuration
NEXT_PUBLIC_SOLANA_RPC=https://api.mainnet-beta.solana.com
NEXT_PUBLIC_PROGRAM_ID=your-program-id

# Database Configuration
DATABASE_URL=your-database-url

# Redis Configuration
REDIS_URL=your-redis-url
```

### Building for Production

```bash theme={null}
# Build the application
npm run build

# Start production server
npm start
```

## Deployment

### Vercel Deployment

```bash theme={null}
# Install Vercel CLI
npm i -g vercel

# Deploy to Vercel
vercel --prod
```

### Docker Deployment

```bash theme={null}
# Build Docker image
docker build -t whisky-explorer .

# Run container
docker run -p 3000:3000 whisky-explorer
```

## Troubleshooting

### Common Issues

**API Connection Errors**

* Verify API key is correct
* Check network connectivity
* Ensure API endpoint is accessible

**Data Loading Issues**

* Clear browser cache
* Check API rate limits
* Verify data source availability

**Performance Problems**

* Monitor database performance
* Check CDN configuration
* Review caching strategy

### Debug Mode

```typescript theme={null}
// Enable debug logging
const DEBUG = process.env.NODE_ENV === 'development'

if (DEBUG) {
  console.log('API Response:', response)
  console.log('Cache Status:', cacheStatus)
  console.log('Performance Metrics:', metrics)
}
```

## Support

For Explorer support and questions:

* **Documentation**: This documentation
* **Community**: [Discord Server](https://discord.gg/whisky-gaming)
* **Issues**: [GitHub Issues](https://github.com/weknowyourgame/whisky-explorer/issues)
* **Email**: [support@whisky.casino](mailto:support@whisky.casino)

## Roadmap

### Planned Features

* **Mobile App**: Native mobile application
* **Advanced Analytics**: Machine learning insights
* **API Marketplace**: Third-party integrations
* **Social Features**: Community and social gaming
* **Enterprise Features**: Business analytics and reporting

### Performance Improvements

* **Real-time Updates**: WebSocket optimization
* **Data Compression**: Efficient data transfer
* **Caching Enhancement**: Multi-level caching
* **Database Optimization**: Query performance improvements
