# ethanmiku/csc325_capstone architecture

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

- Interactive diagram: https://gitdiagram.com/ethanmiku/csc325_capstone
- Repository: https://github.com/ethanmiku/csc325_capstone

## Overview

Blackwood Manor is a Godot mystery game with a Django dialogue MVP. The player explores linked rooms, gathers clues, and interviews suspects; the documented dialogue flow validates a request, loads session/NPC history, generates a reply, and saves the exchange. The backend also includes a sample clue endpoint, while player progress and game-session APIs are described as planned capabilities. Source excerpts show the dialogue internals; game wiring and several backend features are represented only at the directory level, so their internal links are omitted.

Main entry points: [`backend/dialogue/views.py`](https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/views.py) (Dialogue Endpoint), [`game/services/claude_dialogue/claude_dialogue.gd`](https://github.com/ethanmiku/csc325_capstone/blob/main/game/services/claude_dialogue/claude_dialogue.gd) (Dialogue Client), [`game/entities/player/player.gd`](https://github.com/ethanmiku/csc325_capstone/blob/main/game/entities/player/player.gd) (Exploration), [`backend/dialogue/history.py`](https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/history.py) (Conversation History)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Godot Game"]
  node_gameplay["Exploration<br/>[player.gd]"]
  node_rooms["Manor Rooms"]
  node_game_dialogue["Dialogue Client<br/>[claude_dialogue.gd]"]
  node_game_ui["Game UI"]
end

subgraph group_api["Django API"]
  node_api_config["API Configuration<br/>[settings.py]"]
  node_dialogue_api["Dialogue Endpoint<br/>[views.py]"]
  node_request_validation["Request Validation<br/>[serializers.py]"]
  node_api_errors["Error Handling<br/>[exceptions.py]"]
  node_clue_api["Clue Endpoint<br/>[views.py]"]
  node_progress_api["Progress APIs"]
end

subgraph group_data["Dialogue Data"]
  node_history["Conversation History<br/>[history.py]"]
  node_dialogue_models["Dialogue Records<br/>[models.py]"]
  node_npc_profiles["NPC Profiles<br/>[npc_data.py]"]
  node_prompt_builder["Prompt Builder<br/>[prompts.py]"]
end

subgraph group_integrations["External Services"]
  node_mongo[("MongoDB")]
  node_claude{{"Claude API"}}
end

node_player(("Player"))

node_player -->|"controls"| node_gameplay
node_gameplay -->|"explores"| node_rooms
node_player -->|"uses"| node_game_ui
node_game_dialogue -.->|"presents replies"| node_game_ui
node_game_dialogue -->|"HTTP requests"| node_dialogue_api
node_dialogue_api -->|"validates"| node_request_validation
node_dialogue_api -->|"loads and saves"| node_history
node_dialogue_api -->|"handles errors"| node_api_errors
node_dialogue_api -->|"requests replies"| node_claude
node_dialogue_api -.->|"persists exchanges"| node_mongo
node_history -->|"reads and writes"| node_dialogue_models
node_dialogue_api -->|"loads profile"| node_npc_profiles
node_dialogue_api -->|"builds prompt"| node_prompt_builder
node_api_config -->|"configures database"| node_mongo
node_clue_api -.->|"serves clue data"| node_game_dialogue
node_progress_api -.->|"planned persistence"| node_mongo
node_claude -->|"returns reply"| node_dialogue_api

click node_gameplay "https://github.com/ethanmiku/csc325_capstone/blob/main/game/entities/player/player.gd"
click node_rooms "https://github.com/ethanmiku/csc325_capstone/tree/main/game/maps"
click node_game_dialogue "https://github.com/ethanmiku/csc325_capstone/blob/main/game/services/claude_dialogue/claude_dialogue.gd"
click node_game_ui "https://github.com/ethanmiku/csc325_capstone/tree/main/game/ui"
click node_api_config "https://github.com/ethanmiku/csc325_capstone/blob/main/backend/config/settings.py"
click node_dialogue_api "https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/views.py"
click node_request_validation "https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/serializers.py"
click node_api_errors "https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/exceptions.py"
click node_clue_api "https://github.com/ethanmiku/csc325_capstone/blob/main/backend/evidence/views.py"
click node_progress_api "https://github.com/ethanmiku/csc325_capstone/tree/main/backend"
click node_history "https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/history.py"
click node_dialogue_models "https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/models.py"
click node_npc_profiles "https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/npc_data.py"
click node_prompt_builder "https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/prompts.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_gameplay,node_rooms,node_game_dialogue,node_game_ui toneBlue
class node_api_config,node_dialogue_api,node_request_validation,node_api_errors,node_clue_api,node_progress_api toneAmber
class node_history,node_dialogue_models,node_npc_profiles,node_prompt_builder toneMint
class node_mongo,node_claude toneRose
class node_player toneIndigo
```

## Components

### Godot Game

- [Exploration](https://github.com/ethanmiku/csc325_capstone/blob/main/game/entities/player/player.gd): `game/entities/player/player.gd`
- [Manor Rooms](https://github.com/ethanmiku/csc325_capstone/tree/main/game/maps): `game/maps`
- [Dialogue Client](https://github.com/ethanmiku/csc325_capstone/blob/main/game/services/claude_dialogue/claude_dialogue.gd): `game/services/claude_dialogue/claude_dialogue.gd`
- [Game UI](https://github.com/ethanmiku/csc325_capstone/tree/main/game/ui): `game/ui`

### Django API

- [API Configuration](https://github.com/ethanmiku/csc325_capstone/blob/main/backend/config/settings.py): `backend/config/settings.py`
- [Dialogue Endpoint](https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/views.py): `backend/dialogue/views.py`
- [Request Validation](https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/serializers.py): `backend/dialogue/serializers.py`
- [Error Handling](https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/exceptions.py): `backend/dialogue/exceptions.py`
- [Clue Endpoint](https://github.com/ethanmiku/csc325_capstone/blob/main/backend/evidence/views.py): `backend/evidence/views.py`
- [Progress APIs](https://github.com/ethanmiku/csc325_capstone/tree/main/backend): `backend`

### Dialogue Data

- [Conversation History](https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/history.py): `backend/dialogue/history.py`
- [Dialogue Records](https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/models.py): `backend/dialogue/models.py`
- [NPC Profiles](https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/npc_data.py): `backend/dialogue/npc_data.py`
- [Prompt Builder](https://github.com/ethanmiku/csc325_capstone/blob/main/backend/dialogue/prompts.py): `backend/dialogue/prompts.py`

### External Services

- **MongoDB**
- **Claude API**

### Other components

- **Player**

## Connections

- Player → Exploration: controls (evidence: `README.md`)
- Exploration → Manor Rooms: explores (evidence: `README.md`)
- Player → Game UI: uses (evidence: `README.md`)
- Dialogue Client → Game UI: presents replies
- Dialogue Client → Dialogue Endpoint: HTTP requests (evidence: `README.md`)
- Dialogue Endpoint → Request Validation: validates (evidence: `backend/dialogue/views.py`)
- Dialogue Endpoint → Conversation History: loads and saves (evidence: `backend/dialogue/views.py`)
- Dialogue Endpoint → Error Handling: handles errors (evidence: `backend/dialogue/views.py`)
- Dialogue Endpoint → Claude API: requests replies
- Dialogue Endpoint → MongoDB: persists exchanges (evidence: `README.md`)
- Conversation History → Dialogue Records: reads and writes (evidence: `backend/dialogue/history.py`)
- Dialogue Endpoint → NPC Profiles: loads profile
- Dialogue Endpoint → Prompt Builder: builds prompt
- API Configuration → MongoDB: configures database (evidence: `backend/config/settings.py`)
- Clue Endpoint → Dialogue Client: serves clue data
- Progress APIs → MongoDB: planned persistence (evidence: `README.md`)
- Claude API → Dialogue Endpoint: returns reply
