Interactive plucked string simulator

I wanted to experiment with using Julia as a back end for an interactive web thing, communicating over websockets. The result is at The Plucked String.

I found that combining HTMX on the front end with the HTTP.jl websocket servers on the back end gave me what I was after: you can create any interface that you can express with HTML and its controls can call Julia functions over the network, which can send output in textual, graphical, audio, etc., form back to the page. In this example the calculations are simple, so responsiveness is limited only by the network connection. Running the server on my local machine presents an instantaneously responding application.

I like this approach because it uses no frameworks, the HTMX payload is very small, and I don’t need to write any javascript (although I did, to modify the behavior of the controls). Using websockets helps the webapp to respond quickly. And we can easily stream other information onto the page, for example the number of users here, updated every two seconds

3 Likes

Very interesting ! Is there a way to see the source html/julia for the web site and the backend?

git clone https://lee-phillips.org/pluckit/code

1 Like

Thanks and bravo!

1 Like