🧠 Why Convert Your Angular Web App?
Angular is powerful for building web apps. But what if you want your users to:
Install your app like a desktop program
Use it offline
Access it via the Start menu
Integrate better with native OS features?
You don’t have to rewrite it from scratch. Just wrap it using Electron, and you’ll have a .exe installer in no time.
🧰 What You’ll Need
Before starting, make sure you have:
A working Angular app (ng build works fine)
Node.js & npm installed
Electron (for packaging)
Electron Builder (for creating .exe)
Optionally: AppSignal for monitoring (covered below)
🧱 Step-by-Step: Angular → Electron → Windows App
✅ 1. Build Your Angular App
ng build --prod
This outputs your app to the dist/your-app-name folder.
📂 2. Create the Electron Project
Create a new folder:
mkdir angular-desktop
cd angular-desktop
npm init -y
npm install electron --save-dev
Create a file named main.js (your app's entry point):
const { app, BrowserWindow } = require('electron');
const path = require('path');
function createWindow () {
const win = new BrowserWindow({
width: 1200,
height: 800,
webPreferences: {
nodeIntegration: true
}
});
win.loadFile(path.join(__dirname, 'dist/your-app-name/index.html'));
}
app.whenReady().then(createWindow);
🧭 3. Copy Angular Build Into Your Electron Folder
Copy the entire dist/your-app-name into this folder. Your structure should look like:
angular-desktop/
├── main.js
├── package.json
├── /dist/
│ └── /your-app-name/
│ └── index.html
⚙️ 4. Update package.json
Update your package.json with the following:
{
"name": "angular-desktop",
"version": "1.0.0",
"main": "main.js",
"scripts": {
"start": "electron .",
"pack": "electron-builder --dir",
"dist": "electron-builder"
},
"build": {
"appId": "com.yourcompany.angularapp",
"productName": "Angular Desktop App",
"files": [
"dist/**/*",
"main.js"
],
"win": {
"target": "nsis"
}
},
"devDependencies": {
"electron": "^30.0.0",
"electron-builder": "^24.0.0"
}
}
🚀 5. Build the Windows App
Install Electron Builder:
npm install electron-builder --save-dev
Then run:
npm run dist
This generates an installer (.exe) in the dist/ folder.
🧩 Optional: Add AppSignal Monitoring
AppSignal helps you monitor:
Errors
Crashes
Performance metrics
Here’s how to set it up in Electron:
Step 1: Install AppSignal for Node
npm install @appsignal/javascript --save
Step 2: Initialize AppSignal in your main.js
const { Appsignal } = require("@appsignal/javascript");
const appsignal = new Appsignal({
key: "YOUR_APPSIGNAL_API_KEY"
});
// Example error tracking
process.on('uncaughtException', (err) => {
appsignal.sendError(err);
});
AppSignal also offers browser-side monitoring for Angular via its frontend SDK — for full-stack observability.
🎯 Final Outcome
You now have:
✅ A native Windows .exe app from your Angular project
✅ Offline access
✅ Auto-installation capabilities
✅ Monitoring via AppSignal
📦 Distribute Your App
You can now distribute your .exe via:
USB
Website
Microsoft Store (with further packaging)
🌟 Bonus Tips
Use a custom icon by adding an .ico in the Electron Builder config
Auto-update support via GitHub releases
Code-signing can be added for security and trusted installs
🙌 Summary
Step Description
1️⃣ Build your Angular app
2️⃣ Create an Electron wrapper
3️⃣ Add build configs
4️⃣ Run npm run dist
✅ Done! You have a Windows app
Add AppSignal for deep observability and performance monitoring — and now you’re not just shipping software, you’re shipping quality.
This is a game changer for devs who want to ship desktop apps without rewriting their Angular projects!