Technical Specification: Local Desktop Production Deployment #750
marcvergees
started this conversation in
General
Replies: 1 comment
|
Thanks for putting this together @marcvergees , this is exciting! Since it's pretty much the future of the project, I'd love to hear what everyone thinks. On the questions, I'm leaning SQLite over Postgres since it's one user on one machine, and our tests already run on it. I'm also wondering if we even need Redis on desktop. Right now it's only the Celery queue, so jobs could maybe just run in process. And I'd probably stick with Electron since we're already on it. Curious if anyone sees it differently though! A few other things that we should consider:
Again I'd love to hear from others on this since neither me nor marc has expertise in this area! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
The goal is to provide a complete, offline-first experience by bundling the frontend UI, Python FastAPI backend, embedded databases (PostgreSQL & Redis), and local LLM runtime (Ollama with Qwen) into a single desktop installer managed by an Electron/Tauri shell.
1. System Architecture Overview
The desktop app shell serves as the primary process manager, booting local infrastructure sequentially on launch and communicating via local loopback (
127.0.0.1).2. Component Packaging Matrix
.asarbundle.app/Contents/Resourcesapp.asarbackend.exebackend(Mach-O)backend(ELF)initdbbin/postgres.exebin/postgresbin/postgresredis-server.exebin/redis-serverbin/redis-serverOllamaSetup.exeollama-darwininstall.sh3. Runtime Lifecycle & Subprocess Orchestration
Boot Sequence
Subprocess Management Snippet (
main.js)4. First-Run Setup & Qwen Model Provisioning
On initial app launch, the application conducts a self-healing setup routine:
DATA_DIRis empty, runinitdb -D <DATA_DIR>followed by Alembic migrations (alembic upgrade head).http://127.0.0.1:11434/api/tags. If unresponsive, execute the bundled silent installer.Stream byte progress (
completedvstotal) directly into the frontend onboarding wizard.5. Packaging & Installers
Windows: Inno Setup (
installer.iss)macOS:
electron-builder.dmg/.pkgcom.apple.security.hypervisor, bypass App Sandbox for local socket binding.arm64andx64targets or Universal 2 to maximize native execution speed.6. Security & Data Integrity
127.0.0.1. No interfaces exposed to LAN.pg_ctl stop -m fastto prevent corruption of Write-Ahead Logs (WAL).🗣️ Discussion & Open Questions
We would love to hear feedback from the team on these specific implementation points:
5432,6379,8000,11434) are occupied on the host system?Please share your thoughts, edge-case concerns, or suggestions below! 👇
All reactions