TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: One Million and One Checkboxes. Running on Elixir and Mithril.js

5 点作者 gandreani7 个月前
Hello!<p>As soon as I saw eieio&#x27;s <a href="https:&#x2F;&#x2F;onemillioncheckboxes.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;onemillioncheckboxes.com&#x2F;</a>, I knew I wanted to try it out using Elixir. The original was created using Python and Redis (later Go and Redis) but this one is using just one Elixir server and HAProxy for SSL termination. It&#x27;s also using S3 to show the overview page where all the checkboxes are drawn on a 1000x1000 canvas.<p>The whole site is running on a 4 core 8 GB Hetzner VPS so I&#x27;m interested to see how it will hold up.<p>This took an embarrassingly long amount of time to complete (the first commit was on July 23) but it was my first real attempt at coding anything significant in Elixir.<p>Initially I tried using LiveView but there were performance issues just rendering 2000 checkboxes on screen. I was also unsuccessful in using the new Streams concept in LiveView which is supposed to help with these &quot;more data than you can render&quot; scenarios.<p>In the end I used LiveView to render the header and have it update on a timer, and the checkboxes are rendered with Mithril.js. The checkbox info is passed via the LiveView websocket connection and any update to a checkbox is passed through that channel as well.<p>I&#x27;m stepping away for the next half an hour to run an errand but I&#x27;ll be back to answer any questions people might have!<p>Please try to break my site and invite your friends to do the same

暂无评论

暂无评论