# thelayanarchives/tammem architecture

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

## Overview

This Django project models business profiles and a configurable questionnaire whose questions can depend on a business’s activity and previous answers. The implemented runtime capability is evaluating which questions apply and are visible; the repository does not show a customer-facing submission flow or views. Django admin registers the domain models, and settings configure PostgreSQL. The graph follows the model associations and the questionnaire service’s visible reads; it does not infer an unsampled workflow from the schema.

Main entry points: [`core/admin.py`](https://github.com/thelayanarchives/tammem/blob/main/core/admin.py) (Admin registrations), [`core/models.py`](https://github.com/thelayanarchives/tammem/blob/main/core/models.py) (Business profile), [`core/Services/questionnaire.py`](https://github.com/thelayanarchives/tammem/blob/main/core/Services/questionnaire.py) (Visibility evaluator), [`config/urls.py`](https://github.com/thelayanarchives/tammem/blob/main/config/urls.py) (Admin URL routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_profile["Business profile"]
  node_business["Business<br/>[models.py]"]
  node_profile_data["Business profile<br/>[models.py]"]
  node_location["Location<br/>[models.py]"]
end

subgraph group_catalog["Business taxonomy"]
  node_industry["Industry<br/>[models.py]"]
  node_activity["Activity<br/>[models.py]"]
end

subgraph group_questionnaire["Conditional questionnaire"]
  node_question["Question catalog<br/>[models.py]"]
  node_option["Question options<br/>[models.py]"]
  node_answer["Business answers<br/>[models.py]"]
  node_rule["Question rules<br/>[models.py]"]
  node_condition["Rule conditions<br/>[models.py]"]
end

subgraph group_runtime["Runtime and administration"]
  node_visibility["Visibility evaluator<br/>[questionnaire.py]"]
  node_admin["Admin registrations<br/>[admin.py]"]
  node_routing["Admin URL routing<br/>[urls.py]"]
end

node_applicant(("Business owner"))
node_database[("PostgreSQL")]

node_business -->|"has profile"| node_profile_data
node_profile_data -->|"references"| node_location
node_profile_data -->|"selects activity"| node_activity
node_activity -->|"belongs to"| node_industry
node_question -->|"defines options"| node_option
node_answer -->|"records for"| node_profile_data
node_answer -->|"answers"| node_question
node_answer -->|"may select"| node_option
node_rule -->|"targets"| node_question
node_condition -->|"belongs to"| node_rule
node_condition -->|"may depend on"| node_question
node_visibility -->|"loads answers"| node_answer
node_visibility -->|"filters questions"| node_question
node_visibility -->|"checks profile"| node_profile_data
node_visibility -->|"checks activity"| node_activity
node_admin -->|"registers"| node_business
node_admin -->|"registers"| node_profile_data
node_admin -->|"registers"| node_location
node_admin -->|"registers"| node_industry
node_admin -->|"registers"| node_activity
node_admin -->|"registers"| node_question
node_admin -->|"registers"| node_option
node_admin -->|"registers"| node_answer
node_admin -->|"registers"| node_rule
node_admin -->|"registers"| node_condition
node_routing -->|"routes admin"| node_admin
node_applicant -.->|"opens admin"| node_routing
node_database -.-> node_business
node_database -.-> node_profile_data
node_database -.-> node_question
node_database -.-> node_answer

click node_business "https://github.com/thelayanarchives/tammem/blob/main/core/models.py"
click node_profile_data "https://github.com/thelayanarchives/tammem/blob/main/core/models.py"
click node_location "https://github.com/thelayanarchives/tammem/blob/main/core/models.py"
click node_industry "https://github.com/thelayanarchives/tammem/blob/main/core/models.py"
click node_activity "https://github.com/thelayanarchives/tammem/blob/main/core/models.py"
click node_question "https://github.com/thelayanarchives/tammem/blob/main/core/models.py"
click node_option "https://github.com/thelayanarchives/tammem/blob/main/core/models.py"
click node_answer "https://github.com/thelayanarchives/tammem/blob/main/core/models.py"
click node_rule "https://github.com/thelayanarchives/tammem/blob/main/core/models.py"
click node_condition "https://github.com/thelayanarchives/tammem/blob/main/core/models.py"
click node_visibility "https://github.com/thelayanarchives/tammem/blob/main/core/Services/questionnaire.py"
click node_admin "https://github.com/thelayanarchives/tammem/blob/main/core/admin.py"
click node_routing "https://github.com/thelayanarchives/tammem/blob/main/config/urls.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_business,node_profile_data,node_location toneBlue
class node_industry,node_activity,node_database toneAmber
class node_question,node_option,node_answer,node_rule,node_condition toneMint
class node_visibility,node_admin,node_routing toneRose
class node_applicant toneIndigo
```

## Components

### Business profile

- [Business](https://github.com/thelayanarchives/tammem/blob/main/core/models.py): `core/models.py`
- [Business profile](https://github.com/thelayanarchives/tammem/blob/main/core/models.py): `core/models.py`
- [Location](https://github.com/thelayanarchives/tammem/blob/main/core/models.py): `core/models.py`

### Business taxonomy

- [Industry](https://github.com/thelayanarchives/tammem/blob/main/core/models.py): `core/models.py`
- [Activity](https://github.com/thelayanarchives/tammem/blob/main/core/models.py): `core/models.py`

### Conditional questionnaire

- [Question catalog](https://github.com/thelayanarchives/tammem/blob/main/core/models.py): `core/models.py`
- [Question options](https://github.com/thelayanarchives/tammem/blob/main/core/models.py): `core/models.py`
- [Business answers](https://github.com/thelayanarchives/tammem/blob/main/core/models.py): `core/models.py`
- [Question rules](https://github.com/thelayanarchives/tammem/blob/main/core/models.py): `core/models.py`
- [Rule conditions](https://github.com/thelayanarchives/tammem/blob/main/core/models.py): `core/models.py`

### Runtime and administration

- [Visibility evaluator](https://github.com/thelayanarchives/tammem/blob/main/core/Services/questionnaire.py): `core/Services/questionnaire.py`
- [Admin registrations](https://github.com/thelayanarchives/tammem/blob/main/core/admin.py): `core/admin.py`
- [Admin URL routing](https://github.com/thelayanarchives/tammem/blob/main/config/urls.py): `config/urls.py`

### Other components

- **Business owner**
- **PostgreSQL**

## Connections

- Business → Business profile: has profile (evidence: `core/models.py`)
- Business profile → Location: references (evidence: `core/models.py`)
- Business profile → Activity: selects activity (evidence: `core/models.py`)
- Activity → Industry: belongs to (evidence: `core/models.py`)
- Question catalog → Question options: defines options (evidence: `core/models.py`)
- Business answers → Business profile: records for (evidence: `core/models.py`)
- Business answers → Question catalog: answers (evidence: `core/models.py`)
- Business answers → Question options: may select (evidence: `core/models.py`)
- Question rules → Question catalog: targets (evidence: `core/models.py`)
- Rule conditions → Question rules: belongs to (evidence: `core/models.py`)
- Rule conditions → Question catalog: may depend on (evidence: `core/models.py`)
- Visibility evaluator → Business answers: loads answers (evidence: `core/Services/questionnaire.py`)
- Visibility evaluator → Question catalog: filters questions (evidence: `core/Services/questionnaire.py`)
- Visibility evaluator → Business profile: checks profile (evidence: `core/Services/questionnaire.py`)
- Visibility evaluator → Activity: checks activity (evidence: `core/Services/questionnaire.py`)
- Admin registrations → Business: registers (evidence: `core/admin.py`)
- Admin registrations → Business profile: registers (evidence: `core/admin.py`)
- Admin registrations → Location: registers (evidence: `core/admin.py`)
- Admin registrations → Industry: registers (evidence: `core/admin.py`)
- Admin registrations → Activity: registers (evidence: `core/admin.py`)
- Admin registrations → Question catalog: registers (evidence: `core/admin.py`)
- Admin registrations → Question options: registers (evidence: `core/admin.py`)
- Admin registrations → Business answers: registers (evidence: `core/admin.py`)
- Admin registrations → Question rules: registers (evidence: `core/admin.py`)
- Admin registrations → Rule conditions: registers (evidence: `core/admin.py`)
- Admin URL routing → Admin registrations: routes admin (evidence: `config/urls.py`)
- Business owner → Admin URL routing: opens admin
- PostgreSQL → Business
- PostgreSQL → Business profile
- PostgreSQL → Question catalog
- PostgreSQL → Business answers
