Repository navigation
Getting Started
The Electron Scattering Simulator can be accessed online, installed as an offline Progressive Web App (PWA), executed locally via Node.js, or deployed as a container with Docker.
You can access the hosted application directly without any local installation:
- Live Web Application: https://electron-scattering.onrender.com/
- Project Documentation Site: https://the-studio-of-sadiq.github.io/Electron-Scattering/
All calculations default to the in-browser WebAssembly engine, ensuring client-side execution without transmitting simulation parameters to external servers.
The simulator is built with a standard Web App Manifest (public/manifest.json) and a dedicated Service Worker (public/sw.js), allowing installation as a standalone desktop or mobile application.
- Open https://electron-scattering.onrender.com/ in a supported modern browser (Chrome 87+, Edge 88+, Firefox 114+, Safari 15+).
- Click the install icon in the address bar (or select Install App in the header banner).
- Confirm the installation prompt. The application will launch in its own standalone window without browser chrome.
Once loaded, the Service Worker precaches the frontend shell, stylesheets, icons, and the complete ELSEPA WebAssembly package (elsepa.js, elsepa.wasm, and elsepa.data). Calculations can be run entirely offline without internet connectivity.
-
Node.js: Version
^20.19.0 || >=22.12.0(Node 22 LTS or Node 24 recommended). - npm: Version 9 or higher (bundled with Node.js).
-
Modern Web Browser: Supporting WebAssembly, Web Workers with ES modules (
{ type: "module" }), and Service Workers. -
(Optional) gfortran: GCC Fortran compiler. If installed and present on your system
PATH, the Express server compiles the Fortran sources on first launch and executes native binaries. Ifgfortranis absent, calculations automatically run via in-browser WebAssembly.
-
Clone the repository:
git clone https://github.com/The-Studio-of-Sadiq/Electron-Scattering.git cd Electron-Scattering -
Install exact dependencies:
npm ci
-
Start the local development server:
npm run dev
Open your browser at
http://localhost:3000.This command launches the Express server with integrated Vite middleware. If
gfortranis detected, the server compilesfortran/on demand into native executables (elsepa_execandelscatm_exec). -
Running in browser-only mode (static): If you do not require the backend server or native Fortran execution, you can run Vite directly:
npx vite
-
Building for production:
npm run build
This generates the optimized static assets in
dist/and bundles the production server intodist/server.cjs. To serve the production bundle locally:npm start
Pre-built container images containing Node.js, gfortran, and precompiled ELSEPA binaries are published to the GitHub Container Registry (GHCR).
docker run -p 3000:3000 ghcr.io/the-studio-of-sadiq/electron-scattering:latestAccess the application at http://localhost:3000.
To build the multi-stage Docker image from source:
docker build -t elsepa-simulator .
docker run -p 3000:3000 elsepa-simulatorThe containerized environment compiles elscata.f and elscatm.f using gfortran -O2, provides native execution through the Express API, and serves the production React bundle on port 3000.
Application licensed under MIT; ELSEPA 2021 licensed under CC BY-NC 3.0. Found an issue? Report it on GitHub.