# bartoostveen/ical-proxy architecture

> Architecture diagram of the GitHub repository bartoostveen/ical-proxy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bartoostveen/ical-proxy
- Repository: https://github.com/bartoostveen/ical-proxy

## Overview

ical-proxy is a small HTTP service that fetches remote iCalendar feeds and returns calendars filtered by query parameters. A request without a feed URL redirects to the configured generator URL; otherwise the handler delegates retrieval and filtering to CalendarService, which uses an optional Redis cache. The sampled code shows filtering and calendar serialization in the calendar path. The README documents no additional product capabilities, and the calendar excerpt omits parts of its implementation, so the graph avoids claiming an unshown internal parsing call sequence.

Main entry points: [`src/main.rs`](https://github.com/bartoostveen/ical-proxy/blob/master/src/main.rs) (Root handler), [`src/calendar.rs`](https://github.com/bartoostveen/ical-proxy/blob/master/src/calendar.rs) (Calendar service), [`src/cache.rs`](https://github.com/bartoostveen/ical-proxy/blob/master/src/cache.rs) (Optional cache), [`src/error.rs`](https://github.com/bartoostveen/ical-proxy/blob/master/src/error.rs) (HTTP error mapping)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP interface"]
  node_server["Axum server<br/>[main.rs]"]
  node_handler["Root handler<br/>[main.rs]"]
  node_errors["HTTP error mapping<br/>[error.rs]"]
end

subgraph group_calendar["Calendar processing"]
  node_service["Calendar service<br/>[calendar.rs]"]
  node_filters["Filter parsing and matching<br/>[filter.rs]"]
end

subgraph group_runtime["Runtime configuration and cache"]
  node_cache["Optional cache<br/>[cache.rs]"]
  node_config["Configuration<br/>[config.rs]"]
end

node_consumer(("Calendar consumer"))
node_generator(("Generator site"))
node_redis[("Redis")]
node_feed(("Calendar feed"))

node_consumer -->|"sends request"| node_server
node_server -->|"routes GET"| node_handler
node_handler -->|"requests calendar"| node_service
node_handler -->|"redirects when URL absent"| node_generator
node_service -->|"fetches calendar"| node_feed
node_service -->|"parses and applies filters"| node_filters
node_service -->|"reads and writes entries"| node_cache
node_cache -->|"reads and writes"| node_redis
node_server -->|"loads settings"| node_config
node_handler -->|"maps service errors"| node_errors

click node_server "https://github.com/bartoostveen/ical-proxy/blob/master/src/main.rs"
click node_handler "https://github.com/bartoostveen/ical-proxy/blob/master/src/main.rs"
click node_service "https://github.com/bartoostveen/ical-proxy/blob/master/src/calendar.rs"
click node_filters "https://github.com/bartoostveen/ical-proxy/blob/master/src/filter.rs"
click node_cache "https://github.com/bartoostveen/ical-proxy/blob/master/src/cache.rs"
click node_config "https://github.com/bartoostveen/ical-proxy/blob/master/src/config.rs"
click node_errors "https://github.com/bartoostveen/ical-proxy/blob/master/src/error.rs"

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_errors toneBlue
class node_service,node_filters,node_redis toneAmber
class node_cache,node_config toneMint
class node_consumer,node_generator,node_feed toneIndigo
```

## Components

### HTTP interface

- [Axum server](https://github.com/bartoostveen/ical-proxy/blob/master/src/main.rs): `src/main.rs`
- [Root handler](https://github.com/bartoostveen/ical-proxy/blob/master/src/main.rs): `src/main.rs`
- [HTTP error mapping](https://github.com/bartoostveen/ical-proxy/blob/master/src/error.rs): `src/error.rs`

### Calendar processing

- [Calendar service](https://github.com/bartoostveen/ical-proxy/blob/master/src/calendar.rs): `src/calendar.rs`
- [Filter parsing and matching](https://github.com/bartoostveen/ical-proxy/blob/master/src/filter.rs): `src/filter.rs`

### Runtime configuration and cache

- [Optional cache](https://github.com/bartoostveen/ical-proxy/blob/master/src/cache.rs): `src/cache.rs`
- [Configuration](https://github.com/bartoostveen/ical-proxy/blob/master/src/config.rs): `src/config.rs`

### Other components

- **Calendar consumer**
- **Generator site**
- **Redis**
- **Calendar feed**

## Connections

- Calendar consumer → Axum server: sends request (evidence: `src/main.rs`)
- Axum server → Root handler: routes GET (evidence: `src/main.rs`)
- Root handler → Calendar service: requests calendar (evidence: `src/main.rs`)
- Root handler → Generator site: redirects when URL absent (evidence: `src/main.rs`)
- Calendar service → Calendar feed: fetches calendar (evidence: `src/calendar.rs`)
- Calendar service → Filter parsing and matching: parses and applies filters (evidence: `src/calendar.rs`)
- Calendar service → Optional cache: reads and writes entries (evidence: `src/calendar.rs`)
- Optional cache → Redis: reads and writes (evidence: `src/cache.rs`)
- Axum server → Configuration: loads settings (evidence: `src/main.rs`)
- Root handler → HTTP error mapping: maps service errors (evidence: `src/main.rs`)
