Installation and Setup

This guide will walk you through the process of installing and setting up the Geant4 Geometry Editor.

Prerequisites

Before installing the Geant4 Geometry Editor, ensure you have the following:

  • Node.js (v18.0.0 or higher)
  • npm (v9.0.0 or higher)
  • A modern web browser (Chrome, Firefox, Safari, or Edge)

Installation

  1. Clone the repository:

    git clone https://github.com/acolijn/geant4-geometry-editor.git
    cd geant4-geometry-editor
    

  2. Install dependencies:

    npm install
    

  3. Start the development server:

    npm run dev
    

  4. Open your browser and navigate to the URL shown in the terminal (usually http://localhost:5173).

Building for Production

To build the application for production and serve it:

npm run build
npm start

The production server runs on port 3001 by default and serves the built app plus a JSON file-storage API.

Running Tests

npm test

This runs all Vitest unit tests (116 tests across 8 test files covering unit conversion, material colours, geometry icons, geometry operations, compound-ID propagation, property handlers, geometry handlers, and JSON import / export).

Troubleshooting

Common Issues

  1. Dependency errors during installation
  2. Try clearing npm cache: npm cache clean --force
  3. Update npm: npm install -g npm
  4. Then reinstall: npm install

  5. Application doesn't start

  6. Check if the port is already in use
  7. Verify Node.js version: node --version
  8. Check for errors in the console

  9. 3D viewer doesn't render properly

  10. Ensure your graphics drivers are up to date
  11. Try a different browser
  12. Check if WebGL is enabled in your browser

For more help, please open an issue on our GitHub repository.