Electrisim Frontend
About
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
- Discrete controllers in load flow
- Time Series Simulation
🌐 Live Application: app.electrisim.com
Note: Optimized for desktop web browsers on a laptop or computer. Phone and tablet visitors see a notice that recommends a desktop browser and lets them send the link to their computer (
js/electrisim/mobileNotice.js; add?mobileNotice=1to the URL to see it on a desktop).
Features
- 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
Technology Stack
- 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
Prerequisites
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)
Step-by-Step Deployment Guide
1. Clone the Repository
git clone <repository-url>
cd appElectrisim2. Install Dependencies
npm installThis will install the required Node.js dependencies including:
terserfor JavaScript minification
3. Environment Configuration
For Development Environment:
npm run deploy:devFor Production Environment:
npm run deploy:prodThe deployment script will automatically:
- Copy the appropriate route configuration (
_routes.dev.jsonfor dev,_routes.jsonfor prod) - Set up environment-specific settings
4. Web Server Setup
Option A: Simple Local Development Server
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 8080Option B: Apache Web Server
-
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>Option C: Nginx Web Server
-
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;
}
}5. SSL/HTTPS Configuration (Production)
For production deployments, configure SSL:
Using Certbot (Let's Encrypt):
sudo certbot --nginx -d your-domain.comOr configure SSL manually in your web server configuration.
6. Backend Integration
Electrisim 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)
7. Testing the Deployment
- 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
8. Monitoring and Maintenance
Enable Application Monitoring:
- Session recording is not used (Smartlook was removed in Nov 2026)
- Set up error tracking and logging
- Monitor performance metrics
Regular Updates:
git pull origin main
npm install # Install any new dependencies
npm run deploy:prod # Rebuild for production
# Copy updated files to web serverDevelopment Setup
For Contributors and Developers:
- 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
Configuration Files
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
Troubleshooting
Common Issues:
-
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
Contributing
We welcome contributions! Please see our Contributing Guidelines and Code of Conduct.
Development Areas:
- UI/UX improvements
- Mobile responsiveness
- New analysis features
- Performance optimizations
- Testing and documentation
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Support
- Documentation: GitHub Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Stack Overflow: Use the
electrisimtag
Roadmap
🚧 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