This repository contains the frontend code for Electrisim - an open-source web-based application for comprehensive power system modeling, simulation, and analysis. Electrisim provides powerful tools for electrical engineers and power system professionals to perform:
🌐 Online Application: app.electrisim.com
📁 Backend Repository: Backend Code
- Power Flow Analysis
- Optimal Power Flow (OPF)
- Short-Circuit Analysis
- Contingency Analysis
- Controller Simulation
- Time Series Simulation
🌐 Live Application: app.electrisim.com
Note: Currently optimized for desktop web browsers. No Mobile support
- Intuitive Graphical Interface - Drag-and-drop power system modeling
- Industry-Standard Components - Generators, transformers, transmission lines, loads, and more
- Advanced Analysis Tools - Comprehensive simulation capabilities
- Real-time Collaboration - Cloud-based with multi-user support
- Export/Import - Multiple file formats supported
- Open Source - Transparent and extensible codebase
- Frontend Framework: Custom JavaScript with mxGraph library
- Graphics Engine: mxGraph for diagramming capabilities
- Build System: Node.js with custom deployment scripts
- Authentication: OAuth integration
- Cloud Storage: Integration with Google Drive, OneDrive, Dropbox
- Mathematical Engine: Integration with pandapower for calculations
Before deploying Electrisim, ensure you have the following installed:
- Node.js (version 14.0 or higher)
- npm (Node Package Manager)
- Git (for version control)
- Web Server (Apache, Nginx, or similar for production deployment)
git clone <repository-url>
cd appElectrisimnpm installThis will install the required Node.js dependencies including:
nodemailerfor email functionalitycross-envfor environment variable management
npm run deploy:devnpm run deploy:prodThe deployment script will automatically:
- Copy the appropriate route configuration (
_routes.dev.jsonfor dev,_routes.jsonfor prod) - Set up environment-specific settings
For quick testing, you can use any static file server:
# Using Python (if installed)
cd src/main/webapp
python -m http.server 8080
# Using Node.js serve package
npx serve src/main/webapp -p 8080-
Copy the contents of
src/main/webapp/to your Apache document root (e.g.,/var/www/html/orC:\xampp\htdocs\) -
Configure Apache virtual host:
<VirtualHost *:80>
ServerName your-domain.com
DocumentRoot /path/to/webapp
# Enable compression
LoadModule deflate_module modules/mod_deflate.so
<Location />
SetOutputFilter DEFLATE
</Location>
# Set cache headers
<FilesMatch "\.(js|css|png|jpg|gif|ico)$">
ExpiresActive On
ExpiresDefault "access plus 1 month"
</FilesMatch>
</VirtualHost>-
Copy webapp files to Nginx document root
-
Configure Nginx:
server {
listen 80;
server_name your-domain.com;
root /path/to/webapp;
index index.html;
# Enable gzip compression
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
# Cache static assets
location ~* \.(js|css|png|jpg|gif|ico)$ {
expires 1M;
add_header Cache-Control "public, immutable";
}
# Handle SPA routing
location / {
try_files $uri $uri/ /index.html;
}
}For production deployments, configure SSL:
sudo certbot --nginx -d your-domain.comElectrisim requires a backend service for:
- User authentication
- File storage/management
- Simulation calculations
- Real-time collaboration
Ensure your backend is deployed and update the API endpoints in:
src/main/webapp/js/electrisim/config/environment.js- Route configuration files (
_routes.json,_routes.dev.json)
- Navigate to your deployed URL
- Verify the application loads correctly
- Test core functionality:
- Creating new diagrams
- Adding power system components
- Running basic simulations
- Saving/loading files
- Configure Smartlook analytics (already integrated)
- Set up error tracking and logging
- Monitor performance metrics
git pull origin main
npm install # Install any new dependencies
npm run deploy:prod # Rebuild for production
# Copy updated files to web server- Fork and Clone:
git clone <your-fork-url>
cd appElectrisim- Install Development Dependencies:
npm install- Run Development Server:
npm run deploy:dev
cd src/main/webapp
python -m http.server 8000- Development Workflow:
- Main application code is in
src/main/webapp/js/electrisim/ - Modify components and test locally
- Use browser developer tools for debugging
- Submit pull requests for contributions
- Main application code is in
package.json- Node.js dependencies and scripts_routes.dev.json- Development environment routes_routes.json- Production environment routessrc/main/webapp/js/electrisim/config/environment.js- Environment configuration
-
Application won't load:
- Check browser console for JavaScript errors
- Verify all static files are accessible
- Ensure web server configuration is correct
-
Authentication problems:
- Verify backend API endpoints
- Check OAuth configuration
- Ensure HTTPS is configured for production
-
Performance issues:
- Enable gzip compression
- Configure proper caching headers
- Consider using a CDN for static assets
-
Mobile compatibility:
- Current version is optimized for desktop browsers
- Mobile support is under active development
We welcome contributions! Please see our Contributing Guidelines and Code of Conduct.
- UI/UX improvements
- Mobile responsiveness
- New analysis features
- Performance optimizations
- Testing and documentation
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Documentation: GitHub Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Stack Overflow: Use the
electrisimtag
🚧 Active Development Areas:
- Extended simulation capabilities by introducing other open-source projects (currently focused on pandapower and OpenDSS)
- Advanced visualization features
- Improving performance optimization
- Integrating AI
Electrisim - Empowering electrical engineers with modern, accessible power system analysis tools.
For backend repository and API documentation, visit: Backend Repository