server/server.py

Standalone backend entrypoint used by Electron to launch the FastAPI server and manage PID cleanup.

CategoryBackend
Sourceserver/server.py

What it does

Standalone backend entrypoint used by Electron to launch the FastAPI server and manage PID cleanup.

Key responsibilities

  • Configures stdout/stderr encoding and adds the project root to sys.path for subprocess startup.
  • Writes a PID file so the Electron shell can identify and clean up stale backend processes.
  • Registers an atexit cleanup handler to remove the PID file on normal shutdown.
  • Starts Uvicorn with the FastAPI application from server.main on the configured host and port.

Related files

Explore other files in the Backend category.