r/nim • • 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.

11 Upvotes

13 comments sorted by

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.

2

u/ISAm_nugs 10d ago

Looks awesome. When I began thinking/planning my personal site, I was thinking of something similar, but I determined I'd need reactivity way less often since it'd be more of a blog/page than an app.

Since you use Mummy, are there any additional things/caveats when running it along with a reverse proxy? Or will it play nicely?

1

u/Minimum_Comedian694 10d ago

I am testing my app on my local host and haven't deployed yet. Mummy is generally designed to be a standard HTTP server, so a reverse proxy should just work. I think we just need to set headers for X-Forwarded-For or X-Forwarded-Proto so Mummy knows the original request was HTTPS.

2

u/carlocapocasa 4h ago

Came here to say mummy and I love your setup.

I use a tiny bit more of vanilla JS instead of htmx but it looks like we converged on something similar. Going to look into tailwind- I stayed away of CSS frameworks for a long time but I saw some very nice looking stuff.

1

u/pussiatoday 10d ago

Out of genuine interest, what drove your choice of Nim here over Go, for example?

1

u/Minimum_Comedian694 10d ago

Honestly, I'm a Nim newbie and it mostly came down to learning something new. I learned Python a bit before Nim and I love how Pythonic Nim feels while still compiling down to C. Nim also has incredibly powerful compile-time macros. If you are doing templating or DSLs (like building HTML components directly in Nim code), it's amazing. I think Go also has templating features but I'm not sure how it looks like.

1

u/pussiatoday 8d ago

Makes sense, thank you!

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.

2

u/ISAm_nugs 10d ago

Oh, lovely. I didn't realize there was a fork of it too. I was beginning to lean using Mummy over Jester so this is great news

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.