Building a real-time desktop system (Electron) at scale , looking for engineers who’ve dealt with similar constraints
Posted by Mysterious-Draw-3897@reddit | ExperiencedDevs | View on Reddit | 13 comments
Hey,
I’m working with a team to build a cross-platform desktop system (MacOS and Windows) that runs continuously in the background and tracks real-time user activity.
This isn’t a typical web stack problem.
The challenges are much closer to system-level behavior than standard app development.
The core problems we’re dealing with:
- high-frequency event tracking (keyboard, mouse, app usage)
- long-running background processes with tight CPU/memory constraints
- offline-first data + reliable sync under unstable conditions
- consistency across OS-level differences (permissions, APIs, behavior)
- keeping Electron apps performant under continuous runtime
Where it gets tricky:
- memory leaks and performance degradation over long sessions
- handling retries / partial failures without corrupting state
- balancing data collection vs privacy constraints
- ensuring predictable behavior across different environments
Want to hear from people who’ve worked on:
- Electron apps running continuously in the background
- system-level input tracking or event streams
- performance tuning for long-lived desktop processes
- cross-platform behavior differences (MacOS / Windows)
What broke at scale?
What did you have to redesign later?
Also, we’re bringing in a small number of engineers who’ve worked on similar systems.
If you’ve built something in this space (especially real-time / background / performance-sensitive apps), I’d be interested to hear about it.
Beli_Mawrr@reddit
Why does it need to be Electron? No reason to have a second browser running all the time. You can run a backend app that serves a telemetry frontend. The backend can monitor things like keystrokes and mouse position. If ever you needed to monitor it you could just go to its dedicated port.
BTW AI has a very distinctive writing style. Did you tell it to make a job ad without making it obvious?
Mysterious-Draw-3897@reddit (OP)
Electron isn’t there by accident.
If this were just “run a backend and open a browser tab”, this wouldn’t be a hard problem.
The constraints here are:
-long-running background execution
-OS-level access + permissions
-consistent behavior across Mac and Windows
That combination is exactly where the simple approaches fall apart.
Electron is just one trade-off ,not perfect, but practical given cross-platform + iteration speed.
And no, not AI. Just writing clearly so people don’t have to guess what the problem is.
Have a good day
Beli_Mawrr@reddit
Yes, you would have all those things with a backend node/python server. You would get the same behavior across mac and PC (And linux too). I do this in my main job. The main app is a backend only thing and we serve a frontend to monitor it.
Mysterious-Draw-3897@reddit (OP)
That works if your system is backend-first with optional monitoring.
That’s not what this is.
-a persistent local agent with OS-level hooks (not just a server process)
-controlled permissions (especially on macOS) tied to a user-facing app
- packaging, auto-updates, and predictable distribution across environments
- tight coupling between background capture + local UI state
Running “a backend + browser UI” doesn’t cover those cleanly, especially around permissions, UX, and deployment.
You can force it, but you end up rebuilding half of what Electron already gives you.
Electron isn’t perfect, but it’s a deliberate trade-off here, not an accident.
Beli_Mawrr@reddit
Dude. Chatgpt does not know anything. Stop letting it answer for you. I'm a software engineer and have worked in this space for 10 years. I've built both electron and apps using the technique I'm describing here. Why'd you come ask for advice and then just let chatgpt answer for you?
I think you're misunderstanding a key fact: Electron has a "Main" process which is literally just a nodejs server. It then has a "render" Process which is its own browser that it controls. The "Main" process is identical to what I'm suggesting. The "render" process is unnecessary because you don't need it 90% of the time.
yes, a nodejs server process is exactly this. For example https://github.com/acidbotmaker/global-input-tracker does exactly this. Electronjs is running this same exact background process, but with the additional overhead of needing to run a render process as well that you won't be using most of the time
yes, electron and nodejs have the exact same permissions required.
Yes, electron has this exact same requirement that a nodejs based backend app would.
you'd need IPC for this in electron, a socket with a browser ui. Same difference.
Mysterious-Draw-3897@reddit (OP)
You’re arguing capability, not reality.
Yeah, Electron has a Node “main” process. Everyone knows that.
That’s not the point.
You can build this as a Node service + browser UI.
People also build desktop apps in pure C. Doesn’t mean it’s the right trade-off.
What you’re ignoring:
- distribution to non-technical users (install, updates, consistency)
-macOS permission flows tied to an actual app bundle (not just a background process)
- lifecycle control (startup, crashes, restarts, updates)
-having a controlled UI surface when needed (not “open localhost and hope it works”)
In real-world products, teams that go “just Node + browser” end up rebuilding half of this anyway.
So yeah , technically possible.
Practically? messy.
This isn’t about what can be done.
It’s about what actually holds up in production without turning into a maintenance nightmare.
If your setup works for your case, good.
Different constraints here.
Beli_Mawrr@reddit
Good luck. You clearly know how to use Chatgpt so why not just ask it to finish your solution
SillyYou8433@reddit
I'd bet my life this is AI. Even the reply is very clearly AI writing style
Beli_Mawrr@reddit
100%.
Mysterious-Draw-3897@reddit (OP)
Call it whatever you want.
If you’ve actually built something that runs 24/7 in Electron, you know exactly the kind of issues I’m talking about.
ExperiencedDevs-ModTeam@reddit
Rule 7: No Google-able questions
I.e. no "what are the best language(s), framework(s), tool(s), book(s), resource(s)". Most of these are trivially searchable.
If you must post something like this, please frame it in a larger discussion - what are you trying to accomplish, what have you already considered - don't just crowd-source out something you want to know.
Slow-Entertainment20@reddit
Everything you mentioned is about performance but I didn’t see anything about the front end. Why do you need electric?
Mysterious-Draw-3897@reddit (OP)
Most of the complexity here is actually not frontend-heavy , it’s around background execution, OS signals, and keeping the system stable over long sessions.
Electron is mainly there for:
-having a controlled runtime across Mac + Windows (same behavior everywhere)
-shipping updates quickly without dealing with native UI differences
-building internal/debug tooling around the system without spinning up separate apps
The UI itself is relatively thin , it’s not a design-heavy product. Most of the work is in the background agent and how it behaves.
We’ve considered more native approaches, but the trade-off so far has been speed of iteration + consistency vs raw performance.