# intelliraff/github-archaeologist architecture

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

- Interactive diagram: https://gitdiagram.com/intelliraff/github-archaeologist
- Repository: https://github.com/intelliraff/github-archaeologist

## Overview

GitHub-archaeologist is a Flask application for signing in, submitting a GitHub repository, and receiving a repository activity and health summary. Its main workflow validates the signed-in session, fetches repository and contributor data from GitHub, computes activity status and a health score, stores repository and per-user analysis records, and returns JSON. It also provides dashboard, logout, history, and repository-listing routes. The README gives no further capability detail; route and storage relationships below are evidenced by the sampled application source.

Main entry points: [`jjwt.py`](https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py) (Repository analysis), [`templates/login.html`](https://github.com/intelliraff/github-archaeologist/blob/main/templates/login.html) (Login page), [`templates/dashboard.html`](https://github.com/intelliraff/github-archaeologist/blob/main/templates/dashboard.html) (Dashboard page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web and authentication"]
  node_app["Flask routes<br/>[jjwt.py]"]
  node_login["Login and signup<br/>[jjwt.py]"]
  node_tokens["Session and JWT<br/>[jjwt.py]"]
  node_login_page["Login page<br/>[login.html]"]
  node_dashboard_page["Dashboard page<br/>[dashboard.html]"]
end

subgraph group_analysis["Repository analysis"]
  node_submit["Repository analysis<br/>[jjwt.py]"]
  node_github["GitHub API"]
  node_scoring["Status and health scoring<br/>[jjwt.py]"]
  node_result["JSON results<br/>[jjwt.py]"]
  node_history["Analysis history<br/>[jjwt.py]"]
  node_listing["Repository listing<br/>[jjwt.py]"]
end

subgraph group_data["Persistence"]
  node_db[("SQLite database<br/>[jjwt.py]")]
  node_user_model["User records<br/>[jjwt.py]"]
  node_repo_model["Repository records<br/>[jjwt.py]"]
  node_analysis_model["Analysis records<br/>[jjwt.py]"]
end

node_visitor(("Visitor"))

node_visitor -->|"requests pages"| node_app
node_app -->|"renders"| node_login_page
node_app -->|"renders"| node_dashboard_page
node_visitor -->|"submits credentials"| node_login
node_login -->|"looks up or creates"| node_user_model
node_login -->|"creates token and session"| node_tokens
node_app -->|"validates session token"| node_tokens
node_visitor -->|"submits repository URL"| node_submit
node_submit -->|"fetches repository and contributors"| node_github
node_submit -->|"calculates status and score"| node_scoring
node_submit -->|"stores repository details"| node_repo_model
node_submit -->|"stores user analysis"| node_analysis_model
node_submit -->|"returns summary"| node_result
node_visitor -->|"requests history"| node_history
node_history -->|"looks up current user"| node_user_model
node_history -->|"reads user analyses"| node_analysis_model
node_visitor -->|"requests repositories"| node_listing
node_listing -->|"reads all repositories"| node_repo_model
node_user_model -->|"persists records"| node_db
node_repo_model -->|"persists records"| node_db
node_analysis_model -->|"persists records"| node_db

click node_app "https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py"
click node_login "https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py"
click node_tokens "https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py"
click node_login_page "https://github.com/intelliraff/github-archaeologist/blob/main/templates/login.html"
click node_dashboard_page "https://github.com/intelliraff/github-archaeologist/blob/main/templates/dashboard.html"
click node_submit "https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py"
click node_scoring "https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py"
click node_result "https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py"
click node_history "https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py"
click node_listing "https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py"
click node_db "https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py"
click node_user_model "https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py"
click node_repo_model "https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py"
click node_analysis_model "https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py"

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_app,node_login,node_tokens,node_login_page,node_dashboard_page toneBlue
class node_submit,node_github,node_scoring,node_result,node_history,node_listing toneAmber
class node_db,node_user_model,node_repo_model,node_analysis_model toneMint
class node_visitor toneIndigo
```

## Components

### Web and authentication

- [Flask routes](https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py): `jjwt.py`
- [Login and signup](https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py): `jjwt.py`
- [Session and JWT](https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py): `jjwt.py`
- [Login page](https://github.com/intelliraff/github-archaeologist/blob/main/templates/login.html): `templates/login.html`
- [Dashboard page](https://github.com/intelliraff/github-archaeologist/blob/main/templates/dashboard.html): `templates/dashboard.html`

### Repository analysis

- [Repository analysis](https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py): `jjwt.py`
- **GitHub API**
- [Status and health scoring](https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py): `jjwt.py`
- [JSON results](https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py): `jjwt.py`
- [Analysis history](https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py): `jjwt.py`
- [Repository listing](https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py): `jjwt.py`

### Persistence

- [SQLite database](https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py): `jjwt.py`
- [User records](https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py): `jjwt.py`
- [Repository records](https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py): `jjwt.py`
- [Analysis records](https://github.com/intelliraff/github-archaeologist/blob/main/jjwt.py): `jjwt.py`

### Other components

- **Visitor**

## Connections

- Visitor → Flask routes: requests pages (evidence: `jjwt.py`)
- Flask routes → Login page: renders (evidence: `jjwt.py`)
- Flask routes → Dashboard page: renders (evidence: `jjwt.py`)
- Visitor → Login and signup: submits credentials (evidence: `jjwt.py`)
- Login and signup → User records: looks up or creates (evidence: `jjwt.py`)
- Login and signup → Session and JWT: creates token and session (evidence: `jjwt.py`)
- Flask routes → Session and JWT: validates session token (evidence: `jjwt.py`)
- Visitor → Repository analysis: submits repository URL (evidence: `jjwt.py`)
- Repository analysis → GitHub API: fetches repository and contributors (evidence: `jjwt.py`)
- Repository analysis → Status and health scoring: calculates status and score (evidence: `jjwt.py`)
- Repository analysis → Repository records: stores repository details (evidence: `jjwt.py`)
- Repository analysis → Analysis records: stores user analysis (evidence: `jjwt.py`)
- Repository analysis → JSON results: returns summary (evidence: `jjwt.py`)
- Visitor → Analysis history: requests history (evidence: `jjwt.py`)
- Analysis history → User records: looks up current user (evidence: `jjwt.py`)
- Analysis history → Analysis records: reads user analyses (evidence: `jjwt.py`)
- Visitor → Repository listing: requests repositories (evidence: `jjwt.py`)
- Repository listing → Repository records: reads all repositories (evidence: `jjwt.py`)
- User records → SQLite database: persists records (evidence: `jjwt.py`)
- Repository records → SQLite database: persists records (evidence: `jjwt.py`)
- Analysis records → SQLite database: persists records (evidence: `jjwt.py`)
