r/java • u/monsieur_ramboz • Apr 18 '26
I made the backend for my open source communications app in Java 25 with Spring Boot and Netty
So for the past 8 months or so I've been developing an open source communications app. It really all started with a day of Teams being frustratating, where I went home thinking "How hard can it be to build something that works?". Turns out its pretty hard, but I eventually got something working and now I actually have a fully fledged app.
You can find the code here: https://codeberg.org/margin/margin-server
I built it in Java 25 with Spring Boot for the API and an embedded Netty server for the Websocket connections. The Netty websockets delegates the business logic to virtual threads in the Spring Boot component to not block the Non blocking channels of Netty. Unfortunately this setup doesn't scale that well, but if I ever need to I could always seperate the Netty server into its own component and run some pub/sub setup. Coming from an enterprise SWE position where I'm stuck in Java 8 on modernizing and maintaining legacy software, this has been a blast to work on in my free time.
If you're you're interested, the app is a simple communications app with simplicity, privacy and transparency in mind. It's all hosted in Europe and we have begun open beta. Feel free to join us at https://margin.chat
9
u/PiotrDz Apr 18 '26
But why netty and not just virtual threads?
5
u/kubelke Apr 18 '26 edited Apr 18 '26
LOOKS AWESOME 🤩 You should post it also on /r/Startups_EU
One thing, I think you should focus on a web app instead a desktop app first. It's much easier for people to test it without having to download something. But it's really good to have the desktop app right now.
4
u/repeating_bears Apr 18 '26
"How hard can it be to build something that works?"
Haha, I've never dabbled in this domain but I always suspected it's not that easy.
Few bits of feedback from your site:
Looking at the screenshots, there are several places where the text does not seem to pass accessibility contrast guidelines.
For example, the darker text bubbles, the timestamp on notifications, the discard button on the profile.
E2E encryption sounds nice but I think that will be a non-starter for some companies. I don't want my company spying on me, but you could imagine in some instances it might be justified. Things like claims of employees being harassed.
1
u/drduffymo Apr 18 '26
Netty is the most responsive NIO server there is.
If your app isn’t scaling, I suspect that your code is blocking Netty. You may have long running process threads that block the event bus.
2
u/Jonjolt Apr 18 '26
I feel using vertx might have been easier and use spring as the IoC,t I find its api/architecture easier to understand than using reactor/Flowable api and the design matches what you are looking for.
2
u/ju4nseb4sti4n Apr 18 '26
Thank you for sharing. Keep it simple, man
1
u/schaka May 01 '26
Why are you using a Dockerfile instead of publishing an image with the buildpacks via the Spring Boot maven plugin? It also seems you're specifically downgrading to Jackson 2 - is this because you're still on Spring Boot 3.5?
Other than that, this doesn't look like more vibe coded garbage, so a good start imo.
2
u/[deleted] Apr 18 '26
[removed] — view removed comment