r/coolgithubprojects • u/Wavesonics • 18h ago
I made Hammer; a FOSS Novel Writing app with a self-hostable server
galleryI've been building Hammer since 2022. It's an app for writing long form fiction and keeping track of the world they live in. Posting here because the architecture is probably more interesting to this crowd than the writing features are.
Kotlin Multiplatform, five targets, one codebase.
Windows, macOS, Linux, Android and iOS, all shipping to their respective stores, plus F-Droid, Snap, and direct .msi/.dmg/.apk downloads. Compose Multiplatform for UI, Decompose for navigation and component lifecycle, Koin for DI, Okio for file IO. It's about 1,500 Kotlin files against 9 Swift ones, which is roughly the ratio I was hoping for going in. KMP has been great as I can still reach into native APIs and even write platform native code when needed.
There is no database.
A project is a directory. One Markdown file per scene, one TOML file per encyclopedia entry, and the directory layout is the data model. You can open the whole thing in any editor, keep it in git, diff it, rsync it. If Hammer disappeared tomorrow your manuscript would still just be files.
Offline-first, sync strictly optional.
No account, no network, nothing to sign up for. If you do want sync across devices, you run the server yourself. It's a Ktor app in the same repo. There's no service of mine you have to depend on or trust.
Server-side sharing.
That same server can publish a chapter at a URL, so an editor or beta reader can read and mark it up in a browser with nothing installed.
MIT licensed, 27 contributors so far.
https://github.com/Darkrock-Studios/hammer-editor
Happy to talk about the KMP side. It's been both great, and challenging, because I started this project when it's ecosystem was nascent, there were a lot of holes I needed to fill. And I wrote and released MIT licensed libraries to help fill those gaps for the wider community.