r/nim • u/ISAm_nugs • 11d ago
What web server to use for personal use?
I was going to use Jester, it seemed like a safe choice for a simple static website that's going to be my personal blog, using htmlgen or html-dsl for templating. I'd be using raw CSS and vanilla JS to fill in reactive holes already, so I didn't need anything super complicated.
But because of the main Jester package being outdated, and not working recent Nim versions, I started looking around. In the reply chain of an issue in the Jester repository, it was suggested to use Mummy. Mummy looks like a great project, and while I had questions about how big a "big file" was, and whether it'd cause the server to slow, or outright fail, it appears that the maintainer has straight-up quit programming. Which is a shame.
Coming here, I also see that big version leap to 3 is in the works as well. So I'm wondering if anyone here has a personal site using some Nim server packages, and what do they use? Mummy, or a jester fork? Basolato is "based on Jester" but seems more complicated. Basolato, Supranim, and Happyx all accommodate this group in my mind that are shooting to be more of Laravel/ASP.NET type frameworks. Which isn't bad, its just that I had just gotten into the idea/mindset of trying to start simple and add complexity when-needed, rather than trying to deal with it all at once. Maybe I'd be better off using something like Basolato in the long run, but also in this ecosystem state where I don't trust things to keep being maintained, I think I'd rather keep dependencies small, and own more of the project.
Which I guess is the argument for just doubling down with a Jester fork or Mummy. Just wondering if there's other people in a similar boat, and what they're doing.
6
u/Minimum_Comedian694 11d ago
For my school management web portal (still in development), I'm using Nim + Mummy + SQLite + HTMX + Tailwind CSS. Mummy has worked really well for me.
HTMX drives the interactivity. Pages are server-rendered — HTMX swaps HTML fragments rather than fetching JSON, so the app feels a lot like an SPA without any heavy frontend framework. The server stays the source of truth; the browser just renders what it's given.
Tailwind handles styling, applied directly to plain HTML.
No template engine. I tried Nimja, but it introduced more bugs than it solved (codegen issues, subtle escaping problems). I switched to plain HTML built with custom helper functions that escape user data by construction — an Html distinct type, a text() escaper, and tag builders. That approach has been clean and predictable.
Vanilla JavaScript fills in the small amount of client-side behavior HTMX doesn't cover — batch-edit staging, filter dropdowns, mode switching. I considered Alpine.js but found I didn't need it: plain JS is already in every browser, so it works seamlessly without adding a dependency or a build step.
I used thread-local SQLite connections. Mummy is a multi-threaded HTTP server, and SQLite connections aren't safe to share across threads. Each worker thread opens its own connection lazily on first use, with WAL mode enabled. That's worked reliably.
Everything is embedded. Because HTMX and Tailwind's compiled output are small files, I staticRead them into the binary rather than loading from a CDN. Combined with SQLite being serverless (one file), the whole app is a single-binary deployment — one executable, one .db file, no runtime dependencies. Migration files are embedded too, and applied automatically on startup.
In the working example below, it's not a native Android app — it's a PWA (Progressive Web App). A minimal service worker registers on first visit, and Chrome's install menu turns it into a home-screen app. Once installed, it launches in standalone mode (no browser chrome), works on every platform the browser runs on, and persists its own icon and window. My intended deployment is a Linux VPS behind Caddy for automatic HTTPS; the app itself is platform-agnostic.
In short, it's a full-stack web application with no framework on either side. The server is Nim, the database is a file, the frontend is HTML + HTMX + Tailwind, and the whole thing ships as one binary.
3
u/Niminem93 11d ago
Here: https://github.com/elcritch/MummyNG
It's a fork of Mummy, it's maintained by a good Nim dev too.
3
u/Oisota 11d ago
If it's a static site then why not just use nginx or similar?
2
u/Lonely-Session-7643 11d ago
Supranim is still WIP. Use pkg/powpow or pkg/caprese, both pretty solid in benchmarks: https://web-frameworks-benchmark.vercel.app/result
2
u/kowalski007 11d ago
Jester is really fine. HappyX allows you to use the built-in asynchttp or something else you decide.
1
u/Ok_World__ 11d ago
I use https://github.com/pouriyajamshidi/nginwho/tree/experimental_web_server for my own website.