# nureenali/telltale architecture

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

- Interactive diagram: https://gitdiagram.com/nureenali/telltale
- Repository: https://github.com/nureenali/telltale

## Overview

TellTale is a creative-writing workspace: writers organize projects and chapters, draft with autosave, maintain story context and notes, and consult AI brainstorming whose ideas can be saved or turned into scenes. The main runtime shown is the React client backed by the Node/SQLite API and optional Gemini service; the README also identifies an alternative FastAPI backend. Edges follow explicit imports/calls in the excerpts and source index or README capability statements; unsampled feature internals are represented at their exact paths, with only documented links shown.

Main entry points: [`src/App.tsx`](https://github.com/nureenali/telltale/blob/main/src/App.tsx) (App routing), [`src/services/api.ts`](https://github.com/nureenali/telltale/blob/main/src/services/api.ts) (API client), [`src/features/workspace/WorkspacePage.tsx`](https://github.com/nureenali/telltale/blob/main/src/features/workspace/WorkspacePage.tsx) (Writing canvas), [`src/features/ideas/IdeasPage.tsx`](https://github.com/nureenali/telltale/blob/main/src/features/ideas/IdeasPage.tsx) (Saved ideas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Writing workspace"]
  node_app["App routing<br/>[App.tsx]"]
  node_shell["Workspace shell<br/>[Shell.tsx]"]
  node_home["Home overview<br/>[HomePage.tsx]"]
  node_projects["Project management<br/>[ProjectsPage.tsx]"]
  node_writing["Writing canvas<br/>[WorkspacePage.tsx]"]
  node_notes["Story notes<br/>[NotesPage.tsx]"]
  node_ideas["Saved ideas<br/>[IdeasPage.tsx]"]
  node_settings["Workspace settings<br/>[SettingsPage.tsx]"]
  node_workspace_state["Workspace state"]
  node_theme["Theme preferences<br/>[ThemeContext.tsx]"]
end

subgraph group_services["Runtime services"]
  node_api_client["API client<br/>[api.ts]"]
  node_local_db["Local data service<br/>[localDb.ts]"]
  node_node_api["HTTP API<br/>[api.ts]"]
  node_gemini["Gemini brainstorming<br/>[gemini.ts]"]
end

subgraph group_persistence["Workspace persistence"]
  node_sqlite[("SQLite workspace<br/>[db.ts]")]
  node_node_types["Domain types<br/>[types.ts]"]
end

subgraph group_python["Alternative Python API"]
  node_gemini_service_py["Python Gemini service<br/>[gemini_service.py]"]
  node_python_api["FastAPI endpoints<br/>[main.py]"]
  node_python_db[("Python SQLite access<br/>[database.py]")]
  node_python_schemas["API schemas<br/>[schemas.py]"]
end

node_writer(("Writer"))
node_gemini_external{{"Google Gemini"}}
node_sqlite_file[("SQLite database file<br/>[telltale.db]")]

node_writer -->|"uses"| node_app
node_app -->|"renders"| node_shell
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_writing
node_app -->|"routes to"| node_projects
node_app -->|"routes to"| node_notes
node_app -->|"routes to"| node_ideas
node_app -->|"routes to"| node_settings
node_app -->|"provides state"| node_workspace_state
node_app -->|"provides theme"| node_theme
node_shell -->|"reads state"| node_workspace_state
node_shell -->|"calls"| node_api_client
node_projects -->|"manages projects"| node_api_client
node_writing -->|"saves writing"| node_api_client
node_writing -->|"requests brainstorm"| node_gemini
node_writing -.->|"adds notes"| node_notes
node_writing -->|"saves ideas"| node_ideas
node_ideas -->|"manages ideas"| node_api_client
node_ideas -->|"creates scene"| node_writing
node_notes -->|"manages notes"| node_api_client
node_workspace_state -->|"loads workspace"| node_api_client
node_api_client -.->|"sends requests"| node_node_api
node_node_api -->|"reads and writes"| node_sqlite
node_node_api -->|"dispatches"| node_gemini
node_gemini -.->|"generates suggestions"| node_gemini_external
node_sqlite -->|"persists data"| node_sqlite_file
node_sqlite -->|"uses types"| node_node_types
node_python_api -->|"reads and writes"| node_python_db
node_python_api -->|"calls"| node_gemini_service_py
node_python_api -->|"validates payloads"| node_python_schemas
node_gemini_service_py -->|"generates suggestions"| node_gemini_external
node_python_db -.->|"persists data"| node_sqlite_file

click node_app "https://github.com/nureenali/telltale/blob/main/src/App.tsx"
click node_shell "https://github.com/nureenali/telltale/blob/main/src/components/layout/Shell.tsx"
click node_home "https://github.com/nureenali/telltale/blob/main/src/features/home/HomePage.tsx"
click node_projects "https://github.com/nureenali/telltale/blob/main/src/features/projects/ProjectsPage.tsx"
click node_writing "https://github.com/nureenali/telltale/blob/main/src/features/workspace/WorkspacePage.tsx"
click node_notes "https://github.com/nureenali/telltale/blob/main/src/features/notes/NotesPage.tsx"
click node_ideas "https://github.com/nureenali/telltale/blob/main/src/features/ideas/IdeasPage.tsx"
click node_settings "https://github.com/nureenali/telltale/blob/main/src/features/settings/SettingsPage.tsx"
click node_workspace_state "https://github.com/nureenali/telltale/blob/main/src/context/WorkspaceContext.tsx"
click node_theme "https://github.com/nureenali/telltale/blob/main/src/context/ThemeContext.tsx"
click node_api_client "https://github.com/nureenali/telltale/blob/main/src/services/api.ts"
click node_local_db "https://github.com/nureenali/telltale/blob/main/src/services/localDb.ts"
click node_node_api "https://github.com/nureenali/telltale/blob/main/server/api.ts"
click node_gemini "https://github.com/nureenali/telltale/blob/main/server/gemini.ts"
click node_sqlite "https://github.com/nureenali/telltale/blob/main/server/db.ts"
click node_node_types "https://github.com/nureenali/telltale/blob/main/server/types.ts"
click node_gemini_service_py "https://github.com/nureenali/telltale/blob/main/backend/app/services/gemini_service.py"
click node_python_api "https://github.com/nureenali/telltale/blob/main/backend/app/main.py"
click node_python_db "https://github.com/nureenali/telltale/blob/main/backend/app/database.py"
click node_python_schemas "https://github.com/nureenali/telltale/blob/main/backend/app/schemas.py"
click node_sqlite_file "https://github.com/nureenali/telltale/blob/main/data/telltale.db"

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_app,node_shell,node_home,node_projects,node_writing,node_notes,node_ideas,node_settings,node_workspace_state,node_theme toneBlue
class node_api_client,node_local_db,node_node_api,node_gemini,node_sqlite_file toneAmber
class node_sqlite,node_node_types toneMint
class node_gemini_service_py,node_python_api,node_python_db,node_python_schemas toneRose
class node_writer,node_gemini_external toneIndigo
```

## Components

### Writing workspace

- [App routing](https://github.com/nureenali/telltale/blob/main/src/App.tsx): `src/App.tsx`
- [Workspace shell](https://github.com/nureenali/telltale/blob/main/src/components/layout/Shell.tsx): `src/components/layout/Shell.tsx`
- [Home overview](https://github.com/nureenali/telltale/blob/main/src/features/home/HomePage.tsx): `src/features/home/HomePage.tsx`
- [Project management](https://github.com/nureenali/telltale/blob/main/src/features/projects/ProjectsPage.tsx): `src/features/projects/ProjectsPage.tsx`
- [Writing canvas](https://github.com/nureenali/telltale/blob/main/src/features/workspace/WorkspacePage.tsx): `src/features/workspace/WorkspacePage.tsx`
- [Story notes](https://github.com/nureenali/telltale/blob/main/src/features/notes/NotesPage.tsx): `src/features/notes/NotesPage.tsx`
- [Saved ideas](https://github.com/nureenali/telltale/blob/main/src/features/ideas/IdeasPage.tsx): `src/features/ideas/IdeasPage.tsx`
- [Workspace settings](https://github.com/nureenali/telltale/blob/main/src/features/settings/SettingsPage.tsx): `src/features/settings/SettingsPage.tsx`
- [Workspace state](https://github.com/nureenali/telltale/blob/main/src/context/WorkspaceContext.tsx): `src/context/WorkspaceContext.tsx`
- [Theme preferences](https://github.com/nureenali/telltale/blob/main/src/context/ThemeContext.tsx): `src/context/ThemeContext.tsx`

### Runtime services

- [API client](https://github.com/nureenali/telltale/blob/main/src/services/api.ts): `src/services/api.ts`
- [Local data service](https://github.com/nureenali/telltale/blob/main/src/services/localDb.ts): `src/services/localDb.ts`
- [HTTP API](https://github.com/nureenali/telltale/blob/main/server/api.ts): `server/api.ts`
- [Gemini brainstorming](https://github.com/nureenali/telltale/blob/main/server/gemini.ts): `server/gemini.ts`

### Workspace persistence

- [SQLite workspace](https://github.com/nureenali/telltale/blob/main/server/db.ts): `server/db.ts`
- [Domain types](https://github.com/nureenali/telltale/blob/main/server/types.ts): `server/types.ts`

### Alternative Python API

- [Python Gemini service](https://github.com/nureenali/telltale/blob/main/backend/app/services/gemini_service.py): `backend/app/services/gemini_service.py`
- [FastAPI endpoints](https://github.com/nureenali/telltale/blob/main/backend/app/main.py): `backend/app/main.py`
- [Python SQLite access](https://github.com/nureenali/telltale/blob/main/backend/app/database.py): `backend/app/database.py`
- [API schemas](https://github.com/nureenali/telltale/blob/main/backend/app/schemas.py): `backend/app/schemas.py`

### Other components

- **Writer**
- **Google Gemini**
- [SQLite database file](https://github.com/nureenali/telltale/blob/main/data/telltale.db): `data/telltale.db`

## Connections

- Writer → App routing: uses (evidence: `src/App.tsx`)
- App routing → Workspace shell: renders (evidence: `src/App.tsx`)
- App routing → Home overview: routes to (evidence: `src/App.tsx`)
- App routing → Writing canvas: routes to (evidence: `src/App.tsx`)
- App routing → Project management: routes to (evidence: `src/App.tsx`)
- App routing → Story notes: routes to (evidence: `src/App.tsx`)
- App routing → Saved ideas: routes to (evidence: `src/App.tsx`)
- App routing → Workspace settings: routes to (evidence: `src/App.tsx`)
- App routing → Workspace state: provides state (evidence: `src/App.tsx`)
- App routing → Theme preferences: provides theme (evidence: `src/App.tsx`)
- Workspace shell → Workspace state: reads state (evidence: `src/components/layout/Shell.tsx`)
- Workspace shell → API client: calls (evidence: `src/components/layout/Shell.tsx`)
- Project management → API client: manages projects (evidence: `README.md`)
- Writing canvas → API client: saves writing (evidence: `README.md`)
- Writing canvas → Gemini brainstorming: requests brainstorm (evidence: `README.md`)
- Writing canvas → Story notes: adds notes
- Writing canvas → Saved ideas: saves ideas (evidence: `README.md`)
- Saved ideas → API client: manages ideas (evidence: `src/features/ideas/IdeasPage.tsx`)
- Saved ideas → Writing canvas: creates scene (evidence: `src/features/ideas/IdeasPage.tsx`)
- Story notes → API client: manages notes (evidence: `src/features/notes/NotesPage.tsx`)
- Workspace state → API client: loads workspace (evidence: `src/context/WorkspaceContext.tsx`)
- API client → HTTP API: sends requests
- HTTP API → SQLite workspace: reads and writes (evidence: `server/api.ts`)
- HTTP API → Gemini brainstorming: dispatches (evidence: `server/api.ts`)
- Gemini brainstorming → Google Gemini: generates suggestions
- SQLite workspace → SQLite database file: persists data (evidence: `README.md`)
- SQLite workspace → Domain types: uses types (evidence: `server/db.ts`)
- FastAPI endpoints → Python SQLite access: reads and writes (evidence: `backend/app/main.py`)
- FastAPI endpoints → Python Gemini service: calls (evidence: `backend/app/main.py`)
- FastAPI endpoints → API schemas: validates payloads (evidence: `backend/app/main.py`)
- Python Gemini service → Google Gemini: generates suggestions (evidence: `backend/app/services/gemini_service.py`)
- Python SQLite access → SQLite database file: persists data
