# dojouk/dojo architecture

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

- Interactive diagram: https://gitdiagram.com/dojouk/dojo
- Repository: https://github.com/dojouk/dojo

## Overview

Dojo is a multi-organisation club and class management platform. Staff manage members, classes, attendance, documents, progression, and billing through organisation-scoped Django views; members and guardians can use a tokenised portal for self-service. The graph highlights those product stages and the shared organisation/access layer. README statements support the documented capability links; source-index references and excerpts support the narrower implementation links shown. Several important areas, including portal, signup, inventory, and progression views, were not sampled, so their internal call paths are not expanded.

Main entry points: [`members/models.py`](https://github.com/dojouk/dojo/blob/main/members/models.py) (Member records), [`billing/views.py`](https://github.com/dojouk/dojo/blob/main/billing/views.py) (Invoices and reports), [`billing/models.py`](https://github.com/dojouk/dojo/blob/main/billing/models.py) (Billing records), [`organisations/models.py`](https://github.com/dojouk/dojo/blob/main/organisations/models.py) (Organisation configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_org["Organisation and access"]
  node_org_admin["Organisation settings<br/>[views.py]"]
  node_org_data[("Organisation configuration<br/>[models.py]")]
  node_access["Scoped access checks<br/>[mixins.py]"]
  node_accounts[("Sign-in and 2FA<br/>[models.py]")]
end

subgraph group_members["Member lifecycle"]
  node_member_ops["Member administration<br/>[views.py]"]
  node_member_data[("Member records<br/>[models.py]")]
  node_signup["Public signup<br/>[signup_views.py]"]
  node_portal["Member portal<br/>[portal_views.py]"]
end

subgraph group_classes["Classes and attendance"]
  node_class_ops["Classes and registers<br/>[views.py]"]
  node_class_data[("Class and attendance records<br/>[models.py]")]
end

subgraph group_finance["Billing and payments"]
  node_billing_ops["Invoices and reports<br/>[views.py]"]
  node_billing_data[("Billing records<br/>[models.py]")]
  node_stripe["Stripe payments<br/>[stripe_views.py]"]
  node_scheduler["Scheduled billing tasks<br/>[registry.py]"]
end

subgraph group_services["Member services"]
  node_progression[("Grading and progression<br/>[models.py]")]
  node_documents[("Documents and waivers<br/>[models.py]")]
  node_inventory[("Products and stock<br/>[models.py]")]
  node_email_templates["Email composition<br/>[blocks.py]"]
  node_email_send["Email delivery<br/>[compose.py]"]
end

node_staff(("Club staff"))
node_member_user(("Member or guardian"))

node_staff -->|"uses"| node_access
node_access -->|"resolves organisation"| node_org_data
node_staff -->|"configures"| node_org_admin
node_org_admin -->|"updates settings"| node_org_data
node_staff -->|"manages members"| node_member_ops
node_member_ops -->|"reads and updates"| node_member_data
node_member_data -->|"belongs to organisation"| node_org_data
node_member_user -->|"applies"| node_signup
node_staff -->|"reviews applications"| node_signup
node_member_user -->|"self-serves"| node_portal
node_staff -->|"schedules and records"| node_class_ops
node_class_ops -->|"manages sessions"| node_class_data
node_class_data -->|"enrols members"| node_member_data
node_staff -->|"manages invoices"| node_billing_ops
node_billing_ops -->|"creates and updates"| node_billing_data
node_billing_data -->|"bills members"| node_member_data
node_member_user -->|"pays online"| node_stripe
node_stripe -->|"records payments"| node_billing_data
node_staff -->|"records promotions"| node_progression
node_progression -->|"tracks member grades"| node_member_data
node_staff -->|"stores waivers"| node_documents
node_documents -->|"attaches documents"| node_member_data
node_staff -->|"manages products"| node_inventory
node_billing_ops -->|"adds invoice items"| node_inventory
node_billing_ops -->|"builds invoice email"| node_email_templates
node_email_templates -->|"composes content"| node_email_send
node_scheduler -->|"runs billing jobs"| node_billing_data
node_accounts -.->|"supports organisation security"| node_org_data

click node_org_admin "https://github.com/dojouk/dojo/blob/main/organisations/views.py"
click node_org_data "https://github.com/dojouk/dojo/blob/main/organisations/models.py"
click node_access "https://github.com/dojouk/dojo/blob/main/dojo/mixins.py"
click node_accounts "https://github.com/dojouk/dojo/blob/main/accounts/models.py"
click node_member_ops "https://github.com/dojouk/dojo/blob/main/members/views.py"
click node_member_data "https://github.com/dojouk/dojo/blob/main/members/models.py"
click node_signup "https://github.com/dojouk/dojo/blob/main/members/signup_views.py"
click node_portal "https://github.com/dojouk/dojo/blob/main/members/portal_views.py"
click node_class_ops "https://github.com/dojouk/dojo/blob/main/classes/views.py"
click node_class_data "https://github.com/dojouk/dojo/blob/main/classes/models.py"
click node_billing_ops "https://github.com/dojouk/dojo/blob/main/billing/views.py"
click node_billing_data "https://github.com/dojouk/dojo/blob/main/billing/models.py"
click node_stripe "https://github.com/dojouk/dojo/blob/main/billing/stripe_views.py"
click node_progression "https://github.com/dojouk/dojo/blob/main/progression/models.py"
click node_documents "https://github.com/dojouk/dojo/blob/main/documents/models.py"
click node_inventory "https://github.com/dojouk/dojo/blob/main/inventory/models.py"
click node_email_templates "https://github.com/dojouk/dojo/blob/main/mailer/blocks.py"
click node_email_send "https://github.com/dojouk/dojo/blob/main/mailer/compose.py"
click node_scheduler "https://github.com/dojouk/dojo/blob/main/jobs/registry.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_org_admin,node_org_data,node_access,node_accounts toneBlue
class node_member_ops,node_member_data,node_signup,node_portal toneAmber
class node_class_ops,node_class_data toneMint
class node_billing_ops,node_billing_data,node_stripe,node_scheduler toneRose
class node_progression,node_documents,node_inventory,node_email_templates,node_email_send,node_staff,node_member_user toneIndigo
```

## Components

### Organisation and access

- [Organisation settings](https://github.com/dojouk/dojo/blob/main/organisations/views.py): `organisations/views.py`
- [Organisation configuration](https://github.com/dojouk/dojo/blob/main/organisations/models.py): `organisations/models.py`
- [Scoped access checks](https://github.com/dojouk/dojo/blob/main/dojo/mixins.py): `dojo/mixins.py`
- [Sign-in and 2FA](https://github.com/dojouk/dojo/blob/main/accounts/models.py): `accounts/models.py`

### Member lifecycle

- [Member administration](https://github.com/dojouk/dojo/blob/main/members/views.py): `members/views.py`
- [Member records](https://github.com/dojouk/dojo/blob/main/members/models.py): `members/models.py`
- [Public signup](https://github.com/dojouk/dojo/blob/main/members/signup_views.py): `members/signup_views.py`
- [Member portal](https://github.com/dojouk/dojo/blob/main/members/portal_views.py): `members/portal_views.py`

### Classes and attendance

- [Classes and registers](https://github.com/dojouk/dojo/blob/main/classes/views.py): `classes/views.py`
- [Class and attendance records](https://github.com/dojouk/dojo/blob/main/classes/models.py): `classes/models.py`

### Billing and payments

- [Invoices and reports](https://github.com/dojouk/dojo/blob/main/billing/views.py): `billing/views.py`
- [Billing records](https://github.com/dojouk/dojo/blob/main/billing/models.py): `billing/models.py`
- [Stripe payments](https://github.com/dojouk/dojo/blob/main/billing/stripe_views.py): `billing/stripe_views.py`
- [Scheduled billing tasks](https://github.com/dojouk/dojo/blob/main/jobs/registry.py): `jobs/registry.py`

### Member services

- [Grading and progression](https://github.com/dojouk/dojo/blob/main/progression/models.py): `progression/models.py`
- [Documents and waivers](https://github.com/dojouk/dojo/blob/main/documents/models.py): `documents/models.py`
- [Products and stock](https://github.com/dojouk/dojo/blob/main/inventory/models.py): `inventory/models.py`
- [Email composition](https://github.com/dojouk/dojo/blob/main/mailer/blocks.py): `mailer/blocks.py`
- [Email delivery](https://github.com/dojouk/dojo/blob/main/mailer/compose.py): `mailer/compose.py`

### Other components

- **Club staff**
- **Member or guardian**

## Connections

- Club staff → Scoped access checks: uses (evidence: `README.md`)
- Scoped access checks → Organisation configuration: resolves organisation (evidence: `dojo/mixins.py`)
- Club staff → Organisation settings: configures (evidence: `README.md`)
- Organisation settings → Organisation configuration: updates settings (evidence: `organisations/views.py`)
- Club staff → Member administration: manages members (evidence: `README.md`)
- Member administration → Member records: reads and updates (evidence: `members/views.py`)
- Member records → Organisation configuration: belongs to organisation (evidence: `members/models.py`)
- Member or guardian → Public signup: applies (evidence: `README.md`)
- Club staff → Public signup: reviews applications (evidence: `README.md`)
- Member or guardian → Member portal: self-serves (evidence: `README.md`)
- Club staff → Classes and registers: schedules and records (evidence: `README.md`)
- Classes and registers → Class and attendance records: manages sessions (evidence: `classes/views.py`)
- Class and attendance records → Member records: enrols members (evidence: `classes/models.py`)
- Club staff → Invoices and reports: manages invoices (evidence: `README.md`)
- Invoices and reports → Billing records: creates and updates (evidence: `billing/views.py`)
- Billing records → Member records: bills members (evidence: `billing/models.py`)
- Member or guardian → Stripe payments: pays online (evidence: `README.md`)
- Stripe payments → Billing records: records payments (evidence: `README.md`)
- Club staff → Grading and progression: records promotions (evidence: `README.md`)
- Grading and progression → Member records: tracks member grades (evidence: `progression/models.py`)
- Club staff → Documents and waivers: stores waivers (evidence: `README.md`)
- Documents and waivers → Member records: attaches documents (evidence: `documents/models.py`)
- Club staff → Products and stock: manages products (evidence: `README.md`)
- Invoices and reports → Products and stock: adds invoice items (evidence: `billing/views.py`)
- Invoices and reports → Email composition: builds invoice email
- Email composition → Email delivery: composes content (evidence: `billing/emails.py`)
- Scheduled billing tasks → Billing records: runs billing jobs (evidence: `jobs/registry.py`)
- Sign-in and 2FA → Organisation configuration: supports organisation security
