Skip to content

cutalion/honestanswer-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

About

Re-implementation of the original Ruby project "cutalion/honestanswer" made by cursor-agent with GPT-5

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published