A powerful AI-assisted story writing workspace app
3.3K
A powerful AI-driven story writing web application built with Express, React, and TypeScript.
The Story Nexus is a local-first web application designed for writers who want to leverage AI to enhance their creative writing process. It provides a comprehensive environment for creating, organizing, and developing stories with the assistance of AI-powered tools. Run it on your local machine or deploy it via Docker to access from any device on your network.
Based on work started by Vijaykumar Bhattacharji; now extensively rewritten, reworked and reimagined.
I wasn't happy with the IndexedDB-based database because I couldn't share data between devices, and I wanted a more robust backend architecture. So I rewrote the backend using Express.js and SQLite with Drizzle ORM.
I didn't like Tauri because I wanted a web app that could run on any device without installing a desktop app, and possibly from a Docker container on my home server. So it was goodbye Tauri.
The code quality has been improved significantly too, and I'm gradually ripping out custom code in favor of established libraries and patterns.
I'm also in the process of reworking the UI/UX to be more of a writer's workspace.
Clone the repository
Install dependencies:
npm install
Start both backend and frontend servers:
npm run dev
This runs both:
http://localhost:3001http://localhost:5173 (with proxy to backend)Open http://localhost:5173 in your browser
npm run dev:server # Backend only (Express + SQLite)
npm run dev:client # Frontend only (Vite)
Build both backend and frontend:
npm run build
Start production server:
npm start
App runs on http://localhost:3000 (configurable via PORT environment variable)
npm run db:generate # Generate migration from schema changes
npm run db:migrate # Apply migrations to database
Pull and run the latest published image from Docker Hub:
docker-compose up -d
Supports linux/amd64, linux/arm64, and linux/arm/v7 architectures.
Access on http://localhost:3000 or from any device on your network using your machine's IP address.
Database persists in ./data/storynexus.db (mounted volume).
Version pinning:
# docker-compose.yml
services:
storynexus:
image: jonsilver/storynexus:0.6.0 # Pin to specific version
# or: jonsilver/storynexus:0.6 # Auto-update patches
# or: jonsilver/storynexus:latest # Latest release
Build and run from source:
docker-compose -f docker-compose.dev.yml up --build
New releases are published via GitHub Releases, which automatically builds and pushes multi-architecture Docker images to Docker Hub.
Creating a release:
Using the PowerShell script (Windows):
.\release.ps1 patch # 0.6.0 → 0.6.1
.\release.ps1 minor # 0.6.0 → 0.7.0
.\release.ps1 major # 0.6.0 → 1.0.0
The script automatically bumps the version, pushes to GitHub, and opens the release page in your browser.
Manual process:
npm version <patch|minor|major>git push && git push --tagsResult - Workflow automatically builds and pushes Docker images with tags:
jonsilver/storynexus:0.7.0 (specific version)jonsilver/storynexus:0.7 (minor version)jonsilver/storynexus:0 (major version)jonsilver/storynexus:latestjonsilver/storynexus:sha-abc1234 (commit hash)Note: Docker images are only built on releases, not on every commit to main.

server/ - Express.js API server
db/ - Database schema, client, migrations, and seedingroutes/ - API route handlers (stories, chapters, prompts, lorebook, etc.)index.ts - Server entry pointsrc/features/ - Feature modules (stories, chapters, prompts, ai, lorebook, brainstorm, notes)
*/hooks/ - TanStack Query hooks for data fetching*/pages/ - Route components*/components/ - Feature-specific UI componentssrc/components/ - Reusable UI componentssrc/Lexical/ - Text editor implementation (custom Lexical editor)src/services/ - Services (AI, database, export utilities, API client)src/types/ - TypeScript type definitionssrc/lib/ - Utility functions and helpersExport and import your entire database from the AI Settings page:
Export: Downloads a JSON file containing all your data (stories, chapters, prompts, lorebook entries, etc.)
Import: Replaces all current data with data from a JSON file. System prompts are preserved.
Migration workflow:
Export and import individual prompts from the Prompts Manager UI:
Export: Downloads non-system prompts only (system prompts excluded)
Import: Validates and creates imported prompts as non-system (editable). Duplicate names get (Imported) suffix. New IDs and timestamps generated.
Format:
{
"version": "1.0",
"type": "prompts",
"prompts": [
/* array of prompt objects */
]
}
Content type
Image
Digest
sha256:a4c622bf4…
Size
271 MB
Last updated
8 months ago
docker pull jonsilver/storynexus