A professional data intelligence platform that analyzes developer productivity patterns across Bangalore's tech ecosystem and correlates them with weather conditions to provide actionable insights.
CodeClimate Analytics provides comprehensive insights into how environmental conditions affect developer productivity by analyzing:
- Your GitHub activity (PushEvents)
- Aggregated data from major Bangalore tech unicorns (zerodha, razorpay, postmanlabs, hasura)
- Bangalore weather patterns from Open-Meteo API
- Modern web browser (Chrome, Firefox, Safari, Edge)
- Internet connection for API access
- Valid GitHub username with public activity
-
Clone or Download the Project
git clone <repository-url> cd codeclimate-analytics
-
Open the Application
- Navigate to the
frontenddirectory - Open
index.htmlin your web browser - Or serve it using a local web server:
# Using Python python -m http.server 8000 # Using Node.js npx serve frontend # Using PHP php -S localhost:8000 -t frontend
- Navigate to the
-
Start Analyzing
- Enter your GitHub username in the input field
- Click "Analyze Activity"
- Wait for data processing and visualization
codeclimate-analytics/
โโโ frontend/ # Client-side application
โ โโโ css/
โ โ โโโ styles.css # Complete styling with fintech dark theme
โ โโโ js/
โ โ โโโ script.js # Main application with error boundaries
โ โ โโโ data-fetcher.js # API integration with rate limiting
โ โ โโโ data-processor.js # Data normalization and correlation
โ โ โโโ chart-renderer.js # Chart.js visualization with dual y-axes
โ โ โโโ insight-generator.js # "David vs. Goliath" insights
โ โโโ index.html # Main HTML structure
โ โโโ test-chart.html # Chart testing interface
โ โโโ test-ui.html # UI component testing
โโโ backend/ # Future backend services (currently unused)
โ โโโ README.md
โโโ tests/ # Test files (unit & property-based)
โ โโโ README.md
โโโ docs/ # Project documentation
โ โโโ README.md
โโโ .kiro/specs/ # Kiro AI specifications
โ โโโ unicorn-weather-index/
โ โโโ requirements.md # EARS-compliant requirements
โ โโโ design.md # Architecture and correctness properties
โ โโโ tasks.md # Implementation task list
โโโ package.json # Project metadata
โโโ README.md # This file
- Core: Vanilla JavaScript (ES6+), HTML5, CSS3
- Visualization: Chart.js v4.x with dual y-axes configuration
- Layout: CSS Grid with responsive design
- Styling: Custom CSS with fintech dark theme
- Module System: ES6 modules with dynamic imports
- GitHub REST API v3: User and organization PushEvents
- Open-Meteo Weather API: Bangalore weather data (temperature, rainfall)
- Rate Limiting: Built-in request throttling and retry logic
- Error Handling: Comprehensive fallback and recovery mechanisms
- Unit Tests: Jest for specific examples and edge cases
- Property-Based Tests: fast-check for universal properties
- Integration Tests: End-to-end workflow validation
- Real-time GitHub Analysis: Fetch and process user PushEvents
- Industry Baseline Calculation: Aggregate data from 4 major Bangalore unicorns
- Weather Correlation Analysis: Statistical correlation with Bangalore weather
- Activity Score Normalization: 0-100% scaling for fair comparison
- Date Synchronization: Align activity and weather data by date
- Interactive Combo Chart: Line charts for activity, bar chart for rainfall
- Dual Y-Axes: Left axis for activity scores, right axis for rainfall
- Hover Tooltips: Detailed information with contextual insights
- Responsive Design: Optimized for desktop, tablet, and mobile
- Professional Styling: Fintech-inspired dark theme with animations
- "David vs. Goliath" Comparisons: User performance vs industry giants
- Weather Pattern Recognition: Identify productivity trends by weather
- Statistical Validation: Correlation coefficients with significance testing
- Personalized Recommendations: Optimal coding conditions and patterns
- Encouraging Messages: Guidance for insufficient data scenarios
- Comprehensive Error Boundaries: Global error catching and recovery
- Graceful Degradation: Partial functionality when APIs fail
- Rate Limit Management: Automatic retry with exponential backoff
- Component Health Monitoring: Periodic health checks and recovery
- Fallback Modes: Limited functionality during critical errors
- Endpoint:
https://api.github.com/users/{username}/events - Rate Limit: 60 requests/hour (unauthenticated)
- Data Type: PushEvents only
- Organizations Monitored: zerodha, razorpay, postmanlabs, hasura
- Endpoint:
https://api.open-meteo.com/v1/forecast - Location: Bangalore (12.9716ยฐN, 77.5946ยฐE)
- Parameters: daily temperature_2m_max, precipitation_sum
- Rate Limit: No strict limits, but requests are throttled
- Request Throttling: 1-second delay between requests
- Exponential Backoff: Progressive delays on failures
- Retry Logic: Up to 3 attempts with jitter
- Error Classification: Retryable vs non-retryable errors
The project uses a dual testing approach combining unit tests and property-based testing:
- Unit Tests: Validate specific examples, edge cases, and integration points
- Property-Based Tests: Verify universal properties across all valid inputs
- Integration Tests: End-to-end workflow validation
# Install dependencies (if using Node.js testing)
npm install
# Run unit tests
npm test
# Run property-based tests
npm run test:pbt
# Run all tests
npm run test:all- Data Fetching: API integration and error handling
- Data Processing: Normalization, aggregation, and correlation
- Chart Rendering: Visualization and responsive behavior
- Insight Generation: Statistical analysis and message generation
- Error Boundaries: Recovery mechanisms and fallback states
Cause: Too many requests to GitHub API (60/hour limit) Solution:
- Wait 1 hour for rate limit reset
- Use authenticated requests for higher limits (5000/hour)
- Check multiple users in sequence rather than parallel
Cause: Invalid GitHub username or private/non-existent account Solution:
- Verify username spelling and case sensitivity
- Ensure the account has public activity
- Check if the account exists on GitHub
Cause: Open-Meteo API temporary issues or network problems Solution:
- Refresh the page to retry
- Check internet connection
- Weather correlation will be skipped but activity analysis continues
Cause: Chart.js initialization issues or invalid data Solution:
- Ensure Chart.js CDN is accessible
- Check browser console for JavaScript errors
- Try refreshing the page
- Verify browser supports modern JavaScript features
Cause: User has no PushEvents in the last 30 days Solution:
- Make some commits to public repositories
- Wait for GitHub to update activity feed (can take a few minutes)
- Check if repositories are public (private activity won't show)
- Slow Loading: Check internet connection speed
- CORS Errors: Use a local web server instead of file:// protocol
- Timeout Errors: Refresh and try again, APIs may be temporarily slow
- Minimum Requirements: ES6 support, modern CSS features
- Recommended: Chrome 80+, Firefox 75+, Safari 13+, Edge 80+
- Known Issues: Internet Explorer not supported
- Large Datasets: Application handles up to 30 days of data efficiently
- Memory Usage: Chart instances are properly cleaned up
- Responsive Design: Optimized for various screen sizes
- No Data Storage: All data processing happens client-side
- No Authentication: Uses public GitHub API endpoints only
- No Tracking: No analytics or user tracking implemented
- API Keys: No API keys required or stored
- HTTPS: Ensure APIs are accessed over HTTPS
- Input Validation: GitHub usernames are validated before API calls
- Error Information: Sensitive error details are not exposed to users
- Rate Limiting: Prevents abuse of external APIs
- CSS Variables: Easy theme customization in
:rootselector - Color Scheme: Fintech dark theme with accent colors
- Responsive Breakpoints: Defined in CSS media queries
- Component Styling: Modular CSS with BEM-like naming
- Date Range: Modify
getDefaultDateRange()in DataFetcher - Organizations: Update
unicornOrgsarray in main application - Chart Options: Customize in ChartRenderer configuration
- Insight Thresholds: Adjust in InsightGenerator settings
- Initial Load: < 2 seconds on broadband
- Data Fetching: 3-10 seconds depending on API response
- Chart Rendering: < 1 second for typical datasets
- Insight Generation: < 500ms for statistical analysis
- Memory: ~10-20MB for typical usage
- Network: ~100-500KB data transfer per analysis
- CPU: Minimal impact, optimized for client-side processing
- Authentication: GitHub OAuth for higher rate limits
- Data Persistence: Local storage for historical comparisons
- More Organizations: Expand beyond Bangalore unicorns
- Advanced Analytics: Machine learning insights
- Export Features: PDF reports and data export
- Service Worker: Offline functionality
- Progressive Web App: Mobile app-like experience
- Backend API: Centralized data processing
- Real-time Updates: WebSocket connections for live data
- Client-Side Only: Simplifies deployment and reduces infrastructure
- Modular Design: Separate concerns with ES6 modules
- Error-First Design: Comprehensive error handling throughout
- Progressive Enhancement: Works with basic features, enhanced with full functionality
- ES6+ Features: Modern JavaScript with proper error handling
- Responsive Design: Mobile-first CSS approach
- Accessibility: Semantic HTML and keyboard navigation
- Performance: Optimized for smooth user experience
This project was built using Kiro AI's spec-driven development methodology:
- Requirements Gathering: EARS-compliant requirements with acceptance criteria
- Design Phase: Architecture, data models, and correctness properties
- Implementation: Task-driven development with property-based testing
- Integration: Component wiring with comprehensive error boundaries
- Fork the repository
- Create a feature branch
- Make changes following the existing code style
- Add tests for new functionality
- Submit a pull request
- JavaScript: ES6+ with consistent formatting
- CSS: BEM-like naming with CSS custom properties
- HTML: Semantic markup with accessibility considerations
- Unit tests for new functions and components
- Property-based tests for data processing logic
- Integration tests for user workflows
- Error handling validation
MIT License - see LICENSE file for details.
- GitHub API: For providing public activity data
- Open-Meteo: For free weather data access
- Chart.js: For powerful visualization capabilities
- Bangalore Tech Community: For inspiration and data sources
Built with โค๏ธ using Kiro AI's spec-driven development methodology