Ankhers

Ankhers

Holodeck: a showcase app for the Hologram framework

Hey folks,

I’ve been contributing to Hologram and building applications with it lately. It just hit a big milestone: v0.9 was recently released and includes real-time features (release post here if you want to read more). This release has unblocked me from building real applications with it. So, to learn the framework better, I put together a small project to test out how Hologram holds up in a real, albeit very small, project. The result is Holodeck.

It currently includes three applications:

  • Chat - Pick a name, create/join rooms, and chat. Messages are persisted and broadcast to everyone in the room over a Hologram subscription. Joining a room pulls the full room history.
  • Dashboard - A live look at the running BEAM: per-core CPU, memory breakdown, scheduler/uptime info, and the top processes (sortable by memory, reductions, or pid). It also streams the app’s logs into the page live.
  • Polls - Create a simple poll, vote, and watch the results update live. The results page also demos Hologram’s JS interop by working directly with Chart.js.

Keep in mind that I left a few things out on purpose, since I wanted to focus on Hologram and on keeping the app easy to pick up and use. So there’s no authentication in chat, a fixed number of answers in polls, and so on.

Live demo: https://holodeck-divine-dream-8428.fly.dev
Source: ~ankhers/holodeck - A showcase of different hologram applications - sourcehut git

Feedback is welcome! If you know a better way to accomplish something, please let me know. And if there’s another part of Hologram you’d like to see demoed, say the word and I’ll see about building it. Contributions are welcome too.

Most Liked Switch mode

nxy7

nxy7

Chat is also broken, swallows some messages for some reason (I think they’re visible after refresh though)

bartblast

bartblast

Creator of Hologram

Cool stuff, congrats!

If you open the browser console there are a few errors (a FunctionClauseError among them) that I suspect are behind the funky behaviour, so that’s probably where I’d start. (Happy to help if you get stuck)

One separate note: the broadcasting goes through Hologram.Realtime.* directly, which is meant more as an escape hatch. For chat it’s better to use put_broadcast from inside a handler - it’s transactional, so the send is tied to the handler succeeding. It’s usually a small change too: if whatever does the broadcast is reachable from a handler that carries the server struct (like init/3 or command/3), you just thread that server struct down to it and call put_broadcast there.

jam

jam

Cool! For some reason, on mobile the buttons don’t seem to work. For example I wasn’t able to create a chat room.

The source hut link has a typo. I found the repo here ~ankhers/holodeck - A showcase of different hologram applications - sourcehut git but can’t seem to find the hologram specific code.

Last Post!

Driky

Driky

Cool stuff!

Here are some bugs I found:

  • on the dashboard, when changing the sort, you click on another sort before the previous one changes the view. It seems to generate an error in the log stream.
  • polls: I’m can’t edit any of the fields
  • in the UI: there seems to be no hover effect or click animation. This is making it very confusing.

Where Next?

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2976 91332 914
New
byu
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project. My initial shotgu...
New
arcanemachine
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
AstonJ
Just a general thread to post chat/news/info relating to AI/ML stuff that may be relevant for Nx now or in the future. Got anything to sh...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
matt-savvy
Is there a word for the ~> symbol used in Version strings? Do you also just call it a Squiggle Arrow™ ?!
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
zachdaniel
Introducing AshStorage! Attachment and file management that slots directly into your resources :smiling_face_with_sunglasses: I had hope...
New

We're in Beta

About us Mission Statement