How stefanosvasileiou/apiaggregator works
ApiAggregator is an ASP.NET Core service that exposes authenticated aggregation and statistics endpoints, plus anonymous token and health endpoints. Its main workflow validates an aggregation request, fans out to selected sources, uses fresh or stale cached results when appropriate, and returns normalized, filtered, sorted items with explicit source degradation. Separate runtime capabilities record outbound-request latency and monitor it for anomalies. The excerpts show orchestration and registration; the README documents resilience and API behavior, while some endpoint wiring and source details are only partially sampled.
Main entry points: AggregationService.cs Aggregation service · Program.cs Aggregate endpoint · ApiStatsStore.cs Stats store · PerformanceAnomalyMonitor.cs Anomaly monitor
Components 18
API and auth
- Token endpoint
src/ApiAggregator.Api/Program.cs - JWT auth
src/ApiAggregator.Api/Program.cs - Aggregate endpoint
src/ApiAggregator.Api/Program.cs - Stats endpoint
src/ApiAggregator.Api/Program.cs - Health endpoint
src/ApiAggregator.Api/Program.cs
Aggregation
- Aggregation service
src/ApiAggregator.Core/Aggregation/AggregationService.cs - Memory cache
src/ApiAggregator.Core/Caching/MemoryCacheSourceCache.cs
Data sources
- GitHub source
src/ApiAggregator.Core/Sources/GitHubSource.cs - Hacker News source
src/ApiAggregator.Core/Sources/HackerNewsSource.cs - NewsAPI source
src/ApiAggregator.Core/Sources/NewsApiSource.cs
Observability
- Stats handler
src/ApiAggregator.Core/Resilience/StatsRecordingHandler.cs - Stats store
src/ApiAggregator.Core/Statistics/ApiStatsStore.cs - Anomaly monitor
src/ApiAggregator.Core/BackgroundServices/PerformanceAnomalyMonitor.cs - Anomaly detector
src/ApiAggregator.Core/Statistics/AnomalyDetector.cs
Other components
- API caller
- GitHub API
- Hacker News API
- NewsAPI
Connections 19
- API caller → Token endpoint: requests token
README.md - Token endpoint → API caller: returns JWT
src/ApiAggregator.Api/Program.cs - API caller → Aggregate endpoint: requests results
README.md - API caller → Stats endpoint: requests stats
README.md - API caller → Health endpoint: checks health
README.md - Aggregate endpoint → JWT auth: requires authorization
src/ApiAggregator.Api/Program.cs - Stats endpoint → JWT auth: requires authorization
README.md - Aggregate endpoint → Aggregation service: calls aggregate
src/ApiAggregator.Api/Program.cs - Aggregation service → Memory cache: reads and writes
src/ApiAggregator.Core/Aggregation/AggregationService.cs - Aggregation service → GitHub source: fetches selected
src/ApiAggregator.Core/Aggregation/AggregationService.cs - Aggregation service → Hacker News source: fetches selected
src/ApiAggregator.Core/Aggregation/AggregationService.cs - Aggregation service → NewsAPI source: fetches selected
src/ApiAggregator.Core/Aggregation/AggregationService.cs - GitHub source → GitHub API: fetches data
README.md - Hacker News source → Hacker News API: fetches data
README.md - NewsAPI source → NewsAPI: fetches data
README.md - Stats endpoint → Stats store: reads snapshot
src/ApiAggregator.Api/Program.cs - Stats handler → Stats store: records latency
src/ApiAggregator.Core/Resilience/StatsRecordingHandler.cs - Anomaly monitor → Stats store: reads windowed stats
src/ApiAggregator.Core/BackgroundServices/PerformanceAnomalyMonitor.cs - Anomaly monitor → Anomaly detector: checks anomalies
src/ApiAggregator.Core/BackgroundServices/PerformanceAnomalyMonitor.cs