# harsh-o4/codolio-api architecture

> Architecture diagram of the GitHub repository harsh-o4/codolio-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harsh-o4/codolio-api
- Repository: https://github.com/harsh-o4/codolio-api

## Overview

Codolio API exposes live profile scraping by username or URL, plus a raw-HTML endpoint. The controller validates requests and delegates to the scraper service, which fetches Codolio pages and is intended to produce the profile response model. The scraper’s main parsing method is empty in the supplied excerpt, so the HTML-to-profile extraction flow cannot be established. There is no persistence layer or documented README feature detail; external calls and startup wiring are shown only where source supports them.

Main entry points: [`Program.cs`](https://github.com/harsh-o4/codolio-api/blob/main/Program.cs) (HTTP API host), [`Services/ScraperService.cs`](https://github.com/harsh-o4/codolio-api/blob/main/Services/ScraperService.cs) (Live scraper), [`Controllers/ProfileController.cs`](https://github.com/harsh-o4/codolio-api/blob/main/Controllers/ProfileController.cs) (Profile endpoints), [`Services/IScraperService.cs`](https://github.com/harsh-o4/codolio-api/blob/main/Services/IScraperService.cs) (Scraper contract)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API surface"]
  node_startup["HTTP API host<br/>[Program.cs]"]
  node_profile_controller["Profile endpoints"]
end

subgraph group_scraping["Scraping service"]
  node_scraper_contract["Scraper contract<br/>[IScraperService.cs]"]
  node_scraper["Live scraper<br/>[ScraperService.cs]"]
end

subgraph group_domain["Profile data"]
  node_profile_model["Profile response<br/>[Profile.cs]"]
end

node_client(("API caller"))
node_codolio["Codolio pages"]

node_client -->|"sends request"| node_startup
node_startup -->|"routes requests"| node_profile_controller
node_profile_controller -->|"delegates scraping"| node_scraper_contract
node_startup -->|"registers client"| node_scraper
node_scraper_contract -->|"returns profile"| node_profile_model
node_scraper -->|"fetches HTML"| node_codolio
node_scraper -.->|"builds response"| node_profile_model

click node_startup "https://github.com/harsh-o4/codolio-api/blob/main/Program.cs"
click node_profile_controller "https://github.com/harsh-o4/codolio-api/blob/main/Controllers/ProfileController.cs"
click node_scraper_contract "https://github.com/harsh-o4/codolio-api/blob/main/Services/IScraperService.cs"
click node_scraper "https://github.com/harsh-o4/codolio-api/blob/main/Services/ScraperService.cs"
click node_profile_model "https://github.com/harsh-o4/codolio-api/blob/main/models/Profile.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_startup,node_profile_controller toneBlue
class node_scraper_contract,node_scraper toneAmber
class node_profile_model,node_client toneMint
class node_codolio toneIndigo
```

## Components

### API surface

- [HTTP API host](https://github.com/harsh-o4/codolio-api/blob/main/Program.cs): `Program.cs`
- [Profile endpoints](https://github.com/harsh-o4/codolio-api/blob/main/Controllers/ProfileController.cs): `Controllers/ProfileController.cs`

### Scraping service

- [Scraper contract](https://github.com/harsh-o4/codolio-api/blob/main/Services/IScraperService.cs): `Services/IScraperService.cs`
- [Live scraper](https://github.com/harsh-o4/codolio-api/blob/main/Services/ScraperService.cs): `Services/ScraperService.cs`

### Profile data

- [Profile response](https://github.com/harsh-o4/codolio-api/blob/main/models/Profile.cs): `models/Profile.cs`

### Other components

- **API caller**
- **Codolio pages**

## Connections

- API caller → HTTP API host: sends request (evidence: `Program.cs`)
- HTTP API host → Profile endpoints: routes requests (evidence: `Program.cs`)
- Profile endpoints → Scraper contract: delegates scraping (evidence: `Controllers/ProfileController.cs`)
- HTTP API host → Live scraper: registers client (evidence: `Program.cs`)
- Scraper contract → Profile response: returns profile (evidence: `Services/IScraperService.cs`)
- Live scraper → Codolio pages: fetches HTML (evidence: `Services/ScraperService.cs`)
- Live scraper → Profile response: builds response (evidence: `Services/ScraperService.cs`)
