Home / Server
How this site runs
A Raspberry Pi 4 at home serves everything here: plain HTML and CSS, plus two model pages that refresh themselves.
From the Pi to your browser
- Your browserAsks for elijahsworld.com.
- CloudflareAnswers for the site. It also tells browsers to cache CSS for hours.
- Cloudflare TunnelThe Pi makes an outbound connection to Cloudflare, so no port is opened on my home network.
- nginx on the PiServes the static files.
How I reach it
I use Tailscale to get to the Pi from anywhere, to deploy or fix things. It isn’t part of the path visitors take.
What runs on a timer
| When | Job | What it does |
|---|---|---|
| Hourly, on the hour | NFL scrape | Pulls this week’s games, injuries, projected QBs and weather, compares the model with the gambling odds, and publishes results.json. |
| Hourly, at :30 | College scrape | The same for FBS games. |
| Tuesdays 04:10 | NFL refit | Refits the weights, keeps the old set as weights.prev.json, republishes the page. |
| Mondays 05:10 | College refit | The same, plus the fan-bias studies. |
The jobs are systemd timers. The pages themselves are static: the browser fetches results.json and draws the table. The Pi’s weights are the live ones, so the copies on my laptop can lag.
How changes go live
I edit on my laptop, preview locally, and run one script that copies the folder to the Pi with rsync. The script stamps a hash of the stylesheet into the link, so a CSS change shows up straight away despite Cloudflare’s caching. It never touches results.json, because the Pi refreshes those itself.
The model code was also profiled and trimmed so an hourly scrape fits a small computer. On my laptop the NFL scraper went from 21.7 s to 3.7 s of CPU and from 1.23 GB to 0.45 GB of peak memory, with matching model output.
Want the models? NFL and college football are live, and so is the stock lab.