Avneesh.
08Structural Engineering Automation← All projects
LiveStructural Engineering Automation

OptiPEB

A STAAD.Pro automation suite: a FastAPI + Next.js desktop app packaged into one Windows .exe that talks to STAAD via OpenSTAAD, backed by a cloud License Controller for machine activation and auto-updates.

Role
Full Stack Engineer
Type
Desktop App + Licensing Cloud
Year
2026
Timeline
Ongoing
OptiPEB
3
Repositories (App · Frontend · Controller)
1 .exe
Self-contained Windows Build
COM
OpenSTAAD Live Model Automation
MAC
Per-Machine Licensing
SHA-256
Verified Auto-Update

Overview

OptiPEB is a three-repository system that automates structural-engineering tasks on top of Bentley STAAD.Pro. The desktop app pairs a FastAPI backend — which drives a live STAAD model through the OpenSTAAD COM API (pywin32 / comtypes) and runs analysis with PyNiteFEA / OpenSeesPy — with a Next.js dashboard, then packages both into a single self-contained Windows .exe using Nuitka + pywebview so it opens in a native window with no browser and no separate server. The third repo, the OptiPEB Controller, is a FastAPI + PostgreSQL cloud service (live at optipeb.miatibro.art) that gates the app by machine MAC address, tracks activity, and serves versioned releases. On launch the compiled exe checks the Controller for a newer build, downloads it, verifies its SHA-256, and hot-swaps itself — a fail-safe silent auto-update.

Problem

Structural engineers extract beam data, base reactions, and design values from STAAD.Pro largely by hand — reading them off the GUI and re-keying them into spreadsheets and CAD, model after model. There was no tool that reads a live STAAD model programmatically, computes designs (anchor bolts, reactions envelopes) and DXF drawings automatically, and ships to non-technical engineers as an installable app that stays licensed and up to date.

Approach

Automates STAAD.Pro structural workflows — beam data, reactions, anchor-bolt design, and DXF drawings — inside a single native Windows app, with a cloud controller that licenses each machine and pushes silent, checksummed auto-updates.

Key features

Live STAAD.Pro Automation

A FastAPI backend drives an open STAAD model through the OpenSTAAD COM API (pywin32 / comtypes), exposing beam data, section properties, geometry, and analysis status as clean REST endpoints.

Reactions & Anchor-Bolt Design

Computes base-reaction envelopes across load combinations and runs pinned- and fixed-base anchor-bolt design checks, then generates anchor-bolt and grid DXF drawings via ezdxf.

Single-Exe Desktop Packaging

Nuitka bundles the FastAPI backend and the exported Next.js frontend into one self-contained Windows .exe that serves both on a single port and opens in a native pywebview window — no browser, no separate server.

Cloud License Controller

A FastAPI + PostgreSQL service (optipeb.miatibro.art) activates each machine by MAC address, tracks activity, and maintains a releases snapshot — with admin-only machine registration.

Silent Checksummed Auto-Update

On launch the exe asks the Controller for a newer release, downloads it, verifies its SHA-256, and hot-swaps itself via a batch helper — aborting fail-safe to the current version on any mismatch or timeout.

In-App Activation Gate

The window always opens; a frontend AuthGate checks /machine/license and shows an activation screen (MAC + copy button + retry) for unregistered machines instead of the dashboard.

Next.js Dashboard

A module-grid dashboard (React 19 / Next.js 16 / Tailwind v4) scans for an open STAAD model and renders live modules like BEAM DATA in SI units, reaching the API through a same-origin proxy.

Engineering challenges

01

Driving STAAD.Pro through the OpenSTAAD COM API reliably — classifying COM/instance errors (no model open, multiple models, file not found) into clean JSON responses instead of raw crashes, and letting the caller pick among several open models.

02

Packaging a FastAPI backend + a Next.js (output: export) frontend into one Windows .exe with Nuitka — the same process serves the API and mounts the built frontend, opening in a native pywebview window.

03

Fixing Nuitka's pywebview plugin (it omits webview.platforms.win32) so the compiled exe actually shows a window instead of silently exiting, and redirecting stdout/stderr in the no-console build so uvicorn doesn't crash on isatty().

04

In-app licensing rather than launch-time — the window always opens and an AuthGate calls the Controller's /machine/license; unregistered machines see an activation screen with their MAC to send to an admin.

05

Silent, fail-safe auto-update — the exe checks the Controller, downloads a new build, verifies its SHA-256 against the release checksum, and only then swaps itself; any mismatch or unreachable Controller falls back to the running version.

06

Computing engineering deliverables from raw model data — base-reaction envelopes across load combinations, pinned/fixed anchor-bolt design checks, and generated anchor-bolt and grid DXF drawings via ezdxf.

Key decisions

Three repos with clear seams — OptiPEB (desktop backend), opti_peb_frontend (Next.js UI bundled into the exe), and optiPEB_Controller (cloud licensing + updates) — so the client ships offline-capable while licensing stays server-controlled.

OpenSTAAD COM automation over file parsing — reads the live, in-memory model the engineer already has open, so results always match what's on screen.

Nuitka --onefile + pywebview over Electron — a single native Windows exe with a small footprint that serves its own API and frontend on one port, no browser dependency.

Machine-MAC licensing enforced inside the app (AuthGate), not at launch — the app always opens, degrades to an activation screen when unlicensed, and admins register machines Controller-side.

Checksum-verified silent auto-update with a batch-helper hot-swap — clients stay current without an installer round-trip, and a SHA-256 mismatch aborts the update fail-safe.

A same-origin Next.js proxy to the OptiPEB API — the browser never calls STAAD's API directly, keeping the service URL configurable and sidestepping CORS in dev.

Built with

PythonFastAPIOpenSTAAD (COM)pywin32comtypesPyNiteFEAOpenSeesPyezdxfopenpyxlNuitkapywebviewNext.js 16React 19TypeScriptTailwindCSS v4PostgreSQLasyncpgAWS
OptiPEBView live