Prerequisites
Before installing Particle Simulator, ensure you have the following installed:Node.js
Version 18.0 or higherDownload from nodejs.org
Package Manager
npm, yarn, or pnpmnpm comes with Node.js
Check your Node.js version with
node --version. If you need to upgrade, consider using nvm (Node Version Manager).Clone the Repository
First, clone the Particle Simulator repository from GitHub:Install Dependencies
Install all required packages using your preferred package manager:package.json:
Runtime Dependencies
- react (^19.2.0) - UI framework
- react-dom (^19.2.0) - React renderer for web
- three (^0.182.0) - 3D graphics library
- @react-three/fiber (^9.5.0) - React renderer for Three.js
- @react-three/drei (^10.7.7) - Useful helpers for react-three-fiber
Development Dependencies
- typescript (~5.9.3) - TypeScript compiler
- vite (^7.2.4) - Build tool and dev server
- @vitejs/plugin-react (^5.1.1) - Vite plugin for React
- eslint (^9.39.1) - Code linting
- @types/react (^19.2.5) - React type definitions
- @types/react-dom (^19.2.3) - React DOM type definitions
- @types/node (^24.10.1) - Node.js type definitions
Development Server
Start the development server with hot module replacement:The port number may differ if 5173 is already in use. Check the terminal output for the actual URL.
Development Features
- Hot Module Replacement (HMR): Changes to code automatically update in the browser without full reload
- Fast Refresh: React components update without losing state
- TypeScript: Full type checking in development
- Source Maps: Debug with original source code
Build for Production
Create an optimized production build:- Runs TypeScript compiler (
tsc -b) to check for type errors - Builds the application with Vite (
vite build) - Outputs optimized files to the
dist/directory
Build Output
The production build includes:- Minified JavaScript bundles
- Optimized CSS
- Compressed assets
- Source maps for debugging
Preview Production Build
Test the production build locally before deploying:dist/.
Project Structure
After installation, your project structure will look like this:Linting
Run ESLint to check code quality:- TypeScript type errors
- React best practices
- Code style issues
- Potential bugs
Development Tips
TypeScript Configuration
The project uses strict TypeScript settings for type safety. Key configurations intsconfig.json:
- Strict null checks enabled
- No implicit any
- Strict function types
- Module resolution: bundler
Vite Configuration
Vite is configured with the React plugin for optimal development experience:Hot Module Replacement
When you modify files:- React components: Fast refresh preserves component state
- CSS files: Styles update instantly
- TypeScript files: Full page reload after compilation
Troubleshooting
Port Already in Use
If port 5173 is occupied:TypeScript Errors
If you encounter TypeScript errors:Dependency Issues
If packages are not installing correctly:Performance Issues
For slow build times:- Ensure you’re using the latest Node.js version
- Close unnecessary applications
- Try increasing Node memory:
Next Steps
Quick Start Guide
Create your first particle simulation
Configuration
Learn about particle properties and settings
Data Structures
Explore the codebase and data structures
Contributing
Contribute to the project