# raghava-183/ca-activity-calendar architecture

> Architecture diagram of the GitHub repository raghava-183/ca-activity-calendar, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/raghava-183/ca-activity-calendar
- Repository: https://github.com/raghava-183/ca-activity-calendar

## Overview

Activity Calendar is a shared, read-publicly department calendar with code-gated organiser edits. Visitors view activities, proof links, summaries and printable reports; organisers can attach proofs, update status and notes, and change the calendar. The page retrieves current records through the read API, while edits go through the save API and persist in Neon Postgres. The README documents the page capabilities, but its source was not excerpted, so its internal UI structure and exact request wiring are not shown.

Main entry points: [`public/index.html`](https://github.com/raghava-183/ca-activity-calendar/blob/main/public/index.html) (Calendar and organiser UI), [`api/_db.js`](https://github.com/raghava-183/ca-activity-calendar/blob/main/api/_db.js) (Schema and record access), [`api/records.js`](https://github.com/raghava-183/ca-activity-calendar/blob/main/api/records.js) (Read records API), [`api/save.js`](https://github.com/raghava-183/ca-activity-calendar/blob/main/api/save.js) (Save and edit API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Calendar experience"]
  node_calendar["Calendar and organiser UI<br/>[index.html]"]
  node_views["Summary and report<br/>[index.html]"]
end

subgraph group_api["API handlers"]
  node_records["Read records API<br/>[records.js]"]
  node_save["Save and edit API<br/>[save.js]"]
end

subgraph group_data["Persistence"]
  node_db["Schema and record access<br/>[_db.js]"]
end

node_visitor(("Visitor or organiser"))
node_neon[("Neon Postgres")]
node_drive["Google Drive proofs"]

node_visitor -->|"opens"| node_calendar
node_calendar -->|"fetches records"| node_records
node_calendar -->|"submits edits"| node_save
node_calendar -->|"shows"| node_views
node_visitor -->|"opens proof links"| node_drive
node_records -->|"reads records"| node_db
node_save -->|"writes and rereads"| node_db
node_db -->|"queries"| node_neon

click node_calendar "https://github.com/raghava-183/ca-activity-calendar/blob/main/public/index.html"
click node_views "https://github.com/raghava-183/ca-activity-calendar/blob/main/public/index.html"
click node_records "https://github.com/raghava-183/ca-activity-calendar/blob/main/api/records.js"
click node_save "https://github.com/raghava-183/ca-activity-calendar/blob/main/api/save.js"
click node_db "https://github.com/raghava-183/ca-activity-calendar/blob/main/api/_db.js"

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_calendar,node_views toneBlue
class node_records,node_save,node_neon toneAmber
class node_db toneMint
class node_visitor,node_drive toneIndigo
```

## Components

### Calendar experience

- [Calendar and organiser UI](https://github.com/raghava-183/ca-activity-calendar/blob/main/public/index.html): `public/index.html`
- [Summary and report](https://github.com/raghava-183/ca-activity-calendar/blob/main/public/index.html): `public/index.html`

### API handlers

- [Read records API](https://github.com/raghava-183/ca-activity-calendar/blob/main/api/records.js): `api/records.js`
- [Save and edit API](https://github.com/raghava-183/ca-activity-calendar/blob/main/api/save.js): `api/save.js`

### Persistence

- [Schema and record access](https://github.com/raghava-183/ca-activity-calendar/blob/main/api/_db.js): `api/_db.js`

### Other components

- **Visitor or organiser**
- **Neon Postgres**
- **Google Drive proofs**

## Connections

- Visitor or organiser → Calendar and organiser UI: opens (evidence: `README.md`)
- Calendar and organiser UI → Read records API: fetches records (evidence: `README.md`)
- Calendar and organiser UI → Save and edit API: submits edits (evidence: `README.md`)
- Calendar and organiser UI → Summary and report: shows (evidence: `README.md`)
- Visitor or organiser → Google Drive proofs: opens proof links (evidence: `README.md`)
- Read records API → Schema and record access: reads records (evidence: `api/records.js`)
- Save and edit API → Schema and record access: writes and rereads (evidence: `api/save.js`)
- Schema and record access → Neon Postgres: queries (evidence: `api/_db.js`)
