# 0xarchit/hackathon-api architecture

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

- Interactive diagram: https://gitdiagram.com/0xarchit/hackathon-api
- Repository: https://github.com/0xarchit/hackathon-api

## Overview

Hackathons API gathers events from nine platforms and serves a unified, filtered, deduplicated, sorted response. The principal workflow is an HTTP request through the router and handler to the aggregator, which concurrently dispatches fetches, caches combined results, and returns them for JSON encoding. The source excerpts show the server wiring and aggregation behavior; platform coverage and the health endpoint are also documented or visible. The README describes caching as hourly, while the sampled service configures a 15-minute expiration, so the graph does not assert a cache duration.

Main entry points: [`pkg/aggregator/service.go`](https://github.com/0xarchit/hackathon-api/blob/main/pkg/aggregator/service.go) (Aggregator Service), [`pkg/api/handler.go`](https://github.com/0xarchit/hackathon-api/blob/main/pkg/api/handler.go) (API Handler), [`cmd/server/main.go`](https://github.com/0xarchit/hackathon-api/blob/main/cmd/server/main.go) (HTTP Server), [`pkg/fetcher/devfolio.go`](https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/devfolio.go) (Devfolio Fetcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_server["HTTP Server<br/>[main.go]"]
  node_handler["API Handler<br/>[handler.go]"]
end

subgraph group_aggregation["Aggregation"]
  node_aggregator["Aggregator Service<br/>[service.go]"]
  node_cache[("In-memory Cache<br/>[service.go]")]
end

subgraph group_fetchers["Platform Fetchers"]
  node_devfolio["Devfolio Fetcher<br/>[devfolio.go]"]
  node_unstop["Unstop Fetcher<br/>[unstop.go]"]
  node_devpost["Devpost Fetcher<br/>[devpost.go]"]
  node_mlh["MLH Fetcher<br/>[mlh.go]"]
  node_hackerearth["HackerEarth Fetcher<br/>[hackerearth.go]"]
  node_hack2skill["Hack2Skill Fetcher<br/>[hack2skill.go]"]
  node_reskill["ReSkill Fetcher<br/>[reskill.go]"]
  node_whereuelevate["WhereUElevate Fetcher<br/>[whereuelevate.go]"]
  node_devnovate["Devnovate Fetcher<br/>[devnovate.go]"]
end

node_client(("API Client"))
node_devfolio_site["Devfolio"]
node_unstop_site["Unstop"]
node_devpost_site["Devpost"]
node_mlh_site["MLH"]
node_hackerearth_site["HackerEarth"]
node_hack2skill_site["Hack2Skill"]
node_reskill_site["ReSkill"]
node_whereuelevate_site["WhereUElevate"]
node_devnovate_site["Devnovate"]

node_client -->|"requests"| node_server
node_server -->|"routes to"| node_handler
node_handler -->|"requests events"| node_aggregator
node_aggregator -->|"returns results"| node_handler
node_aggregator -->|"reads and writes"| node_cache
node_aggregator -->|"dispatches fetch"| node_devfolio
node_aggregator -->|"dispatches fetch"| node_unstop
node_aggregator -->|"dispatches fetch"| node_devpost
node_aggregator -->|"dispatches fetch"| node_mlh
node_aggregator -->|"dispatches fetch"| node_hackerearth
node_aggregator -->|"dispatches fetch"| node_hack2skill
node_aggregator -->|"dispatches fetch"| node_reskill
node_aggregator -->|"dispatches fetch"| node_whereuelevate
node_aggregator -->|"dispatches fetch"| node_devnovate
node_devfolio -->|"fetches events"| node_devfolio_site
node_unstop -->|"fetches events"| node_unstop_site
node_devpost -->|"fetches events"| node_devpost_site
node_mlh -->|"fetches events"| node_mlh_site
node_hackerearth -->|"fetches events"| node_hackerearth_site
node_hack2skill -->|"fetches events"| node_hack2skill_site
node_reskill -->|"fetches events"| node_reskill_site
node_whereuelevate -->|"fetches events"| node_whereuelevate_site
node_devnovate -->|"fetches events"| node_devnovate_site

click node_server "https://github.com/0xarchit/hackathon-api/blob/main/cmd/server/main.go"
click node_handler "https://github.com/0xarchit/hackathon-api/blob/main/pkg/api/handler.go"
click node_aggregator "https://github.com/0xarchit/hackathon-api/blob/main/pkg/aggregator/service.go"
click node_cache "https://github.com/0xarchit/hackathon-api/blob/main/pkg/aggregator/service.go"
click node_devfolio "https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/devfolio.go"
click node_unstop "https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/unstop.go"
click node_devpost "https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/devpost.go"
click node_mlh "https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/mlh.go"
click node_hackerearth "https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/hackerearth.go"
click node_hack2skill "https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/hack2skill.go"
click node_reskill "https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/reskill.go"
click node_whereuelevate "https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/whereuelevate.go"
click node_devnovate "https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/devnovate.go"

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_server,node_handler,node_client toneBlue
class node_aggregator,node_cache toneAmber
class node_devfolio,node_unstop,node_devpost,node_mlh,node_hackerearth,node_hack2skill,node_reskill,node_whereuelevate,node_devnovate toneMint
class node_devfolio_site,node_unstop_site,node_devpost_site,node_mlh_site,node_hackerearth_site,node_hack2skill_site,node_reskill_site,node_whereuelevate_site,node_devnovate_site toneIndigo
```

## Components

### HTTP API

- [HTTP Server](https://github.com/0xarchit/hackathon-api/blob/main/cmd/server/main.go): `cmd/server/main.go`
- [API Handler](https://github.com/0xarchit/hackathon-api/blob/main/pkg/api/handler.go): `pkg/api/handler.go`

### Aggregation

- [Aggregator Service](https://github.com/0xarchit/hackathon-api/blob/main/pkg/aggregator/service.go): `pkg/aggregator/service.go`
- [In-memory Cache](https://github.com/0xarchit/hackathon-api/blob/main/pkg/aggregator/service.go): `pkg/aggregator/service.go`

### Platform Fetchers

- [Devfolio Fetcher](https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/devfolio.go): `pkg/fetcher/devfolio.go`
- [Unstop Fetcher](https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/unstop.go): `pkg/fetcher/unstop.go`
- [Devpost Fetcher](https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/devpost.go): `pkg/fetcher/devpost.go`
- [MLH Fetcher](https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/mlh.go): `pkg/fetcher/mlh.go`
- [HackerEarth Fetcher](https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/hackerearth.go): `pkg/fetcher/hackerearth.go`
- [Hack2Skill Fetcher](https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/hack2skill.go): `pkg/fetcher/hack2skill.go`
- [ReSkill Fetcher](https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/reskill.go): `pkg/fetcher/reskill.go`
- [WhereUElevate Fetcher](https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/whereuelevate.go): `pkg/fetcher/whereuelevate.go`
- [Devnovate Fetcher](https://github.com/0xarchit/hackathon-api/blob/main/pkg/fetcher/devnovate.go): `pkg/fetcher/devnovate.go`

### Other components

- **API Client**
- **Devfolio**
- **Unstop**
- **Devpost**
- **MLH**
- **HackerEarth**
- **Hack2Skill**
- **ReSkill**
- **WhereUElevate**
- **Devnovate**

## Connections

- API Client → HTTP Server: requests (evidence: `cmd/server/main.go`)
- HTTP Server → API Handler: routes to (evidence: `cmd/server/main.go`)
- API Handler → Aggregator Service: requests events (evidence: `pkg/api/handler.go`)
- Aggregator Service → API Handler: returns results (evidence: `pkg/api/handler.go`)
- Aggregator Service → In-memory Cache: reads and writes (evidence: `pkg/aggregator/service.go`)
- Aggregator Service → Devfolio Fetcher: dispatches fetch (evidence: `pkg/aggregator/service.go`)
- Aggregator Service → Unstop Fetcher: dispatches fetch (evidence: `pkg/aggregator/service.go`)
- Aggregator Service → Devpost Fetcher: dispatches fetch (evidence: `pkg/aggregator/service.go`)
- Aggregator Service → MLH Fetcher: dispatches fetch (evidence: `pkg/aggregator/service.go`)
- Aggregator Service → HackerEarth Fetcher: dispatches fetch (evidence: `pkg/aggregator/service.go`)
- Aggregator Service → Hack2Skill Fetcher: dispatches fetch (evidence: `pkg/aggregator/service.go`)
- Aggregator Service → ReSkill Fetcher: dispatches fetch (evidence: `pkg/aggregator/service.go`)
- Aggregator Service → WhereUElevate Fetcher: dispatches fetch (evidence: `pkg/aggregator/service.go`)
- Aggregator Service → Devnovate Fetcher: dispatches fetch (evidence: `pkg/aggregator/service.go`)
- Devfolio Fetcher → Devfolio: fetches events (evidence: `README.md`)
- Unstop Fetcher → Unstop: fetches events (evidence: `README.md`)
- Devpost Fetcher → Devpost: fetches events (evidence: `README.md`)
- MLH Fetcher → MLH: fetches events (evidence: `README.md`)
- HackerEarth Fetcher → HackerEarth: fetches events (evidence: `README.md`)
- Hack2Skill Fetcher → Hack2Skill: fetches events (evidence: `README.md`)
- ReSkill Fetcher → ReSkill: fetches events (evidence: `README.md`)
- WhereUElevate Fetcher → WhereUElevate: fetches events (evidence: `README.md`)
- Devnovate Fetcher → Devnovate: fetches events (evidence: `README.md`)
