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

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.

Where Next?

Popular in Discussions Top

thojanssens1
It would be nice to be able to define a redirect from one route to another from the router.ex file. E.g.: redirect "/", UserController, ...
New
mmport80
I have put far too much effort into Dialyzer over the last year or so - and basically - I doubt it’s worth the effort. It’s not as easy ...
New
mmmrrr
Just saw that dhh announced https://hotwire.dev/ Is it just me or is this essentially live view? :smiley: Although I like the “iFrame-e...
New
pillaiindu
I want to convert a Phoenix LiveView CRUD website to a CRUD mobile app. What do you think is the easiest way to do so?
New
AstonJ
Are there any Elixir or Erlang libraries that help with this? I’ve been thinking how streaming services like twitch have exploded recentl...
New
AstonJ
If a newbie asked you about Phoenix Contexts, how would you explain the basics to them? Feel free to be as concise or in-depth as you li...
New
jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
AstonJ
If so I (and hopefully others!) might have some tips for you :slight_smile: But first, please say which area you’re finding most challen...
New
Owens
Hello all, I am developing a new mobile app with Flutter frontend and Phoenix backend. The mobile app has real-time task management and c...
New
kostonstyle
Hi all How can I compare haskell with elixir, included tools, webservices, ect. Thanks
New

Other popular topics Top

ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43622 214
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39297 209
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31142 143
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement