Soundbite Storycards

A playful interactive storyteller where users build short branching tales by arranging “story cards” (characters, settings, conflicts, twists) and recording optional 5–10 second voice soundbites per card. The app renders the story as a clickable flow map with preview playback, lets users reorder/branch nodes via drag-and-drop, and exports/imports stories as JSON; everything is saved locally in localStorage. Includes a small prompt generator (random card suggestions + constraints like “only 6 cards” or “must include a twist”) to spark quick sessions and keep scope tight.

To Do30
Scaffold project

Run: npm create vite@latest . -- --template react-ts && npm i && npm i -D tailwindcss postcss autoprefixer && npx tailwindcss init -p && npm i class-variance-authority clsx tailwind-merge lucide-react @radix-ui/react-dialog @radix-ui/react-dropdown-menu @radix-ui/react-tabs @radix-ui/react-toast && npx shadcn@latest init.

by system

Add Tailwind globals

Configure src/index.css with Tailwind directives and a minimal app background/text theme.

by system

Create app layout

Build src/App.tsx with a header, main two-panel layout, and placeholder panels.

by system

Add shadcn utilities

Create src/lib/utils.ts with cn() helper for Tailwind class merging.

by system

Define story types

Create src/types/story.ts defining Story, CardNode, Edge, CardKind, and AudioClip metadata types.

by system

LocalStorage repository

Create src/lib/storage.ts to load/save the current story and app settings in localStorage.

by system

Story state store

Create src/state/useStoryStore.ts as a React hook managing story graph state and CRUD actions.

by system

Toast notifications

Add src/components/ToasterHost.tsx and wire it in App to show save/import/export errors.

by system

Card kind badge

Create src/components/CardKindBadge.tsx to render a small colored label for card types.

by system

Story card view

Create src/components/StoryCard.tsx to display a node title, kind, short text, and audio status.

by system

Card editor dialog

Create src/components/CardEditorDialog.tsx for editing node title/text/kind and deleting the card.

by system

Add card toolbar

Create src/components/AddCardToolbar.tsx with buttons to add Character/Setting/Conflict/Twist cards.

by system

Link nodes action

Add edge creation UI in src/components/LinkNodeMenu.tsx to connect one card to another as a branch.

by system

Flow map canvas

Create src/components/FlowMap.tsx to render nodes and edges in a simple clickable map layout.

by system

Node selection logic

Implement selected node state and click handlers in src/state/useStoryStore.ts.

by system

Flow node renderer

Create src/components/FlowNode.tsx to render a positioned StoryCard with selection styling.

by system

Edge renderer

Create src/components/FlowEdge.tsx to draw SVG lines/arrows between nodes with click-to-select.

by system

Auto layout function

Create src/lib/layout.ts to compute simple layered positions from the story graph starting at root.

by system

Reorder via drag

Add src/components/DragReorderList.tsx to reorder a linear list of nodes using pointer events.

by system

Branch move controls

Create src/components/BranchControls.tsx to move a node up/down within its parent’s outgoing edges.

by system

Audio recorder hook

Create src/lib/useAudioRecorder.ts to record 5–10s audio clips via MediaRecorder and return a Blob.

by system

Audio clip storage

Create src/lib/audioStore.ts to persist recorded audio as base64 in localStorage per node id.

by system

Record button component

Create src/components/RecordButton.tsx with start/stop recording UI and a duration countdown.

by system

Audio playback preview

Create src/components/AudioPreview.tsx to play/pause a node’s clip and show a small progress bar.

by system

Attach audio to card

Wire recording and playback into src/components/CardEditorDialog.tsx for the selected node.

by system

Prompt generator logic

Create src/lib/prompts.ts to generate random card suggestions and constraints (e.g., max cards, must include twist).

by system

Prompt generator panel

Create src/components/PromptPanel.tsx to display generated prompts and an “Apply to new story” action.

by system

Export story JSON

Create src/components/ExportButton.tsx to download the current story (and embedded audio) as a JSON file.

by system

Import story JSON

Create src/components/ImportButton.tsx to upload/parse a JSON file and replace the current story safely.

by system

Autosave on change

Add an effect in src/state/useStoryStore.ts to persist story updates to localStorage with debouncing.

by system

In Progress0
In Review0
Done0