# jeoff1/chord-newver architecture

> Architecture diagram of the GitHub repository jeoff1/chord-newver, 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/jeoff1/chord-newver
- Repository: https://github.com/jeoff1/chord-newver

## Overview

CHORD is a church worship-planning system. Pastors schedule themed services; a background worker turns themes into search phrases, retrieves songs and lyrics, analyzes and ranks candidates; worship leaders shape and confirm lineups, which the team can then see with keys. Separate branches cover church setup, accounts and roles, audit, members, reports, and the documented Teams and Announcements capabilities. Edges reflect README statements or shown imports and dispatches; unsampled internals are represented by exact directory paths, with uncertain wiring omitted.

Main entry points: [`apps/worship/lineups.py`](https://github.com/jeoff1/chord-newver/blob/master/apps/worship/lineups.py) (Lineup editing), [`apps/worship/models/schedule.py`](https://github.com/jeoff1/chord-newver/blob/master/apps/worship/models/schedule.py) (Services and themes), [`apps/worship/management/commands/run_worker.py`](https://github.com/jeoff1/chord-newver/blob/master/apps/worship/management/commands/run_worker.py) (Search worker), [`apps/worship/suggesting.py`](https://github.com/jeoff1/chord-newver/blob/master/apps/worship/suggesting.py) (Song suggestions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Worship planning"]
  node_service[("Services and themes<br/>[schedule.py]")]
  node_suggestion["Song suggestions<br/>[suggesting.py]"]
  node_worker["Search worker<br/>[run_worker.py]"]
  node_lineups["Lineup editing<br/>[lineups.py]"]
  node_lineupdata[("Lineups<br/>[lineups.py]")]
  node_reports["Usage and attendance<br/>[reports.py]"]
end

subgraph group_songs["Song discovery"]
  node_songpool[("Song pool<br/>[models.py]")]
  node_songsearch["Song search and pool<br/>[pool.py]"]
  node_lyrics["Lyrics retrieval<br/>[lyrics.py]"]
  node_analysis["Song analysis<br/>[analysis.py]"]
end

subgraph group_church["Church administration"]
  node_churchprofile[("Church profile<br/>[models.py]")]
  node_modules["Module switching<br/>[modules.py]"]
  node_accounts["Accounts and roles<br/>[roles.py]"]
  node_members["Member directory<br/>[services.py]"]
  node_teams["Teams and rosters"]
  node_announcements["Announcements<br/>[services.py]"]
end

subgraph group_support["Shared services"]
  node_audit["Audit trail<br/>[services.py]"]
  node_auditdata[("Audit events<br/>[models.py]")]
  node_core["Shared web services<br/>[views.py]"]
end

node_pastor(("Pastor"))
node_leader(("Worship leader"))
node_team(("Worship team"))
node_spotify{{"Spotify API"}}
node_lrclib{{"LRCLIB"}}

node_pastor -->|"sets theme"| node_service
node_service -->|"requests picks"| node_suggestion
node_worker -->|"claims and executes"| node_suggestion
node_worker -->|"processes backlog"| node_songsearch
node_songsearch -.->|"searches songs"| node_spotify
node_songsearch -.->|"uses song pool"| node_songpool
node_worker -->|"fetches lyrics"| node_lyrics
node_worker -->|"loads analysis engine"| node_analysis
node_lyrics -.->|"retrieves lyrics"| node_lrclib
node_suggestion -.->|"stores search runs"| node_service
node_leader -->|"shapes lineup"| node_lineups
node_lineups -->|"uses suggestions"| node_suggestion
node_lineups -.->|"updates lineup"| node_lineupdata
node_lineups -->|"reads songs"| node_songpool
node_leader -->|"confirms lineup"| node_lineupdata
node_pastor -->|"confirms lineup"| node_lineupdata
node_team -->|"views confirmed songs"| node_lineupdata
node_reports -.->|"reports attendance"| node_service
node_reports -.->|"reports usage"| node_songpool
node_churchprofile -->|"sets enabled modules"| node_modules
node_accounts -->|"lists module permissions"| node_modules
node_members -->|"records changes"| node_audit
node_announcements -->|"records changes"| node_audit
node_audit -->|"writes events"| node_auditdata
node_teams -->|"notifies on changes"| node_lineups
node_announcements -->|"targets service teams"| node_service
node_announcements -->|"reads church labels"| node_churchprofile

click node_service "https://github.com/jeoff1/chord-newver/blob/master/apps/worship/models/schedule.py"
click node_suggestion "https://github.com/jeoff1/chord-newver/blob/master/apps/worship/suggesting.py"
click node_worker "https://github.com/jeoff1/chord-newver/blob/master/apps/worship/management/commands/run_worker.py"
click node_lineups "https://github.com/jeoff1/chord-newver/blob/master/apps/worship/lineups.py"
click node_lineupdata "https://github.com/jeoff1/chord-newver/blob/master/apps/worship/models/lineups.py"
click node_reports "https://github.com/jeoff1/chord-newver/blob/master/apps/worship/reports.py"
click node_songpool "https://github.com/jeoff1/chord-newver/blob/master/apps/songs/models.py"
click node_songsearch "https://github.com/jeoff1/chord-newver/blob/master/apps/songs/pool.py"
click node_lyrics "https://github.com/jeoff1/chord-newver/blob/master/apps/songs/lyrics.py"
click node_analysis "https://github.com/jeoff1/chord-newver/blob/master/apps/songs/analysis.py"
click node_churchprofile "https://github.com/jeoff1/chord-newver/blob/master/apps/church/models.py"
click node_modules "https://github.com/jeoff1/chord-newver/blob/master/apps/church/modules.py"
click node_accounts "https://github.com/jeoff1/chord-newver/blob/master/apps/accounts/roles.py"
click node_members "https://github.com/jeoff1/chord-newver/blob/master/apps/members/services.py"
click node_teams "https://github.com/jeoff1/chord-newver/tree/master/apps/teams"
click node_announcements "https://github.com/jeoff1/chord-newver/blob/master/apps/announcements/services.py"
click node_audit "https://github.com/jeoff1/chord-newver/blob/master/apps/audit/services.py"
click node_auditdata "https://github.com/jeoff1/chord-newver/blob/master/apps/audit/models.py"
click node_core "https://github.com/jeoff1/chord-newver/blob/master/apps/core/views.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_service,node_suggestion,node_worker,node_lineups,node_lineupdata,node_reports toneBlue
class node_songpool,node_songsearch,node_lyrics,node_analysis toneAmber
class node_churchprofile,node_modules,node_accounts,node_members,node_teams,node_announcements,node_spotify toneMint
class node_audit,node_auditdata,node_core toneRose
class node_pastor,node_leader,node_team,node_lrclib toneIndigo
```

## Components

### Worship planning

- [Services and themes](https://github.com/jeoff1/chord-newver/blob/master/apps/worship/models/schedule.py): `apps/worship/models/schedule.py`
- [Song suggestions](https://github.com/jeoff1/chord-newver/blob/master/apps/worship/suggesting.py): `apps/worship/suggesting.py`
- [Search worker](https://github.com/jeoff1/chord-newver/blob/master/apps/worship/management/commands/run_worker.py): `apps/worship/management/commands/run_worker.py`
- [Lineup editing](https://github.com/jeoff1/chord-newver/blob/master/apps/worship/lineups.py): `apps/worship/lineups.py`
- [Lineups](https://github.com/jeoff1/chord-newver/blob/master/apps/worship/models/lineups.py): `apps/worship/models/lineups.py`
- [Usage and attendance](https://github.com/jeoff1/chord-newver/blob/master/apps/worship/reports.py): `apps/worship/reports.py`

### Song discovery

- [Song pool](https://github.com/jeoff1/chord-newver/blob/master/apps/songs/models.py): `apps/songs/models.py`
- [Song search and pool](https://github.com/jeoff1/chord-newver/blob/master/apps/songs/pool.py): `apps/songs/pool.py`
- [Lyrics retrieval](https://github.com/jeoff1/chord-newver/blob/master/apps/songs/lyrics.py): `apps/songs/lyrics.py`
- [Song analysis](https://github.com/jeoff1/chord-newver/blob/master/apps/songs/analysis.py): `apps/songs/analysis.py`

### Church administration

- [Church profile](https://github.com/jeoff1/chord-newver/blob/master/apps/church/models.py): `apps/church/models.py`
- [Module switching](https://github.com/jeoff1/chord-newver/blob/master/apps/church/modules.py): `apps/church/modules.py`
- [Accounts and roles](https://github.com/jeoff1/chord-newver/blob/master/apps/accounts/roles.py): `apps/accounts/roles.py`
- [Member directory](https://github.com/jeoff1/chord-newver/blob/master/apps/members/services.py): `apps/members/services.py`
- [Teams and rosters](https://github.com/jeoff1/chord-newver/tree/master/apps/teams): `apps/teams`
- [Announcements](https://github.com/jeoff1/chord-newver/blob/master/apps/announcements/services.py): `apps/announcements/services.py`

### Shared services

- [Audit trail](https://github.com/jeoff1/chord-newver/blob/master/apps/audit/services.py): `apps/audit/services.py`
- [Audit events](https://github.com/jeoff1/chord-newver/blob/master/apps/audit/models.py): `apps/audit/models.py`
- [Shared web services](https://github.com/jeoff1/chord-newver/blob/master/apps/core/views.py): `apps/core/views.py`

### Other components

- **Pastor**
- **Worship leader**
- **Worship team**
- **Spotify API**
- **LRCLIB**

## Connections

- Pastor → Services and themes: sets theme
- Services and themes → Song suggestions: requests picks
- Search worker → Song suggestions: claims and executes (evidence: `apps/worship/management/commands/run_worker.py`)
- Search worker → Song search and pool: processes backlog (evidence: `apps/worship/management/commands/run_worker.py`)
- Song search and pool → Spotify API: searches songs
- Song search and pool → Song pool: uses song pool
- Search worker → Lyrics retrieval: fetches lyrics (evidence: `apps/worship/management/commands/run_worker.py`)
- Search worker → Song analysis: loads analysis engine (evidence: `apps/worship/management/commands/run_worker.py`)
- Lyrics retrieval → LRCLIB: retrieves lyrics
- Song suggestions → Services and themes: stores search runs
- Worship leader → Lineup editing: shapes lineup
- Lineup editing → Song suggestions: uses suggestions (evidence: `apps/worship/lineups.py`)
- Lineup editing → Lineups: updates lineup
- Lineup editing → Song pool: reads songs (evidence: `apps/worship/lineups.py`)
- Worship leader → Lineups: confirms lineup
- Pastor → Lineups: confirms lineup
- Worship team → Lineups: views confirmed songs
- Usage and attendance → Services and themes: reports attendance
- Usage and attendance → Song pool: reports usage
- Church profile → Module switching: sets enabled modules (evidence: `apps/church/modules.py`)
- Accounts and roles → Module switching: lists module permissions (evidence: `apps/accounts/roles.py`)
- Member directory → Audit trail: records changes (evidence: `apps/members/services.py`)
- Announcements → Audit trail: records changes (evidence: `apps/announcements/services.py`)
- Audit trail → Audit events: writes events (evidence: `apps/audit/services.py`)
- Teams and rosters → Lineup editing: notifies on changes (evidence: `apps/teams/apps.py`)
- Announcements → Services and themes: targets service teams (evidence: `apps/announcements/services.py`)
- Announcements → Church profile: reads church labels (evidence: `apps/announcements/services.py`)
