← The Lab
// The Lab

Home web server

The old PC that hosts this website, the chatbots and the other apps.

ApacheLinuxDockerRabbitMQ

This website used to live on a free hosting service. Like most of them, it couldn’t host WebGL games, and I wanted to put my game Shape Slayer online. So I set up my own Apache web server.

Getting it running took a few steps: configuring Apache, getting a static IP address, buying a domain and pointing it at the server, setting up an SSL certificate, and so on.

To learn about microservices and scaling out, the tools that need a server (the sentiment analysis, the Ishihara recognizer and the R.S. Bonum chatbot) each run as their own service. A small API takes the requests from the website and hands the work to them through the RabbitMQ message broker, and they send the results back the same way. The lighter tools, like the ASCII converter and the cellular automaton, now run right in your browser.

Today the same server also runs this site, Tin Bot, EventFlow and the Tennis Performance Center, with Apache in front of all of them. The animation above is that setup: every dot is a request coming in from the internet, routed by Apache to a site or app, or through the API and RabbitMQ to one of the tools, and the orange dot is its answer going back. Point at a service to send it traffic.

THE HOME SERVER · UBUNTU · DOCKERlive toolsEveryone visiting bojan-radulovic.xyz. Plain HTTP on port 80 is redirected to HTTPS.Visitorsbrowsers, over HTTPSApache 2.4, running on the home server itself. It holds the Let's Encrypt certificate and sends each request on by its path.Apache:443 · TLSThis portfolio, built with Astro into plain HTML, CSS and JavaScript that Apache serves straight from disk.This website/ · static filesThe virtual Tin Bot, an Expo web build served straight from disk.Tin Bot/robot · static filesA React app served by nginx in its own container.EventFlow/eventflow · :3000The Tennis Performance Center, a React app served by nginx in its own container.Tennis Perf. Center/tpc · :8080The small API behind the live tools. It hands the work to the workers through RabbitMQ and makes Emma's voice.Portfolio API/api · FastAPI :5100The message broker between the API and the workers.RabbitMQ:5672 · message queueThe sentiment analysis worker.nlpsentiment analysisThe Ishihara number recognizer worker.ishiharareads test platesThe R.S. Bonum chatbot worker: it finds the six closest chunks in its FAISS index and asks OpenAI for the answer.bonum-chatbotLangChain · FAISSThe database for EventFlow and the Tennis Performance Center. The apps talk to it from the browser; a daily job keeps the free project awake.SupabaseEventFlow & TPC dataReads the chatbot's answers out loud on Emma's page. The API calls it (the chatbot worker only writes the text): Microsoft's Croatian neural voice, Gabrijela, with Google's voice as the fallback.Edge TTS · gTTSchatbot answers, read outEmbeddings for the chatbot's documents and questions, and the model that writes the answers.OpenAI APIembeddings · answersstatic filesDocker containeron the home serveron the internet
How it fits togetherEvery request comes in through Apache. Point at a box for more.Swipe sideways to see all of it.