CityBikeAnalytics is a high-performance .NET 9.0 console application designed to fetch, merge, and analyze real-time data from the New York City CitiBike system alongside current weather conditions.
- Real-Time Data Integration: Asynchronously pulls static station metadata and live availability status using the GBFS (General Bikeshare Feed Specification).
- Weather Awareness: Integrates the Open-Meteo API to fetch current temperature and wind speed for New York City (Lat: 40.71, Lon: -74.01).
- Parallel Processing: Utilizes
Task.WhenAllto execute multiple API requests concurrently, minimizing wait time. - Advanced LINQ Analytics:
- Data Merging: Joins static and dynamic datasets based on
station_id. - Critical Alerts: Identifies "Almost Empty" stations with fewer than 2 bikes available.
- E-Bike Tracker: Highlights top stations for electric bike availability.
- System Load: Calculates the overall percentage of bike occupancy across the entire network.
- Availability Clustering: Groups stations into categories: Empty, Normal, or High Supply.
- Geographic Insights: Determines the northernmost and southernmost active stations.
- Street Popularity: Analyzes station names to identify the most frequent streets in the network.
- Data Merging: Joins static and dynamic datasets based on
- Language: C# 13 (utilizing
recordtypes for immutable data models). - Framework: .NET 9.0.
- Libraries:
System.Net.Http: For asynchronous API communication.System.Text.Json: For high-speed JSON deserialization.System.Linq: For complex data querying and aggregation.
NetworkService.cs: Handles all HTTP logic and external API communication.Analyzer.cs: Contains the core business logic and LINQ reporting engine.Models.cs: Defines the data structures (Records) for API responses.Program.cs: The main entry point that orchestrates the data flow.
Data sourced from NYC CitiBike GBFS and Open-Meteo API.