A web-based creative writing platform inspired by Ghostwriter's "Vibe Mode." Collaborate with an AI language model in timed, iterative writing sessions to enhance your creativity and storytelling skills.
- Back-and-forth writing cycles between you and the AI
- Timed writing sessions with configurable durations
- Timer automatically starts when you begin typing
- Visual warnings when time is running low
- Automatic turn-switching when time expires
- AI-powered text continuation with OpenAI integration
- Selectable genre/vibe modes (Hardboiled Detective, Fantasy, Sci-Fi, and more)
- Adjustable AI response length (short, medium, long)
- Free Writing mode where the user starts first
- Modern, responsive web UI with Tiptap rich text editor
- Draggable floating timer
- Typewriter/emanation effect for AI responses
- Node.js (version 14.x or higher)
- npm or yarn
- OpenAI API key
-
Clone the repository:
git clone https://github.com/yourusername/ghostwriter-web-edition.git cd ghostwriter-web-edition -
Install dependencies:
npm run install-all
-
Create a
.envfile in the/serverdirectory:OPENAI_API_KEY=your_api_key_here PORT=3000 -
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:3000
- Select a genre/vibe, timer duration, and AI response length from the dropdown menus
- Click the START button to begin the cycle
- The AI generates an opening paragraph based on the selected genre and length
- When the AI finishes writing (indicated by "Your Turn - Start Typing to Begin Timer"), you can start typing
- The timer displays the full selected time until you begin typing
- The timer only starts counting down when you begin typing, not before
- When the timer is active, it gets a blue border as a visual indicator
- When the timer gets to 5 seconds remaining, it flashes orange as a warning
- When the timer expires, your turn ends, the timer flashes red, and the editor locks
- The AI takes your writing and continues the story
- The timer resets to its original duration for the next turn
- The cycle repeats, creating a collaborative story between you and the AI
- Double-click the timer to restart it manually if needed
- The timer is draggable if you want to reposition it on the screen
- Choose a longer timer duration for more complex writing
- Adjust the AI length to control how much text the AI generates:
- Short: one sentence (brief responses)
- Medium: ~80 words (standard responses)
- Long: ~150 words (detailed responses)
This project consists of:
- A vanilla JavaScript frontend in the
/vanilladirectory - A Node.js/Express backend in the
/serverdirectory
The frontend uses:
- Vanilla JavaScript (ES6+)
- Tiptap for the rich text editor
- CSS for styling
The backend uses:
- Express.js
- OpenAI Node.js SDK (v5.x)
- CORS for cross-origin requests
- dotenv for environment variables
NONE
- Inspired by Ghostwriter's "Vibe Mode"