Ghosttype is a full-stack, single-user writing web app built for people who just want to write. No toolbar clutter, no feature bloat — just a cursor, keyboard shortcuts, and an editor that gets out of your way.
Editor
- Full-screen minimal canvas with instant cursor on load
- Rich text via keyboard shortcuts: bold, italic, H1–H3, blockquote, code block, bullet/numbered lists
- Floating toolbar on text selection (bold, italic, link, highlight)
- Word count, character count, reading time in the status bar
- Typewriter mode — keeps the active line vertically centered
- Focus mode — dims everything except the current paragraph
- Auto-save every 10s with a subtle "Saved" indicator
- Inline editable document title
Document management
- Collapsible sidebar with documents sorted by last modified
- Create, rename, duplicate, delete documents
- Folder and tag organization
- Full-text search with highlighted matches
- Export as Markdown, plain text, or styled HTML
AI Review (optional — requires OpenAI API key)
- Trigger review via
Cmd+Shift+Ror the AI panel button - GPT-4o analyzes your document for Clarity, Structure, Tone, and Grammar
- Each category scored 1–10 with inline sentence-level suggestions
- Click a suggestion to highlight the sentence in the editor
- "Fix All Grammar" applies grammar corrections automatically
- Streaming response via SSE
Backend
- Node.js + Express REST API
- SQLite via better-sqlite3 (WAL mode, FTS5 full-text search)
- OpenAI proxied through backend — no key exposure to the client
- SSE endpoint for streaming AI feedback
- Simple PIN-lock auth (4-digit code, bcrypt hash)
- Rate-limited auth endpoints, Helmet security headers, CORS
git clone <repo-url>
cd ghosttype
npm install
npm startOpen http://localhost:3001. First visit will prompt you to set a 4-digit PIN — that's your only credential.
echo "OPENAI_API_KEY=sk-..." >> .envWithout it, everything works except the AI Review panel.
| Shortcut | Action |
|---|---|
Cmd+B |
Bold |
Cmd+I |
Italic |
Cmd+Opt+1 |
Heading 1 |
Cmd+Opt+2 |
Heading 2 |
Cmd+Opt+3 |
Heading 3 |
Cmd+Shift+B |
Blockquote |
Cmd+Opt+C |
Code block |
Cmd+Shift+7 |
Bullet list |
Cmd+Shift+8 |
Numbered list |
Cmd+N |
New document |
Cmd+\ |
Toggle sidebar |
Cmd+Shift+R |
Toggle AI review panel |
Cmd+Shift+F |
Focus mode |
Cmd+Shift+T |
Typewriter mode |
Cmd+P |
Search documents |
Cmd+S |
Save immediately |
Cmd+? |
Keyboard shortcuts cheatsheet |
| Layer | Choice |
|---|---|
| Frontend | Vanilla JS (no framework), contenteditable editor |
| Backend | Node.js, Express |
| Database | SQLite via better-sqlite3, FTS5 full-text search |
| AI | OpenAI API (GPT-4o), proxied through backend with SSE streaming |
| Auth | bcrypt-hashed 4-digit PIN, in-memory session token |
| Design | Inter + JetBrains Mono, dark/light themes, teal accent (#0D9488) |
ghosttype/
├── server/
│ ├── index.js Express entry, middleware, static serving
│ ├── config.js Env-var config with fail-fast validation
│ ├── db.js SQLite setup, WAL mode, FTS5 triggers
│ ├── middleware/
│ │ └── auth.js PIN auth, session token management
│ └── routes/
│ ├── auth.js PIN setup, unlock, status
│ ├── documents.js CRUD, search, export, folders/tags
│ └── ai.js OpenAI proxy, SSE streaming endpoint
├── public/
│ ├── index.html SPA shell
│ ├── css/app.css Full design system (dark + light)
│ └── js/
│ ├── api.js HTTP client + SSE polyfill
│ ├── editor.js Contenteditable editor logic
│ ├── sidebar.js Document list, search, CRUD
│ ├── ai-panel.js AI review panel with streaming
│ └── app.js Auth, shortcuts, toolbar, export
├── package.json
└── .env.example
MIT