Platform selection
How client constraints shaped every choice below: the LieOptics backend is Python and must not be modified; the client wants a cross-platform tool a student or researcher can install and use without writing code; and the team's strongest skills are web technologies, not desktop Python GUI frameworks. Each decision lists the alternatives first, then the choice and why.
Language (front end)
DecidedTypeScript
ChosenPros
- Static types catch mismatches between the UI and the API layer early.
- Typed API interface lets a mock and the real backend be swapped.
- Team already knows it.
Cons
- Adds a compile step and some configuration.
Plain JavaScript
Pros
- No build-time type checking to configure.
Cons
- Errors surface at runtime, which is costly with numeric optics data.
Decision: TypeScript. The API contract with the backend is the riskiest seam, and types make it explicit and checkable.
Frontend framework
DecidedReact (with Vite)
ChosenPros
- Component model fits builder form, canvas, and results panels.
- Large ecosystem of plotting and canvas libraries.
- Vite gives fast reloads and simple builds.
Cons
- State management for the lens model needs deliberate design.
Vue
Pros
- Gentle learning curve and good docs.
Cons
- Less team experience; smaller pool of optics/plotting examples.
Decision: React with Vite, because the team has the most experience with it and the ecosystem covers every UI need.
Application shell and architecture
DecidedElectron desktop app
ChosenPros
- One codebase for Windows, macOS, and Linux.
- Works offline and has native file access for save/load.
- Can start the Python backend alongside the UI.
Cons
- Large installer; heavier than a native app.
Browser-based web app
Pros
- No install; easy to share a link.
Cons
- No native file access.
- Python backend must be hosted or installed separately.
Python-native GUI (PyQt or Tkinter)
Pros
- Calls the backend in-process with no API layer.
Cons
- Team lacks desktop Python GUI experience.
- Harder to build rich interactive plots and a canvas builder.
Decision: Electron with a client–server layout as the target. It satisfies the cross-platform and offline needs, plays to the team's web skills, and keeps the client's backend untouched. Per the 10/1 team decision we build web-first (Vite + React + TypeScript) and add Electron packaging once the UI direction is settled, so the renderer is a normal web app from day one.
Backend bridge
ProposedThin local Python service (HTTP)
ChosenPros
- Clean, testable boundary between UI and LieOptics.
- Same interface works for a mock, a local service, or a remote host.
Cons
- A second process to start, monitor, and package.
Electron child process over stdin/stdout
Pros
- No network port; simpler packaging.
Cons
- Custom message protocol; harder to test and reuse outside Electron.
Rewrite the analysis in JavaScript
Pros
- Single runtime.
Cons
- Violates the no-backend-changes constraint and duplicates the client's work.
Decision: A thin local HTTP service wrapping the existing package. Revisit the child-process option when Electron packaging begins.
Data and visualization
ProposedPlotly.js for plots, HTML canvas for the lens layout
ChosenPros
- Ready-made scatter, heatmap, and contour plots with zoom and hover.
- Canvas gives full control of the layout sketch.
Cons
- Plotly adds bundle size.
D3
Pros
- Maximum control over every visual detail.
Cons
- Much more code for standard scientific plots.
Decision: Plotly.js for standard plots to save time, with a custom canvas where the layout needs bespoke drawing.
Hardware and operating system
DecidedWindows, macOS, and Linux desktops; no special hardware
ChosenPros
- Covers the client's users; analytical analysis is light on compute.
Cons
- Three installers to build and test.
Decision: No GPU or special device is required because LieOptics computes aberrations analytically rather than by ray tracing.