# nourane-hammouda/plottwist architecture

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

- Interactive diagram: https://gitdiagram.com/nourane-hammouda/plottwist
- Repository: https://github.com/nourane-hammouda/plottwist

## Overview

PlotTwist is a planned interactive detective-mystery generation and solving application, not an implemented runtime in this repository. The README describes a player workflow from generating and checking an investigation through exploration, suspect interviews, and accusation. The diagram reflects the documented target architecture and capabilities; feature-level implementation paths and internal call relationships are not available, so README is used as the evidence path.

Main entry points: [`README.md`](https://github.com/nourane-hammouda/plottwist/blob/main/README.md) (Investigation engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Player experience"]
  node_web["Web front end<br/>[README.md]"]
  node_play["Explore and interview<br/>[README.md]"]
end

subgraph group_backend["Investigation engine"]
  node_rest{{"REST API<br/>[README.md]"}}
  node_engine["Investigation engine<br/>[README.md]"]
  node_generation["Mystery generation<br/>[README.md]"]
  node_consistency["Coherence checks<br/>[README.md]"]
  node_world["Case elements<br/>[README.md]"]
  node_accusation["Accusation evaluation<br/>[README.md]"]
end

subgraph group_data["Persistence"]
  node_postgres[("PostgreSQL<br/>[README.md]")]
end

node_player(("Player"))

node_player -->|"starts and plays"| node_web
node_web -->|"HTTP / JSON"| node_rest
node_rest -->|"routes to"| node_engine
node_engine -->|"generates"| node_generation
node_engine -->|"checks coherence"| node_consistency
node_generation -->|"uses case elements"| node_world
node_engine -->|"supports exploration"| node_play
node_play -->|"explores and questions"| node_world
node_engine -->|"evaluates proposal"| node_accusation
node_engine -->|"JPA persistence"| node_postgres

click node_web "https://github.com/nourane-hammouda/plottwist/blob/main/README.md"
click node_rest "https://github.com/nourane-hammouda/plottwist/blob/main/README.md"
click node_engine "https://github.com/nourane-hammouda/plottwist/blob/main/README.md"
click node_generation "https://github.com/nourane-hammouda/plottwist/blob/main/README.md"
click node_consistency "https://github.com/nourane-hammouda/plottwist/blob/main/README.md"
click node_world "https://github.com/nourane-hammouda/plottwist/blob/main/README.md"
click node_play "https://github.com/nourane-hammouda/plottwist/blob/main/README.md"
click node_accusation "https://github.com/nourane-hammouda/plottwist/blob/main/README.md"
click node_postgres "https://github.com/nourane-hammouda/plottwist/blob/main/README.md"

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_web,node_play toneBlue
class node_rest,node_engine,node_generation,node_consistency,node_world,node_accusation toneAmber
class node_postgres toneMint
class node_player toneIndigo
```

## Components

### Player experience

- [Web front end](https://github.com/nourane-hammouda/plottwist/blob/main/README.md): `README.md`
- [Explore and interview](https://github.com/nourane-hammouda/plottwist/blob/main/README.md): `README.md`

### Investigation engine

- [REST API](https://github.com/nourane-hammouda/plottwist/blob/main/README.md): `README.md`
- [Investigation engine](https://github.com/nourane-hammouda/plottwist/blob/main/README.md): `README.md`
- [Mystery generation](https://github.com/nourane-hammouda/plottwist/blob/main/README.md): `README.md`
- [Coherence checks](https://github.com/nourane-hammouda/plottwist/blob/main/README.md): `README.md`
- [Case elements](https://github.com/nourane-hammouda/plottwist/blob/main/README.md): `README.md`
- [Accusation evaluation](https://github.com/nourane-hammouda/plottwist/blob/main/README.md): `README.md`

### Persistence

- [PostgreSQL](https://github.com/nourane-hammouda/plottwist/blob/main/README.md): `README.md`

### Other components

- **Player**

## Connections

- Player → Web front end: starts and plays (evidence: `README.md`)
- Web front end → REST API: HTTP / JSON (evidence: `README.md`)
- REST API → Investigation engine: routes to (evidence: `README.md`)
- Investigation engine → Mystery generation: generates (evidence: `README.md`)
- Investigation engine → Coherence checks: checks coherence (evidence: `README.md`)
- Mystery generation → Case elements: uses case elements (evidence: `README.md`)
- Investigation engine → Explore and interview: supports exploration (evidence: `README.md`)
- Explore and interview → Case elements: explores and questions (evidence: `README.md`)
- Investigation engine → Accusation evaluation: evaluates proposal (evidence: `README.md`)
- Investigation engine → PostgreSQL: JPA persistence (evidence: `README.md`)
