Engineering

Side project · Prototype · 2023–2025

NarrativeForge

A node-based editor for writing, checking and testing branching interactive stories.

My part

I designed the application, the visual editor, the graph validation and the way projects are saved.

TypeScript · Next.js · React Flow · OpenAI

Critical point

The graph is checked before it becomes a story.

Writers build a story as a graph of nodes and choices. To test or export it, the editor converts the graph and checks it on the way. A story with no start, two starts or a choice that leads nowhere stops there. A dead end or an unreachable node comes back as a warning.

An optional draft from gpt-4o-mini, behind a Next.js routeIt goes into the node graph. A reply under 50 characters is refused.

  1. 1Node graphstart, story and end nodes, joined by choices, in React Flow
  2. 2ChecksGraphToStoryConverter turns the graph into a story
  3. 3Readerthe story is played choice by choice
  4. 4ExportNarrativeForge JSON, generic JSON or Twine

Errors stop the story

  • No start node found
  • Multiple start nodes found: 2
  • Choice “…” points to non-existent node

Warnings let the writer go on

  • Node “…” has no outgoing connections
  • Node “…” is not accessible
  • No end node found
Messages as written in src/lib/graphToStoryConverter.ts, shortened. Export formats from src/lib/storyExporter.ts.src/lib/graphToStoryConverter.ts