展示HN:Lightwave – 实时笔记应用,3.5年的自制JavaScript

1作者: jv22222大约 1 个月前原帖
嗨,HN! 我独自开发这个项目已经大约三年半了。我尝试过每一个新的项目/笔记工具(如 Notion、Asana、Trello 等),但总是回到简单的文本文件。我想要一种在初次接触时感觉像文本编辑器,但在需要时能够发展成真正结构的工具。 [https://lightwave.so](https://lightwave.so) 技术栈包括 Laravel、MySQL、Redis,以及在客户端手动编写的 JavaScript。没有使用 React/Vue 等框架,约 270 行 jQuery(在超过 8 万行的总代码中)用于一些遗留的 DOM 工具,另外还使用 IndexedDB 进行本地持久化。实时协作采用混合方式:HTTP/2 POST 用于可靠操作 + 通过 Laravel Reverb 的 WebSockets 实现实时光标、在线状态和编辑。 这是一项预发布的压力测试,而不是正式发布。Lightwave 将会是一个付费产品。现在我开放它是因为单独测试无法模拟真实流量带来的冲击。 上面的链接有一个按钮,可以一键创建测试账户。 已知问题:光标和选择系统是从零开始构建的(像 VS Code,而不是 contenteditable 包装),所以有很多需要改进的地方。一些键盘快捷键可能缺失。仅限桌面使用,尚未实现无障碍功能。我正在实时发布修复。 如果出现问题,应用内有一个“提交错误或反馈”的按钮。很高兴回答有关架构或其他任何问题。 一些亮点: - 粘贴 Markdown,获取原生块。复制块,获取 Markdown。 - 层次化文档结构。层次化文件管理器。 - 实时协作,带有共享光标、选择和在线状态。 - 带语法高亮的代码块。LaTeX 数学块。 - 完整的数据导出:Markdown、JSON 和附件。无锁定。 - 完整的撤销/重做功能,并可恢复光标位置。
查看原文
Hi HN!<p>I&#x27;ve been building this solo for about three and a half years. I kept trying every new project&#x2F;notes tool (Notion, Asana, Trello, etc.) and always ended up back in a plain text file. I wanted something that felt like a text editor on first touch but could grow into real structure when you needed it.<p><a href="https:&#x2F;&#x2F;lightwave.so" rel="nofollow">https:&#x2F;&#x2F;lightwave.so</a><p>The tech stack is Laravel, MySQL, Redis, and hand-rolled JavaScript on the client. No frameworks like React&#x2F;Vue&#x2F;etc. ~270 lines of jQuery (out of 80k+ total LOC) for a few legacy DOM utilities, plus IndexedDB for local persistence. Real-time collaboration uses a hybrid approach: HTTP&#x2F;2 POST for resilient ops + WebSockets via Laravel Reverb for live cursors, presence, and edits.<p>This is a pre-release stress test, not a launch. Lightwave will be a paid product. Right now I&#x27;m opening it up because no amount of solo testing replicates getting punched in the mouth by real traffic.<p>The link above has a button to create a test account in 1 click.<p>Known rough edges: the cursor and selection system are built from scratch (like VS Code, not a contenteditable wrapper), so there&#x27;s a lot of surface area. Some keyboard shortcuts may be missing. Desktop only, accessibility not yet implemented. I&#x27;m shipping fixes in real time.<p>There&#x27;s a &quot;Submit Bug or Feedback&quot; button inside the app if something breaks. Happy to answer any questions about the architecture, or anything else.<p>Some highlights:<p>- Paste markdown in, get native blocks. Copy blocks out, get markdown back.<p>- Hierarchical document, structure. Hierarchichal file manager.<p>- Live collab with shared cursors, selection, and presence.<p>- Code blocks with syntax highlighting. LaTeX math blocks.<p>- Full data export: markdown, JSON, and attachments. No lock-in.<p>- Full undo&#x2F;redo with cursor restoration.