Support Online
Skip to main content

High Performance Web Applications: A Quick Guide to Developing with Julia

🎯 What Will You Learn in This Guide?

Julia is a modern programming language that stands out especially in areas that require high performance, such as scientific computing and data analysis.
In this guide, you'll learn two different ways to develop interactive web applications using the backend power of Julia:

  • PlutoSliderServer: Rapid notebook-based development without writing code.
  • HTMX + WebSockets: HTML-based structure offering greater customization and full control.

🧠 1. Julia: Performance, Simplicity and Power

Julia is a high-level language with simple syntax and advanced data structures.
The unique JIT (just-in-time) compiler converts high-level code into machine instructions on the fly.
In this way, it offers an experience that is as fast as C and Fortran, but as easy as Python.

Why Julia?

  • 🚀 High performance in real-time data processing
  • 🧮 Perfect integration with scientific libraries
  • 💻 Parallel computing with GPU support
  • ✍️ Easy mathematical writing with Unicode symbols

🧩 2. Method 1: Fast Interactive Apps with PlutoSliderServer

🧱 2.1 Installation and Environment Preparation

Step 1: Install Julia

Download the latest version from Official Julia site.
Julia 1.10 is recommended.

Step 2: Create Project Environment

Switch to Package Mode by pressing ] in Julia REPL:

activate /home/tr1-node01/julia-web-projesi

This command keeps project dependencies in a separate environment.

Step 3: Add Pluto Package

add Pluto

💡 This command downloads and compiles the Pluto notebook tool.

Step 4: Launch Pluto

using Pluto
Pluto.run()

The Pluto interface automatically opens in your browser.

💡 2.2 Interactive Notebook Development

Create a new notebook and include the PlutoUI package:


using PlutoUI
@bind x Slider(1:10)
@bind y NumberField(5)
Markdown("Toplam: **$(x + y)**")

🎛️ This example instantly updates the result when you move the slider.

🔒 2.3 Server Broadcast and Security

Security Recommendation: Use Docker or systemd-nspawn containers to isolate Julia processes from the host system.

Step 1: Installing PlutoSliderServer

add PlutoSliderServer
Step 2: Reverse Proxy Setting (Apache)

ProxyRequests Off
ProxyPass "/etkilesimli/" "http://127.0.0.1:2345/" nocanon
ProxyPassReverse "/etkilesimli/" "http://127.0.0.1:2345/" nocanon

These settings direct traffic to the /interactive/ subpath to PlutoSliderServer.

Step 3: Starting a Persistent Server

using PlutoSliderServer
run_directory("/srv/web_apps/"; Export_offer_binder=false)

This command automatically publishes all notebooks in the directory.


🌐 3. Method 2: Customized Web Applications with HTMX + WebSockets

If Pluto doesn't seem flexible enough, you can create HTML, HTMX and WebSocket-based interactive web applications with this method.

⚙️ 3.1 Frontend Configuration

Add HTMX and WebSocket extension to your HTML file:


<script src="/htmx.js"></script>
<script src="/ws.js"></script>

<input data-hx-ext="ws" data-ws-send
data-ws-connect="wss://ornek.com/ws-app/"
type="range" name="s" min="1" max="10">
<p id='sonuc'></p>

When the user changes the slider, the data goes to the Julia server and the result is updated instantly.

🧩 3.2 Backend Communication


using HTTP, JSON

WebSockets.listen("127.0.0.1", 8660) do ws
for msg in ws
d = JSON.parse(msg)["s"]
WebSockets.send(ws, "<p id='sonuc'>Seçilen: $d</p>")
end
end

💡 HTMX automatically places incoming HTML snippets in the right place on the page.

🖼️ 3.3 Embedding Visual Data with Base64


using Plots, Base64

p = plot(sin, 0, 2π, label="sin(x)")
io = IOBuffer()
show(io, MIME"image/png"(), p)
encoded = base64encode(take!(io))
WebSockets.send(ws, "<img src='data:image/png;base64,$encoded'>")

📈 With this method, you can present graphic or media files without requiring extra storage.


🧰 4. Deployment Guide

Create an independent Julia environment for each application.

Start it as a service with systemd-run inside the container.

Enable HTTPS enforcement via reverse proxy.


systemd-run --unit=julia-webapp julia -e "using MyApp; startserver()"

❓ Frequently Asked Questions (FAQ)

1. Is Julia suitable for web development?

Yes. Julia is ideal for high-performance web applications with its JIT compiler and multi-core computing support.

2. PlutoSliderServer or HTMX?

PlutoSliderServer: Use for training, prototyping, demo purposes.

HTMX + WebSockets: Ideal for enterprise projects that require full control.

3. Why should I use Reverse Proxy?

Hides the real ports of your server.

Manages SSL/TLS (HTTPS) traffic.

It provides load balancing and caching benefits.

4. Can the user access Julia code?

No. PlutoSliderServer runs interactive components only. The user cannot execute arbitrary code.

5. Can I run Julia on GenixNode?

Yes. GenixNode's isolated container infrastructure provides a secure, high-performance runtime for Julia applications.


🏁 Result

Julia is not just a scientific language; It is now a powerful tool for web developers as well. You can create rapid prototypes with PlutoSliderServer and professional systems with HTMX + WebSockets.

💡 Get both security and performance at the same time by hosting your Julia applications on the GenixNode infrastructure.