Honestanswer (TypeScript rewrite)
This is a TypeScript/Node.js re-implementation of the original Ruby project “Honestanswer”. The legacy Ruby source is here: https://github.com/cutalion/honestanswer
This project was fully created in Cursor Agent using GPT-5.
What it does
- Create a question without login and get a unique link
- Share that link for anonymous, pseudonymous answers
- See answers appear in realtime (Server-Sent Events)
- Remember recently viewed questions (cookie)
Tech stack
- Express 4 + EJS views
- TypeScript 5, tsx (for dev), ESM modules
- better-sqlite3 (SQLite, zero external service)
- Server-Sent Events for live updates
- Cookie-based pseudonymous identity using the same name list spirit as the original (Disney/Pixar character names) plus a stable user id (MD5) to generate a consistent identicon avatar
App structure
- src/server.ts – HTTP server, routes, SSE, cookies
- src/db.ts – SQLite schema and data helpers
- views/*.ejs – server-rendered pages and minimal client script for AJAX + SSE
- public/ – static assets (optional)
Key routes
- GET / – ask form; layout shows “Recently Viewed”
- POST /questions – create a question (form field: question[text])
- GET /questions/:token – show question + chat-style answers; live updates via SSE
- POST /questions/:token/answers – add an answer; handled via AJAX; also broadcasts via SSE
- GET /questions/:token/stream – SSE endpoint for realtime answer events
Pseudonymous identity
- A
user_name
and an MD5user_id
are stored in cookies for 1 year. - New questions and answers record
authorName
andauthorId
. - Avatars use Gravatar identicons: https://www.gravatar.com/avatar/{authorId}?s=32&d=identicon&r=PG
Local development
cd honestanswer-ts
npm install
npm run dev
# open http://localhost:3000
Build & run
npm run build
npm start
Notes
- The database file
data.sqlite
will be created in the app directory. - Basic runtime migrations add missing columns if you update from a previous run.
- No external services required.
License
- Same spirit as the original; see the original repo for historical context: https://github.com/cutalion/honestanswer