React + Vite frontend template for jdm-electron-flask-template desktop apps.
- React + TypeScript
- Vite
- Tailwind CSS
- Flask-SocketIO client
frontend/
├── src/
│ ├── layout/ # Header, sidebar, footer
│ ├── lib/
│ │ ├── context/ # SocketIO context
│ │ └── utilities/ # Request + socket handlers
│ ├── routes/ # Page components
│ └── App.tsx
└── vite.config.ts
npm install
npm run devProxies /api requests to http://localhost:XXXXX in dev mode.
run compile --frontendBuilds to frontend/dist/, copies to backend/static and electron/test, then cleans up.
Request handler — thin wrapper around fetch for API calls:
import { get, post } from "../lib/utilities/request_handler";
const data = await get("/api/health");Socket handler — SocketIO event helpers:
import { on, emit } from "../lib/utilities/socket_handler";
emit("run_command", { namespace, command });
on("run_line", (data) => console.log(data.text));