# khalil-r-abbas/form-project architecture

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

- Interactive diagram: https://gitdiagram.com/khalil-r-abbas/form-project
- Repository: https://github.com/khalil-r-abbas/form-project

## Overview

This Django application lets people create and publish questionnaires, discover and fill them, and review results; it also supports accounts, points/rankings, reporting, and administrator moderation. The main request path runs through Django views into account or questionnaire services and persistent models, while reporting and moderation provide separate capabilities. The README is empty, and the sampled excerpts do not show template wiring or every route, so those relationships are omitted rather than inferred.

Main entry points: [`forms_app/views.py`](https://github.com/khalil-r-abbas/form-project/blob/main/forms_app/views.py) (Questionnaire views), [`accounts/views.py`](https://github.com/khalil-r-abbas/form-project/blob/main/accounts/views.py) (Account views), [`accounts/services.py`](https://github.com/khalil-r-abbas/form-project/blob/main/accounts/services.py) (Account services), [`accounts/models.py`](https://github.com/khalil-r-abbas/form-project/blob/main/accounts/models.py) (User records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflows"]
  node_form_views["Questionnaire views<br/>[views.py]"]
  node_core_views["Discovery views<br/>[views.py]"]
end

subgraph group_accounts["Accounts"]
  node_account_views["Account views<br/>[views.py]"]
  node_account_forms["Account forms<br/>[forms.py]"]
  node_account_services["Account services<br/>[services.py]"]
  node_account_tokens["Verification tokens<br/>[tokens.py]"]
  node_user_store[("User records<br/>[models.py]")]
end

subgraph group_questionnaires["Questionnaires"]
  node_form_services["Form and fill services<br/>[services.py]"]
  node_form_forms["Questionnaire forms<br/>[forms.py]"]
  node_form_store[("Questionnaire records<br/>[models.py]")]
end

subgraph group_insights["Insights and moderation"]
  node_home_reporting["Discovery and ranking<br/>[reporting.py]"]
  node_moderation["Moderation services<br/>[moderation.py]"]
  node_housekeeping["Housekeeping"]
end

node_visitor(("Visitor"))
node_turnstile{{"Cloudflare Turnstile"}}
node_email{{"Email service"}}

node_visitor -->|"submits requests"| node_form_views
node_visitor -->|"browses"| node_core_views
node_visitor -->|"manages account"| node_account_views
node_form_views -->|"calls"| node_form_services
node_form_views -->|"uses"| node_form_forms
node_form_views -->|"calls"| node_home_reporting
node_form_views -->|"calls"| node_moderation
node_form_services -->|"reads and writes"| node_form_store
node_form_forms -->|"validates against"| node_form_store
node_core_views -->|"calls"| node_home_reporting
node_home_reporting -->|"reads"| node_form_store
node_home_reporting -->|"reads"| node_user_store
node_moderation -->|"updates"| node_form_store
node_moderation -->|"updates"| node_user_store
node_account_views -->|"uses"| node_account_forms
node_account_views -->|"calls"| node_account_services
node_account_views -->|"uses"| node_account_tokens
node_account_views -->|"reads and writes"| node_user_store
node_account_services -->|"reads and writes"| node_user_store
node_account_services -->|"creates tokens"| node_account_tokens
node_account_services -->|"verifies token"| node_turnstile
node_account_services -->|"sends verification"| node_email
node_housekeeping -->|"cleans sessions"| node_form_store
node_housekeeping -->|"cleans accounts"| node_user_store

click node_form_views "https://github.com/khalil-r-abbas/form-project/blob/main/forms_app/views.py"
click node_core_views "https://github.com/khalil-r-abbas/form-project/blob/main/core/views.py"
click node_account_views "https://github.com/khalil-r-abbas/form-project/blob/main/accounts/views.py"
click node_account_forms "https://github.com/khalil-r-abbas/form-project/blob/main/accounts/forms.py"
click node_account_services "https://github.com/khalil-r-abbas/form-project/blob/main/accounts/services.py"
click node_account_tokens "https://github.com/khalil-r-abbas/form-project/blob/main/accounts/tokens.py"
click node_user_store "https://github.com/khalil-r-abbas/form-project/blob/main/accounts/models.py"
click node_form_services "https://github.com/khalil-r-abbas/form-project/blob/main/forms_app/services.py"
click node_form_forms "https://github.com/khalil-r-abbas/form-project/blob/main/forms_app/forms.py"
click node_form_store "https://github.com/khalil-r-abbas/form-project/blob/main/forms_app/models.py"
click node_home_reporting "https://github.com/khalil-r-abbas/form-project/blob/main/forms_app/reporting.py"
click node_moderation "https://github.com/khalil-r-abbas/form-project/blob/main/forms_app/moderation.py"
click node_housekeeping "https://github.com/khalil-r-abbas/form-project/blob/main/core/management/commands/cleanup_housekeeping.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_form_views,node_core_views toneBlue
class node_account_views,node_account_forms,node_account_services,node_account_tokens,node_user_store toneAmber
class node_form_services,node_form_forms,node_form_store toneMint
class node_home_reporting,node_moderation,node_housekeeping toneRose
class node_visitor,node_turnstile,node_email toneIndigo
```

## Components

### Web workflows

- [Questionnaire views](https://github.com/khalil-r-abbas/form-project/blob/main/forms_app/views.py): `forms_app/views.py`
- [Discovery views](https://github.com/khalil-r-abbas/form-project/blob/main/core/views.py): `core/views.py`

### Accounts

- [Account views](https://github.com/khalil-r-abbas/form-project/blob/main/accounts/views.py): `accounts/views.py`
- [Account forms](https://github.com/khalil-r-abbas/form-project/blob/main/accounts/forms.py): `accounts/forms.py`
- [Account services](https://github.com/khalil-r-abbas/form-project/blob/main/accounts/services.py): `accounts/services.py`
- [Verification tokens](https://github.com/khalil-r-abbas/form-project/blob/main/accounts/tokens.py): `accounts/tokens.py`
- [User records](https://github.com/khalil-r-abbas/form-project/blob/main/accounts/models.py): `accounts/models.py`

### Questionnaires

- [Form and fill services](https://github.com/khalil-r-abbas/form-project/blob/main/forms_app/services.py): `forms_app/services.py`
- [Questionnaire forms](https://github.com/khalil-r-abbas/form-project/blob/main/forms_app/forms.py): `forms_app/forms.py`
- [Questionnaire records](https://github.com/khalil-r-abbas/form-project/blob/main/forms_app/models.py): `forms_app/models.py`

### Insights and moderation

- [Discovery and ranking](https://github.com/khalil-r-abbas/form-project/blob/main/forms_app/reporting.py): `forms_app/reporting.py`
- [Moderation services](https://github.com/khalil-r-abbas/form-project/blob/main/forms_app/moderation.py): `forms_app/moderation.py`
- [Housekeeping](https://github.com/khalil-r-abbas/form-project/blob/main/core/management/commands/cleanup_housekeeping.py): `core/management/commands/cleanup_housekeeping.py`

### Other components

- **Visitor**
- **Cloudflare Turnstile**
- **Email service**

## Connections

- Visitor → Questionnaire views: submits requests
- Visitor → Discovery views: browses
- Visitor → Account views: manages account
- Questionnaire views → Form and fill services: calls (evidence: `forms_app/views.py`)
- Questionnaire views → Questionnaire forms: uses (evidence: `forms_app/views.py`)
- Questionnaire views → Discovery and ranking: calls (evidence: `forms_app/views.py`)
- Questionnaire views → Moderation services: calls (evidence: `forms_app/views.py`)
- Form and fill services → Questionnaire records: reads and writes (evidence: `forms_app/services.py`)
- Questionnaire forms → Questionnaire records: validates against (evidence: `forms_app/forms.py`)
- Discovery views → Discovery and ranking: calls (evidence: `core/views.py`)
- Discovery and ranking → Questionnaire records: reads (evidence: `forms_app/reporting.py`)
- Discovery and ranking → User records: reads (evidence: `forms_app/reporting.py`)
- Moderation services → Questionnaire records: updates (evidence: `forms_app/moderation.py`)
- Moderation services → User records: updates (evidence: `forms_app/moderation.py`)
- Account views → Account forms: uses (evidence: `accounts/views.py`)
- Account views → Account services: calls (evidence: `accounts/views.py`)
- Account views → Verification tokens: uses (evidence: `accounts/views.py`)
- Account views → User records: reads and writes (evidence: `accounts/views.py`)
- Account services → User records: reads and writes (evidence: `accounts/services.py`)
- Account services → Verification tokens: creates tokens (evidence: `accounts/services.py`)
- Account services → Cloudflare Turnstile: verifies token (evidence: `accounts/services.py`)
- Account services → Email service: sends verification (evidence: `accounts/services.py`)
- Housekeeping → Questionnaire records: cleans sessions (evidence: `core/management/commands/cleanup_housekeeping.py`)
- Housekeeping → User records: cleans accounts (evidence: `core/management/commands/cleanup_housekeeping.py`)
