# Interactive plucked string simulator

**URL:** <https://discourse.julialang.org/t/interactive-plucked-string-simulator/119747>\
**Category:** General Usage\
**Tags:** webapps, websocket\
**Created:** [September 23, 2024, 1:57pm UTC](https://discourse.julialang.org/t/interactive-plucked-string-simulator/119747 "2024-09-23T13:57:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeePhillips](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leephillips/32/205514_2.png) [@LeePhillips](https://discourse.julialang.org/u/LeePhillips)\
**Post date:** [September 23, 2024, 1:57pm UTC](https://discourse.julialang.org/t/interactive-plucked-string-simulator/119747/1 "2024-09-23T13:57:05Z")

</div>

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](https://lee-phillips.org/pluckit/).

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

---

<div class="post-metadata">

**Author:** ![jdad](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jdad/32/4739_2.png) [@jdad](https://discourse.julialang.org/u/jdad)\
**Post date:** [September 24, 2024, 9:32am UTC](https://discourse.julialang.org/t/interactive-plucked-string-simulator/119747/2 "2024-09-24T09:32:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![LeePhillips](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leephillips/32/205514_2.png) [@LeePhillips](https://discourse.julialang.org/u/LeePhillips)\
**Post date:** [September 24, 2024, 1:51pm UTC](https://discourse.julialang.org/t/interactive-plucked-string-simulator/119747/3 "2024-09-24T13:51:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jdad](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jdad/32/4739_2.png) [@jdad](https://discourse.julialang.org/u/jdad)\
**Post date:** [September 24, 2024, 3:06pm UTC](https://discourse.julialang.org/t/interactive-plucked-string-simulator/119747/4 "2024-09-24T15:06:47Z")

</div>

Thanks and bravo!
