# vansh16-code/inkpersona architecture

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

- Interactive diagram: https://gitdiagram.com/vansh16-code/inkpersona
- Repository: https://github.com/vansh16-code/inkpersona

## Overview

InkPersona is a Django app for writers to create fictional-character profiles and interview them for story inspiration. The main workflow routes a browser request to a view, which validates profile or question input, loads or saves character data, and renders the relevant page; interview answers are generated by an external LLaMA-compatible API. The README also describes responsive UI and writer assistance. The view, form, model, URL, settings, and AI relationships are shown in sampled source; template behavior is inferred from view render calls, and unsampled page details are not expanded.

Main entry points: [`interview/views.py`](https://github.com/vansh16-code/inkpersona/blob/master/interview/views.py) (Request handlers), [`interview/models.py`](https://github.com/vansh16-code/inkpersona/blob/master/interview/models.py) (Character profile), [`InkPersona/urls.py`](https://github.com/vansh16-code/inkpersona/blob/master/InkPersona/urls.py) (Project routes), [`interview/urls.py`](https://github.com/vansh16-code/inkpersona/blob/master/interview/urls.py) (Interview routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web entry"]
  node_project_urls["Project routes<br/>[urls.py]"]
  node_app_urls["Interview routes<br/>[urls.py]"]
end

subgraph group_character["Character workflow"]
  node_views["Request handlers<br/>[views.py]"]
  node_profile_form["Profile form<br/>[forms.py]"]
  node_question_form["Question form<br/>[forms.py]"]
  node_profile["Character profile<br/>[models.py]"]
end

subgraph group_ai["AI responses"]
  node_llama["Response generator<br/>[llama.py]"]
  node_together{{"Together API"}}
end

subgraph group_state["Presentation and state"]
  node_templates["Web pages"]
  node_sqlite[("SQLite database")]
end

node_writer(("Writer"))

node_writer -->|"uses app"| node_project_urls
node_project_urls -->|"includes routes"| node_app_urls
node_app_urls -->|"routes requests"| node_views
node_views -->|"validates profiles"| node_profile_form
node_views -->|"validates questions"| node_question_form
node_profile_form -->|"saves profile"| node_profile
node_views -->|"loads profiles"| node_profile
node_views -->|"requests answer"| node_llama
node_llama -->|"calls completions"| node_together
node_views -->|"renders pages"| node_templates
node_profile -->|"persists through ORM"| node_sqlite

click node_project_urls "https://github.com/vansh16-code/inkpersona/blob/master/InkPersona/urls.py"
click node_app_urls "https://github.com/vansh16-code/inkpersona/blob/master/interview/urls.py"
click node_views "https://github.com/vansh16-code/inkpersona/blob/master/interview/views.py"
click node_profile_form "https://github.com/vansh16-code/inkpersona/blob/master/interview/forms.py"
click node_question_form "https://github.com/vansh16-code/inkpersona/blob/master/interview/forms.py"
click node_profile "https://github.com/vansh16-code/inkpersona/blob/master/interview/models.py"
click node_llama "https://github.com/vansh16-code/inkpersona/blob/master/interview/llama.py"
click node_templates "https://github.com/vansh16-code/inkpersona/tree/master/interview/templates"

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_project_urls,node_app_urls toneBlue
class node_views,node_profile_form,node_question_form,node_profile toneAmber
class node_llama,node_together toneMint
class node_templates,node_sqlite toneRose
class node_writer toneIndigo
```

## Components

### Web entry

- [Project routes](https://github.com/vansh16-code/inkpersona/blob/master/InkPersona/urls.py): `InkPersona/urls.py`
- [Interview routes](https://github.com/vansh16-code/inkpersona/blob/master/interview/urls.py): `interview/urls.py`

### Character workflow

- [Request handlers](https://github.com/vansh16-code/inkpersona/blob/master/interview/views.py): `interview/views.py`
- [Profile form](https://github.com/vansh16-code/inkpersona/blob/master/interview/forms.py): `interview/forms.py`
- [Question form](https://github.com/vansh16-code/inkpersona/blob/master/interview/forms.py): `interview/forms.py`
- [Character profile](https://github.com/vansh16-code/inkpersona/blob/master/interview/models.py): `interview/models.py`

### AI responses

- [Response generator](https://github.com/vansh16-code/inkpersona/blob/master/interview/llama.py): `interview/llama.py`
- **Together API**

### Presentation and state

- [Web pages](https://github.com/vansh16-code/inkpersona/tree/master/interview/templates): `interview/templates`
- **SQLite database**

### Other components

- **Writer**

## Connections

- Writer → Project routes: uses app (evidence: `README.md`)
- Project routes → Interview routes: includes routes (evidence: `InkPersona/urls.py`)
- Interview routes → Request handlers: routes requests (evidence: `interview/urls.py`)
- Request handlers → Profile form: validates profiles (evidence: `interview/views.py`)
- Request handlers → Question form: validates questions (evidence: `interview/views.py`)
- Profile form → Character profile: saves profile (evidence: `interview/forms.py`)
- Request handlers → Character profile: loads profiles (evidence: `interview/views.py`)
- Request handlers → Response generator: requests answer (evidence: `interview/views.py`)
- Response generator → Together API: calls completions (evidence: `interview/llama.py`)
- Request handlers → Web pages: renders pages (evidence: `interview/views.py`)
- Character profile → SQLite database: persists through ORM
