How loulakisioannis/dotnethub works
DotNetHub is an authenticated ASP.NET Core search API that concurrently queries NuGet, GitHub, and Stack Overflow, then filters, sorts, and pages a merged response. A per-source cache provides fresh and stale fallback results; outbound HTTP calls are protected by resilience policies and measured for API statistics. Statistics also feed an optional background anomaly check. The main search and instrumentation paths are shown from excerpts and README statements; unsampled registration and provider wiring is included only where documented.
Main entry points: SearchController.cs Search endpoint · CachingSearchProvider.cs Fresh and stale cache · SearchProviderRegistration.cs Provider registration · Program.cs Application setup
Components 22
Search workflow
- Search endpoint
src/DotNetHub.Api/Search/SearchController.cs - Search aggregator
src/DotNetHub.Api/Aggregation/SearchAggregator.cs - Filter and merge
src/DotNetHub.Api/Aggregation/ResultMerger.cs - Search response
src/DotNetHub.Api/Search/SearchResponse.cs - Source summaries
src/DotNetHub.Api/Search/SourceSummary.cs
Search sources
- Fresh and stale cache
src/DotNetHub.Api/Caching/CachingSearchProvider.cs - NuGet provider
src/DotNetHub.Api/Providers/NuGet/NuGetProvider.cs - GitHub provider
src/DotNetHub.Api/Providers/GitHub/GitHubProvider.cs - Stack Overflow provider
src/DotNetHub.Api/Providers/StackExchange/StackExchangeProvider.cs - NuGet API
- GitHub API
- Stack Exchange API
- Provider registration
src/DotNetHub.Api/Providers/SearchProviderRegistration.cs
Reliability and metrics
- HTTP resilience
src/DotNetHub.Api/Providers/SearchProviderResilience.cs - HTTP statistics handler
src/DotNetHub.Api/Statistics/StatisticsHandler.cs - Statistics store
src/DotNetHub.Api/Statistics/RequestStatisticsStore.cs - Statistics endpoint
src/DotNetHub.Api/Statistics/StatisticsController.cs - Anomaly background service
src/DotNetHub.Api/AnomalyDetection/AnomalyDetectionService.cs - Performance detector
src/DotNetHub.Api/AnomalyDetection/PerformanceAnomalyDetector.cs
API hosting
- Application setup
src/DotNetHub.Api/Program.cs - Bearer authentication
src/DotNetHub.Api/Authentication/BearerSecuritySchemeTransformer.cs
Other components
- API client
Connections 24
- API client → Search endpoint: requests search
src/DotNetHub.Api/Search/SearchController.cs - Search endpoint → Search aggregator: fetches sources
src/DotNetHub.Api/Search/SearchController.cs - Search endpoint → Filter and merge: filters and sorts
src/DotNetHub.Api/Search/SearchController.cs - Search endpoint → Search response: constructs response
src/DotNetHub.Api/Search/SearchController.cs - Search endpoint → Source summaries: summarizes sources
src/DotNetHub.Api/Search/SearchController.cs - Search aggregator → Fresh and stale cache: queries selected sources
- Fresh and stale cache → NuGet provider: delegates on miss
src/DotNetHub.Api/Caching/CachingSearchProvider.cs - Fresh and stale cache → GitHub provider: delegates on miss
src/DotNetHub.Api/Caching/CachingSearchProvider.cs - Fresh and stale cache → Stack Overflow provider: delegates on miss
src/DotNetHub.Api/Caching/CachingSearchProvider.cs - NuGet provider → NuGet API: searches packages
- GitHub provider → GitHub API: searches repositories
- Stack Overflow provider → Stack Exchange API: searches questions
- Application setup → Provider registration: registers providers
src/DotNetHub.Api/Program.cs - Provider registration → Fresh and stale cache: wraps providers
src/DotNetHub.Api/Providers/SearchProviderRegistration.cs - Provider registration → HTTP resilience: configures policies
- Provider registration → HTTP statistics handler: adds handler
src/DotNetHub.Api/Providers/SearchProviderRegistration.cs - HTTP statistics handler → Statistics store: records duration
src/DotNetHub.Api/Statistics/StatisticsHandler.cs - API client → Statistics endpoint: requests statistics
- Statistics endpoint → Statistics store: reads snapshot
src/DotNetHub.Api/Statistics/StatisticsController.cs - Application setup → Anomaly background service: starts background check
src/DotNetHub.Api/Program.cs - Anomaly background service → Statistics store: reads totals
src/DotNetHub.Api/AnomalyDetection/AnomalyDetectionService.cs - Anomaly background service → Performance detector: checks performance
src/DotNetHub.Api/AnomalyDetection/AnomalyDetectionService.cs - Application setup → Bearer authentication: configures bearer scheme
src/DotNetHub.Api/Program.cs - Bearer authentication → Search endpoint: documents bearer auth