# salamon10403/actuaries architecture

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

- Interactive diagram: https://gitdiagram.com/salamon10403/actuaries
- Repository: https://github.com/salamon10403/actuaries

## Overview

This repository is an actuarial past-papers portal. Students choose an institute, subject, year, and month, then view or download question papers and solutions from the local archive or, after authentication, an institute portal. The browser also supports local-file uploads, themes, and feedback. Separately, the IAI scraper discovers public papers, downloads them, and writes a catalog. The README is empty; relationships below are grounded in the shown source excerpts, so unsampled details are left out.

Main entry points: [`script.js`](https://github.com/salamon10403/actuaries/blob/main/script.js) (Browser Interactions), [`server.js`](https://github.com/salamon10403/actuaries/blob/main/server.js) (Official Paper Retrieval), [`pdfs/IAI`](https://github.com/salamon10403/actuaries/tree/main/pdfs/IAI) (Local Archive), [`scrape_iai.py`](https://github.com/salamon10403/actuaries/blob/main/scrape_iai.py) (Paper Scraper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Student Portal"]
  node_ui["Portal UI<br/>[index.html]"]
  node_browser["Browser Interactions<br/>[script.js]"]
end

subgraph group_server["Portal Server"]
  node_server["HTTP API<br/>[server.js]"]
  node_auth["Portal Sessions<br/>[server.js]"]
  node_paperfetch["Official Paper Retrieval<br/>[server.js]"]
  node_localapi["Local Paper API<br/>[server.js]"]
  node_upload["Local File Upload<br/>[server.js]"]
  node_feedback["Feedback Handler<br/>[server.js]"]
  node_feedbackstore[("Feedback Records<br/>[server.js]")]
end

subgraph group_archive["Paper Archive"]
  node_archive[("Local Archive")]
  node_cache[("Paper Cache<br/>[server.js]")]
end

subgraph group_scraper["IAI Scraper"]
  node_scraper["Paper Scraper<br/>[scrape_iai.py]"]
  node_catalog["Paper Catalog<br/>[iai_papers.json]"]
end

node_student(("Student"))
node_official{{"Institute Portal"}}
node_publicsite{{"IAI Paper Site"}}

node_student -->|"uses"| node_ui
node_ui -.->|"loads"| node_browser
node_browser -->|"requests API"| node_server
node_server -->|"serves static"| node_ui
node_browser -->|"starts login"| node_auth
node_auth -->|"drives login"| node_official
node_browser -->|"requests paper"| node_paperfetch
node_paperfetch -->|"fetches paper"| node_official
node_paperfetch -->|"reads and writes"| node_cache
node_paperfetch -->|"saves paper"| node_archive
node_browser -->|"requests local papers"| node_localapi
node_localapi -->|"lists and streams"| node_archive
node_browser -->|"uploads files"| node_upload
node_upload -->|"writes files"| node_archive
node_browser -.->|"submits feedback"| node_feedback
node_feedback -->|"persists records"| node_feedbackstore
node_scraper -->|"scrapes listings"| node_publicsite
node_scraper -->|"downloads papers"| node_archive
node_scraper -->|"writes catalog"| node_catalog

click node_ui "https://github.com/salamon10403/actuaries/blob/main/index.html"
click node_browser "https://github.com/salamon10403/actuaries/blob/main/script.js"
click node_server "https://github.com/salamon10403/actuaries/blob/main/server.js"
click node_auth "https://github.com/salamon10403/actuaries/blob/main/server.js"
click node_paperfetch "https://github.com/salamon10403/actuaries/blob/main/server.js"
click node_localapi "https://github.com/salamon10403/actuaries/blob/main/server.js"
click node_upload "https://github.com/salamon10403/actuaries/blob/main/server.js"
click node_feedback "https://github.com/salamon10403/actuaries/blob/main/server.js"
click node_archive "https://github.com/salamon10403/actuaries/tree/main/pdfs/IAI"
click node_cache "https://github.com/salamon10403/actuaries/blob/main/server.js"
click node_scraper "https://github.com/salamon10403/actuaries/blob/main/scrape_iai.py"
click node_catalog "https://github.com/salamon10403/actuaries/blob/main/iai_papers.json"
click node_feedbackstore "https://github.com/salamon10403/actuaries/blob/main/server.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_ui,node_browser toneBlue
class node_server,node_auth,node_paperfetch,node_localapi,node_upload,node_feedback,node_feedbackstore toneAmber
class node_archive,node_cache toneMint
class node_scraper,node_catalog toneRose
class node_student,node_official,node_publicsite toneIndigo
```

## Components

### Student Portal

- [Portal UI](https://github.com/salamon10403/actuaries/blob/main/index.html): `index.html`
- [Browser Interactions](https://github.com/salamon10403/actuaries/blob/main/script.js): `script.js`

### Portal Server

- [HTTP API](https://github.com/salamon10403/actuaries/blob/main/server.js): `server.js`
- [Portal Sessions](https://github.com/salamon10403/actuaries/blob/main/server.js): `server.js`
- [Official Paper Retrieval](https://github.com/salamon10403/actuaries/blob/main/server.js): `server.js`
- [Local Paper API](https://github.com/salamon10403/actuaries/blob/main/server.js): `server.js`
- [Local File Upload](https://github.com/salamon10403/actuaries/blob/main/server.js): `server.js`
- [Feedback Handler](https://github.com/salamon10403/actuaries/blob/main/server.js): `server.js`
- [Feedback Records](https://github.com/salamon10403/actuaries/blob/main/server.js): `server.js`

### Paper Archive

- [Local Archive](https://github.com/salamon10403/actuaries/tree/main/pdfs/IAI): `pdfs/IAI`
- [Paper Cache](https://github.com/salamon10403/actuaries/blob/main/server.js): `server.js`

### IAI Scraper

- [Paper Scraper](https://github.com/salamon10403/actuaries/blob/main/scrape_iai.py): `scrape_iai.py`
- [Paper Catalog](https://github.com/salamon10403/actuaries/blob/main/iai_papers.json): `iai_papers.json`

### Other components

- **Student**
- **Institute Portal**
- **IAI Paper Site**

## Connections

- Student → Portal UI: uses
- Portal UI → Browser Interactions: loads
- Browser Interactions → HTTP API: requests API (evidence: `script.js`)
- HTTP API → Portal UI: serves static (evidence: `server.js`)
- Browser Interactions → Portal Sessions: starts login (evidence: `script.js`)
- Portal Sessions → Institute Portal: drives login (evidence: `server.js`)
- Browser Interactions → Official Paper Retrieval: requests paper (evidence: `script.js`)
- Official Paper Retrieval → Institute Portal: fetches paper (evidence: `server.js`)
- Official Paper Retrieval → Paper Cache: reads and writes (evidence: `server.js`)
- Official Paper Retrieval → Local Archive: saves paper (evidence: `server.js`)
- Browser Interactions → Local Paper API: requests local papers (evidence: `script.js`)
- Local Paper API → Local Archive: lists and streams (evidence: `server.js`)
- Browser Interactions → Local File Upload: uploads files (evidence: `script.js`)
- Local File Upload → Local Archive: writes files (evidence: `server.js`)
- Browser Interactions → Feedback Handler: submits feedback
- Feedback Handler → Feedback Records: persists records (evidence: `server.js`)
- Paper Scraper → IAI Paper Site: scrapes listings (evidence: `scrape_iai.py`)
- Paper Scraper → Local Archive: downloads papers (evidence: `scrape_iai.py`)
- Paper Scraper → Paper Catalog: writes catalog (evidence: `scrape_iai.py`)
