MO
Moose0621/you-ai-yourself
A repository to test out building a novel website to graphically display Phish song statistics.
Phish Statistics Dashboard
A modern web application for exploring Phish song statistics, tour data, and performance analytics using the Phish.net API with interactive circular tour visualizations and comprehensive data analysis tools.
โจ Features
๐ Song Statistics
- Comprehensive Analytics: Song play counts, average lengths, and gap analysis
- Longest Jam Tracking: Historical longest jam performances with dates and venues
- Interactive Filtering: Search and filter by song name, length, play count
- Smart Autocomplete: Intelligent song suggestions with metadata
๐ช Tours Explorer
- Interactive Circular Visualization: Tour data displayed in engaging circular layouts
- Year-by-Year Navigation: Explore Phish's touring history by year
- Hover Tooltips: Detailed tour information on hover
- Show Details: Click-through to individual show listings
- Size-Coded Tours: Visual representation of tour sizes by show count
๐ฏ Modern UI/UX
- Tabbed Navigation: Seamless switching between Statistics and Tours
- Responsive Design: Optimized for desktop, tablet, and mobile
- Real-time Filtering: Instant search and filter results
- Professional Styling: Clean, modern interface with Tailwind CSS
๐ Getting Started
Prerequisites
- Node.js 21+ (LTS recommended)
- Python 3.12+ (for data processing scripts)
- npm or yarn
- Phish.net API key (Get one here)
Quick Installation
# Clone the repository
git clone https://github.com/Moose0621/you-ai-yourself.git
cd you-ai-yourself
# Install Node.js dependencies
npm install
# Set up Python environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
# Configure environment
cp .env.local.example .env.local
# Edit .env.local and add your Phish.net API key
# Generate initial data
npm run data:refresh
# Start development server
npm run devOpen http://localhost:3000 to view the application.
๐ Project Structure
โโโ .github/workflows/ # CI/CD and maintenance workflows
โโโ .azure/ # Azure deployment configuration
โโโ scripts/ # Maintenance and data processing scripts
โโโ src/
โ โโโ app/ # Next.js 13+ app directory
โ โโโ components/ # React components
โ โ โโโ Navigation.tsx # Tab navigation system
โ โ โโโ ToursExplorer.tsx # Circular tour visualization
โ โ โโโ FilterControls.tsx # Search and filtering
โ โ โโโ SongChart.tsx # Chart components
โ โ โโโ SongTable.tsx # Data table display
โ โ โโโ TourStats.tsx # Statistics overview
โ โโโ lib/ # API and utility functions
โ โ โโโ simpleLocalPhishApi.ts # Enhanced API with tour support
โ โโโ types/ # TypeScript definitions
โโโ data/ # Raw and processed data files
โโโ public/ # Static assets and processed data
โโโ tests/ # Test suites (Jest & Pytest)
โโโ backups/ # Automated data backups
๐ง Available Scripts
Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run type-check # TypeScript type checkingTesting & Quality
npm run test # Run Jest tests
npm run test:coverage # Run tests with coverage
npm run test:python # Run Python tests
npm run test:all # Run all tests
npm run lint # Lint code
npm run lint:fix # Fix linting issuesData Management
npm run data:refresh # Refresh Phish.net data
npm run data:backup # Create data backup
npm run health-check # System health checkMaintenance
npm run clean # Clean build artifacts
npm run clean:full # Full clean and reinstall
npm run security:audit # Security vulnerability scan
npm run deps:check # Check for outdated dependencies
npm run deps:update # Update dependencies๐๏ธ Data Architecture
Data Sources
- Phish.net API v5: Live show and song data
- Local JSON Cache: Optimized for fast loading
- Processed Data: Enhanced with jam analysis and statistics
Data Processing Pipeline
- Fetch: Download raw data from Phish.net API
- Filter: Remove non-Phish shows and future dates
- Enhance: Add longest jam calculations and metadata
- Cache: Store processed data for fast access
- Backup: Automated daily backups with retention
Data Structure
interface Song {
name: string
slug: string
timesPlayed: number
averageLength: number
longestJam?: JamPerformance
tags: string[]
}
interface Show {
showid: number
date: string
venue: string
city: string
state: string | null
country: string
tourid?: number
tour_name?: string
}๐๏ธ API Integration
Enhanced Local API
The application uses an enhanced local API that provides:
// Song statistics and search
getSongStats(): Promise<Song[]>
searchSongs(query: string): Promise<Song[]>
getTopSongsByLongestJam(limit?: number): Promise<Song[]>
// Tour exploration
getToursByYear(): Promise<Record<number, Tour[]>>
getAvailableYears(): Promise<number[]>
getShowsByYear(year: number): Promise<Show[]>
// Utility methods
getMetadata(): Promise<Metadata>
getAllTags(): Promise<string[]>Phish.net API Endpoints
GET /v5/shows.json- All showsGET /v5/songs.json- Song catalogGET /v5/shows/year/{year}.json- Shows by yearGET /v5/songdata/slug/{slug}.json- Detailed song data
๐จ UI Components
Navigation System
- Tab-based Interface: Smooth transitions between sections
- Active State Indicators: Clear visual feedback
- Mobile Responsive: Collapsible navigation on small screens
Tours Explorer
- Circular Layout: Tours arranged in visually appealing circles
- Interactive Elements: Hover effects and click handlers
- Color Coding: Unique colors for each tour
- Size Scaling: Circle size represents tour magnitude
Smart Search
- Autocomplete: Real-time suggestions as you type
- Rich Previews: Show metadata in suggestions
- Intelligent Sorting: Exact matches and starts-with prioritized
๐ข Deployment
Azure Web App Deployment
Prerequisites
- Azure subscription
- Azure CLI installed
- GitHub repository with secrets configured
Required Secrets
AZURE_WEBAPP_NAME # Production app name
AZURE_WEBAPP_PUBLISH_PROFILE # Production publish profile
AZURE_WEBAPP_NAME_STAGING # Staging app name
AZURE_WEBAPP_PUBLISH_PROFILE_STAGING # Staging publish profile
AZURE_STORAGE_ACCOUNT # Storage account for backups
AZURE_STORAGE_KEY # Storage account keyDeployment Process
- Automatic: Push to
maintriggers production deployment - Staging: Push to
developdeploys to staging environment - Manual: Use GitHub Actions workflow dispatch
CI/CD Pipeline
- Quality Gates: Automated testing, linting, type checking
- Security Scanning: Dependency vulnerability checks
- Health Monitoring: Post-deployment verification
- Automated Backups: Daily data backups to Azure Storage
๐งช Testing
Test Coverage
- Frontend: Jest + React Testing Library
- Backend: Python pytest with coverage
- Integration: End-to-end API testing
- Quality: ESLint, TypeScript strict mode
Running Tests
# Quick test run
npm test
# Full test suite with coverage
npm run test:all
# Python-specific tests
npm run test:python
# Watch mode for development
npm run test:watch๐ Security
Security Measures
- API Key Protection: Environment variable security
- Dependency Scanning: Automated vulnerability detection
- Content Security: Input validation and sanitization
- HTTPS Only: Secure communication protocols
Security Scripts
npm run security:audit # Check for vulnerabilities
npm run security:fix # Auto-fix security issues๐ Monitoring & Maintenance
Automated Maintenance
- Daily Health Checks: System integrity verification
- Weekly Dependency Updates: Automated security patches
- Data Freshness Monitoring: Automatic data refresh
- Performance Monitoring: Response time tracking
Health Monitoring
npm run health-check # Manual health checkBackup Strategy
- Daily Backups: Automated data preservation
- 7-day Retention: Local backup cleanup
- Cloud Storage: Azure Blob Storage integration
- Recovery Testing: Periodic backup validation
๐ค Contributing
Development Workflow
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
Code Standards
- TypeScript: Strict mode enabled
- ESLint: Enforced code quality
- Prettier: Consistent formatting
- Conventional Commits: Structured commit messages
Testing Requirements
- Unit Tests: Required for new components
- Integration Tests: Required for API changes
- Coverage: Minimum 80% coverage threshold
- Type Safety: No TypeScript errors allowed
๐ Performance
Optimization Features
- Static Generation: Pre-built pages for faster loading
- Data Caching: Local JSON cache for instant access
- Code Splitting: Lazy loading of components
- Image Optimization: Next.js automatic optimization
Performance Metrics
- First Contentful Paint: < 1.5s
- Largest Contentful Paint: < 2.5s
- Time to Interactive: < 3.5s
- Cumulative Layout Shift: < 0.1
๐ Troubleshooting
Common Issues
Data Loading Issues
# Refresh data cache
npm run data:refresh
# Check health status
npm run health-check
# Clear cache and rebuild
npm run clean:fullDevelopment Issues
# Type checking errors
npm run type-check
# Linting issues
npm run lint:fix
# Test failures
npm run test:coverageDeployment Issues
# Check build locally
npm run build
# Verify environment variables
cat .env.local
# Test production build
npm run start๐ Changelog
Version 0.2.0 (Latest)
- โจ Added interactive Tours Explorer with circular visualization
- ๐ Enhanced search with autocomplete functionality
- ๐ช Year-by-year tour navigation
- ๐ Improved data processing and caching
- ๐๏ธ Complete CI/CD pipeline setup
- ๐ง Comprehensive maintenance scripts
Version 0.1.0
- ๐ต Basic song statistics and filtering
- ๐ Chart.js integration for data visualization
- ๐ฏ Responsive design with Tailwind CSS
- ๐ Phish.net API integration
- โ Initial test coverage
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Phish.net and the Mockingbird Foundation for providing comprehensive Phish data
- The Phish Community for ongoing documentation and preservation efforts
- Contributors to the open-source packages that make this project possible
๐ Links
- Live Demo: [Coming Soon]
- API Documentation: Phish.net API
- Issue Tracker: GitHub Issues
- Discussions: GitHub Discussions
Built with โค๏ธ for the Phish community