DevInsights is a portfolio sample project demonstrating production-oriented .NET development practices. It is a service-oriented ASP.NET Core application that aggregates and enriches developer profiles from Github, augmenting them with geographic and real-time weather data.
Note
This project was built as a work sample to demonstrate backend architecture, API design, CLI tooling, testing practices, and containerized deployment. It is fully functional and reflects real-world engineering standards.
The solution is composed of three projects:
An ASP.NET Core Minimal API that forms the core of the system. It exposes a REST API for tracking Github developers and enriching their profiles with country metadata and current temperature data. Data is persisted in MongoDB.
Responsibilities:
- REST API for developer tracking, retrieval, and removal
- Profile enrichment via REST Countries and Open-Meteo APIs
- Background synchronization via a hosted
GithubSyncJob - Structured logging with Serilog
- OpenAPI and Scalar documentation (development only)
Internal structure:
DevInsights.Server
├── BackgroundJobs # Hosted synchronization service
├── Domain # Core entity (Developer)
├── DTOs # Internal data transfer types
├── Infrastructure # Typed HTTP clients (Github, Weather, Country, Mongo)
├── Services # Application logic (GithubService, WeatherService, CountryService)
└── Program.cs # Composition root and endpoint definitions
A cross-platform command-line interface built with Spectre.Console.Cli for interacting with the DevInsights server.
Commands:
| Command | Description |
|---|---|
track <username> |
Track a new Github developer |
get <username> |
Get a tracked developer's enriched profile |
get <username> --json |
Output enriched profile as raw JSON |
list |
List all tracked developers |
list --json |
Output developer list as raw JSON |
sync |
Synchronise all tracked developers with latest data |
remove <username> |
Remove a tracked developer |
clear |
Remove all tracked developers |
An xUnit-based test project containing integration and unit tests.
Coverage:
ApiIntegrationTests- full HTTP integration tests viaWebApplicationFactoryGithubServiceTests- unit tests for tracking and sync logicCountryServiceTests- unit tests for country resolution and fallback behaviourWeatherServiceTests- unit tests for temperature resolution and geocoding fallback
# Track a developer
devinsights track MrRobinOfficial
# Track and output as JSON
devinsights track MrRobinOfficial --json
# View enriched profile
devinsights get MrRobinOfficial
# View enriched profile as JSON
devinsights get MrRobinOfficial --json
# List all tracked developers
devinsights list
# List as JSON
devinsights list --json
# Sync all tracked developers with latest Github and weather data
devinsights sync
# Remove a specific developer
devinsights remove MrRobinOfficial
# Remove all tracked developers (prompts for confirmation)
devinsights clearExample track output:
┌─Tracked Developer──────────────────────────┐
│ Username: mrrobinofficial │
│ Location: Sweden (Stockholm) │
│ Repos: 11 │
│ Temp: 2.5°C │
└────────────────────────────────────────────┘
Example get output:
╭──────────────┬──────────────────────────╮
│ Field │ Value │
├──────────────┼──────────────────────────┤
│ Username │ mrrobinofficial │
│ Location │ Sweden │
│ Capital │ Stockholm │
│ Public Repos │ 11 │
│ Temperature │ 2.5°C │
│ Last Synced │ 2026-04-03T07:52:41.256Z │
╰──────────────┴──────────────────────────╯
Example list output:
╭─────────────────┬──────────────────────┬───────┬──────────────────────────╮
│ Username │ Location │ Repos │ Last Synced │
├─────────────────┼──────────────────────┼───────┼──────────────────────────┤
│ mrrobinofficial │ Sweden │ 11 │ 2026-04-03T07:52:41.256Z │
│ thecherno │ Melbourne, Australia │ 30 │ 2026-04-03T08:07:13.625Z │
╰─────────────────┴──────────────────────┴───────┴──────────────────────────╯
Total: 2 developer(s)
- .NET 10 SDK
- Docker and Docker Compose
The recommended way to run the full stack:
docker-compose up --buildThis starts:
- API at
http://localhost:5226 - MongoDB at
localhost:27017with a persistent volume (mongo-data)
MongoDB must be available at mongodb://localhost:27017.
cd DevInsights.Server
dotnet restore
dotnet rundotnet testTrack a new Github developer. Fetches profile data, enriches it with country and weather information, and persists to MongoDB.
Retrieve a tracked developer's enriched profile. Returns cached data if fresh (within 1 hour), otherwise re-fetches from Github.
Example response:
{
"username": "mrrobinofficial",
"publicRepos": 11,
"lastSyncedAt": "2026-04-03T07:52:41.256Z",
"location": "Sweden",
"capital": "Stockholm",
"temperature": 2.5
}List all tracked developers.
Remove a tracked developer and their persisted data.
Remove all tracked developers.
Trigger a manual synchronisation of all tracked developers. Updates Github stats, country metadata, and temperature for each profile.
Example response:
{
"updated": 2
}| Key | Default | Description |
|---|---|---|
MongoDB:ConnectionString |
mongodb://localhost:27017 |
MongoDB connection string |
MongoDB:DatabaseName |
devinsights |
Target database name |
ASPNETCORE_ENVIRONMENT |
Production |
Controls OpenAPI exposure and logging verbosity |
Environment variables follow the standard ASP.NET Core double-underscore convention:
MongoDB__ConnectionString=mongodb://mongo:27017
MongoDB__DatabaseName=devinsightsGithubSyncJob is a hosted background service that periodically re-syncs all tracked developers. Each sync cycle:
- Fetches the latest public repo count and profile data from Github
- Re-resolves country metadata from the developer's location string
- Fetches the current temperature at the resolved capital city
- Persists the updated document to MongoDB, preserving the existing
_id
Manual sync is also available via POST /api/devinsights/sync or the devinsights sync CLI command.
| Provider | Purpose |
|---|---|
| Github REST API | Developer profile and repository data |
| REST Countries | Country metadata and capital city resolution |
| Open-Meteo | Current temperature via geocoding + forecast API |
All integrations are encapsulated behind typed HttpClient implementations with Polly-based retry policies.
- Structured request/response logging via Serilog
- Debug-level logging for all external HTTP calls
- Centralised exception handler returning consistent
application/problem+jsonresponses - OpenAPI + Scalar interactive docs available at
/scalarin development
This project is licensed under the MIT License unless stated otherwise.