LV Design Studio
An open-source, offline-first workspace for single-line diagrams, load schedules, electrical calculations, drawings and reports. Projects remain under the engineer’s control as local files.
Try the browser app
· About the project
· Download an unsigned beta
· Calculation methods and limits
· Privacy and project data
Version 2.356 (see package.json). The app is in active use and active development.
Engineering status. The calculations are first-pass design checks, not a substitute for an engineer’s verified study. Built-in cable values are approximate references until replaced with manufacturer data, and some study methods are intentionally simplified. Nothing in the app constitutes approval by an electrical authority. Methods, assumptions and limits are in docs/engineering/calculation-methods.md.
Screenshots
The built-in demonstration project shows the same project model across the design stages, calculations, drawings and deliverables.
Overview and design stages: Each stage’s checklist, its stage gate and the key project figures.

Single line diagram: IEC and DEWA symbols, the panel tree and board properties.

Load schedule: The DEWA connected-load and maximum-demand schedule for the selected board.

Transformer and generator sizing: Transformer fault level and regulation, plus generator sizing with motor starting.

Power factor correction: Central, group or individual correction with staged and detuned banks.

Earthing: Earthing results filtered by the selected panel and its downstream boards.

Study reports: Select boards and studies, then prepare PDF or Excel engineering deliverables.

Cable tray schedule: Route paths, tray sizing, grouping derating, cross-sections and quantities.

Quick calculators: Fast checks for current, power, cable sizing, voltage drop, transformers and more.

Projects dashboard: Recent local projects, status, search and duplication.

Setup
Requires Node.js 20.19+ or 22.12+ (CI uses Node 24).
npm ci
npm run dev
This opens the app in an Electron window (with the Vite dev server on
http://127.0.0.1:5173). Click Explore sample for a worked 415 V villa
complex, or start a new project.
The development window trusts only that exact address (set LVDS_DEV_URL
to another loopback port if you need one). Development builds load the app
from the dev server: never distribute them; ship the packaged app.
Saving projects to Google Drive
On first run the app creates ~/LV Design Studio Projects. Click the
Folder button on the ribbon’s Project tab and point it at a folder
inside your Google Drive desktop-sync folder (e.g.
~/Google Drive/My Drive/LV Projects). Every “Save” writes a .lvds
project file there (JSON text inside; older .json projects still open and are saved as .lvds), which Drive then syncs automatically — no login or API needed
inside the app itself.
Building an installer
npm run dist
Produces a .dmg (mac), .exe installer (Windows), or .AppImage (Linux)
in release/, depending on the platform you build on. npm run dist:mac
builds an Apple-silicon .dmg only.
Unsigned beta releases
Maintainers deliberately start the beta workflow from GitHub Actions when a
test-worthy group of changes is ready. The workflow requires confirmation,
verifies that the exact main commit passed push-triggered CI, and skips native
builds if that source commit already has a beta. It then builds unsigned Windows
x64 and Apple-silicon macOS installers and publishes them as a uniquely versioned
GitHub prerelease. Installers remain GitHub Release assets; they are not committed
to this repository or Pages.
Packaged beta apps can notify the tester about a newer beta and open the
hard-coded project download page after confirmation. They never download,
execute, replace or install an update. Development and stable builds do not
perform the check. See Unsigned beta releases for the
workflow, checksums, platform warnings, security boundaries and rollback steps.
Publishing the browser app
The browser version is an installable PWA and can be hosted as a static site
without a backend. The GitHub Pages workflow in .github/workflows/pages.yml
builds and publishes dist whenever main is updated; it can also be run
manually from the repository’s Actions tab. In Settings → Pages, set the
source to GitHub Actions before the first deployment.
Open the published URL once while online, then use the browser’s Install
app or Add to Home Screen command. After offline preparation finishes,
the installed app can start without a network connection.
Browser installations are independent: projects and personal libraries stay
in that browser profile and are not synchronized to Google Drive or another
device. Download project .lvds backups regularly. Clearing the site’s data
or deleting the browser profile removes locally stored projects.
The same workflow also publishes an architecture page at <site>/architecture/,
an About page generated from docs/public-site/product.json, and a beta download
page whose installer metadata is resolved from GitHub Releases at build time.
The README’s marked public section is generated from the same reviewed content;
npm run check:public-site catches drift. The site copies the existing
docs/screenshots files rather than maintaining a second set.
The architecture page
(for this repository, https://pdhruv15.github.io/LV-Design-Studio/architecture/). It shows every
module, its main files and how the modules pass data to each other. The page and its Markdown
sources are in docs/architecture/; open
docs/architecture/navigator.html in a browser to use it offline.
Checks and tests
npm run typecheck # TypeScript
npm run lint # ESLint, no warnings allowed
npm test # unit tests (Vitest), src/**/*.test.ts
npm run build # production build
npm run test:pdf # reports printed through Electron's Chromium (needs Electron's binary); pages compared with tests/pdf/baselines; lvds PDF and DXF exports (needs npm run build)
npm run test:pdf:update # new layout baselines, after an intended layout change
npm run bench # calculation performance on large networks
npm run check:privacy # personal paths and e-mail addresses in tracked files (docs/privacy.md)
The unit tests include hand-calculated reference cases for voltage drop,
short circuit, earth fault loop, maximum demand, power factor correction and
transformer sizing (src/calc/referenceCalcs.test.ts). The expected values are
worked out by hand in the test comments, not produced by the code. They check
that the code follows its documented method; they do not certify the method
against a standard. CI (.github/workflows/ci.yml) runs all of the above plus a
dependency audit of the shipped packages, the privacy check and a secret scan
(gitleaks) of the whole history.
Database (Excel, synced by Google Drive)
Reusable data lives in Excel workbooks in the LV Database folder inside
your projects folder, so Google Drive syncs it across PCs and to anyone
sharing the folder:
| Workbook |
Contents |
Starts with |
Loads.xlsx |
Your equipment: name, category, schedule column, power (W), PF, phases, demand factor, starting, manufacturer/model |
Empty — user input only |
Cables.xlsx |
Size, R at 20 °C, X, current rating, rate per m, manufacturer, cable type, installation method, reference document — used by every calculation |
The app’s reference values, to replace with manufacturer data |
Breakers.xlsx |
Ratings the sizing may choose, Icu, price |
Standard ratings |
Parameters.xlsx |
Design defaults for new projects (VD limit, ambient, min wires, ELCB mA, …) |
Parameter names, blank values |
The app creates any missing workbook (never overwrites one) and watches the
folder: save a workbook in Excel and the app updates within a second or two.
Library items can be picked for a load schedule’s WATT/UNIT column or in the
feeder form; columns linked to a library item follow it when it changes.
Problems (bad rows, missing columns) are listed on the Database screen.
A cable row counts as manufacturer data only when it names a
Manufacturer and a Reference document. Reports name every cable size that
still uses reference values, user-entered values without a source, or a
reference value because the size is missing from Cables.xlsx. For a final
design, tick Project settings → Final design: require manufacturer cable
data: those sizes then become failures in the To do list.
Calculation engines
The built-in TypeScript engine (src/calc/) drives the live UI. Two external
engines can be run on demand from Simulate → Load flow, which
shows their results next to the built-in engine’s for every feeder:
| Engine |
What it adds |
| OpenDSS (via OpenDSSDirect.py) |
Full load flow, including unbalance from single-phase loads; fault study |
| pandapower |
Newton-Raphson load flow; IEC 60909 maximum short circuit (cmax = 1.10, transformer KT correction) |
Both run in a small Python helper (engines/python/lvds_engine.py) that the
Electron main process starts on demand. Setup:
pip install -r engines/python/requirements.txt
That installs the tested versions. The comparison screen notes when a different
version is installed, because the engines are checked against those versions.
The app uses python on Windows and python3 elsewhere; pick a different
interpreter with Choose Python… on the comparison screen. The external
engines are optional and need a separate Python setup; treat them as a
cross-check of the built-in engine.
How the engines are checked: tests/engines/ runs both engines on fixed
reference networks (one transformer, a three-level tree, PV generation,
single-phase circuits, two transformers, a 31-board building). Every result
must match the golden files in tests/engines/golden/. The simplest network is
also checked against hand calculation (transformer fault level with c = 1 and
the IEC 60909 cmax/KT correction), and the two engines must agree on balanced
load flow. CI installs the pinned versions and fails if the engines are missing.
After an intended change, regenerate the golden files and review the diff:
UPDATE_GOLDEN=1 npx vitest run tests/engines
When a study cannot run, the engines say why in the engineer’s terms: missing
transformer data, a loop of upstream boards, a zero cable length, an engine that
is not installed (with the install command), or a load flow that does not
converge, together with the overloaded transformer or cable that is the likely
cause. OpenDSS never fails to converge, because it treats loads below 95 %
voltage as constant impedance. When that happens it is flagged instead of shown
as if the figures were at full power.
OpenDSS script export: Export OpenDSS (.dss) (ribbon More menu) writes the
network as a self-contained OpenDSS script (load flow + fault study) that
you can open in OpenDSS itself. The modelling assumptions are listed in the
header of the exported file.
Command line, MCP server and local API
lvds uses the app’s own calculations without opening the app. It works on
projects in the app’s projects folder. Reading and checking never changes a
file; changing a project is described below.
npm run build:cli
node dist-cli/lvds.mjs help
node dist-cli/lvds.mjs check "My project" # to-do list; exit code 1 if anything fails
node dist-cli/lvds.mjs panel "My project" SMDB-GF
node dist-cli/lvds.mjs cable --current 120 --length 80 --ambient 45
Add --json for scripts, --folder <path> for another projects folder.
In the installed app. The installer carries the same lvds. The app itself
runs it, so no window opens and no Node is needed:
| System |
Command |
| macOS |
"/Applications/LV Design Studio.app/Contents/Resources/lvds/lvds" help |
| Windows |
"%LOCALAPPDATA%\Programs\LV Design Studio\resources\lvds\lvds.cmd" help |
On Windows the path starts at the folder you installed to, if you chose
another one. The Linux AppImage holds the files too, but not at a fixed path:
use the source folder there.
MCP (bring your own AI). lvds mcp runs an MCP server on this computer.
Your own AI program (any MCP client, or a free local model through one) can
then list projects, read panels and results, run the checks and use the quick
calculations. The app has no AI of its own: it makes no AI calls, holds no
account or key, and needs no paid service. To connect, print the settings of
this copy and paste them into the MCP settings of your AI program (lvds is
the command from the table above, or node dist-cli/lvds.mjs in the source
folder):
lvds mcp-config
It prints the mcpServers entry most MCP clients take, with the paths filled
in. From the installed app that is the app itself run as Node:
{"mcpServers": {"lv-design-studio": {"command": "<the app>", "args": ["<its resources>/lvds/lvds.mjs", "mcp"], "env": {"ELECTRON_RUN_AS_NODE": "1"}}}}.
From the source folder it is
{"command": "node", "args": ["/path/to/LV-Design-Studio/dist-cli/lvds.mjs", "mcp"]}.
Through MCP and the API, only files inside the projects folder can be opened.
Local API. lvds serve (default port 8765) answers on http://127.0.0.1
only: GET /api/tools lists the tools and their inputs, GET /api/tools/run_checks?project=My%20project or POST with a JSON body runs
one. Every request needs Authorization: Bearer <token>. The token is new
each time the server starts; it is written to a file only you can read (the
server names the file when it starts, api-token in the app’s data folder)
and removed when it stops. It is never printed or put in a URL. To use a fixed
token in your own scripts, set LVDS_API_TOKEN (32 characters or more) before
starting the server. Requests from web pages (an Origin header) are refused,
and no CORS headers are sent. lvds help serve shows an example:
curl -H "Authorization: Bearer $(cat "<token file>")" "http://127.0.0.1:8765/api/tools/run_checks?project=My%20project"
From Python: requests.get(url, headers={"Authorization": f"Bearer {open(token_file).read().strip()}"}).
Errors name the projects folder as <projects folder>, not its full path.
Changing a project. lvds mcp --write and lvds serve --write also offer
tools that change a project (on the command line they are always there). They
show a preview unless called with mode apply / propose (--apply /
--propose on the command line):
- Value changes are only proposed.
size_circuits (the app’s own cable and
breaker selection) and propose_changes add a modification record (MOD-00x)
to Reports → Changes. The engineer accepts it with their name and applies
it in the app, as one undo step. The tools never accept anything and never
change the values themselves.
- Given upstream values are input data.
set_supply writes the values given
from upstream for a first panel (fault level, drop already used, Ze, the
upstream device, the incoming cable) to the file after the preview, as
add_panel does; it is not a sizing result. undo_change puts the previous
values back.
- Structure changes (
add_panel, add_circuit, move_panel,
rename_panels, copy_panel) change the file after the preview. New panels
and circuits are sized by the app’s selection. add_building and add_level
add to Building information, so a rooms package can be accepted into a
project that does not have its building yet.
- Every change keeps the previous version in
.lvds-agent/ in the projects
folder and is logged (list_changes); undo_change puts it back.
delete_panel and delete_circuit use the app’s own delete. To apply, they
need approvedBy (the engineer’s name), and undo_change puts it back.
- Nothing is written while the project has unsaved changes open in the app, or
over a file that changed in the meantime.
Floor plans (DWG / DXF). cad_plan reads a floor plan with the built-in
reader (acadrust, DWG R13–2018 and DXF; no CAD program needed): its units, each
layer with what it holds and its role, and the rooms it gives. rooms_from_cad
takes those rooms into Building information on one level (areas measured,
names from room tags or texts, room types guessed), as Rooms and areas from CAD
floor plan does; the Load assessment area schedule is built from those rooms.
--roles overrides a layer’s role. Preview first, then --apply.
Exports. list_exports shows what a project can export. export_report
makes any document of the app’s Export centre as HTML (open it in a browser and
print to PDF), or with format pdf as the PDF the app makes. export_forms_xlsx
and export_boq_xlsx make the Excel workbooks. export_dxf makes the earthing
schematic, or with drawing sld the sheets of Reports → Drawings (SLD, DB
circuit, riser and earthing sheets, the same files as its DXF export;
--sheets / --types choose some). Each one first shows a
preview: the files it would make, failing checks and proposals still waiting.
Exporting needs approvedBy (the engineer’s name). It is refused while checks
fail or proposals wait, unless the engineer sets exportAnyway. Files go to
Exports/<project>/<date>/ in the projects folder, never over an existing
file, and every export is logged in .lvds-agent/exports.jsonl.
PDFs and the drawing sheets are made by the app itself, in Electron with no
window (electron/headlessExport.cjs), only after the export is approved. lvds
uses Electron from the app’s source folder (npm install and npm run build
first), else an installed app that has this export. Without either, reports are
made as HTML and the earthing schematic is the only DXF.
node dist-cli/lvds.mjs size "My project" # preview the sizing proposal
node dist-cli/lvds.mjs size "My project" --propose # add it to Reports → Changes
node dist-cli/lvds.mjs add-panel "My project" --kind SMDB --id SMDB-L3 --fedFrom MDB-1 --lengthM 45 --apply
node dist-cli/lvds.mjs add-building "My project" --name "Tower A" --apply
node dist-cli/lvds.mjs add-level "My project" --building "Tower A" --name "L1–L10" --kind typical --count 10 --apply
node dist-cli/lvds.mjs rooms-from-cad "My project" --drawing "GF plan.dwg" --building "Tower A" --level Ground --apply
node dist-cli/lvds.mjs undo "My project" --apply
node dist-cli/lvds.mjs forms-xlsx "My project" --export --approvedBy "A. Engineer"
node dist-cli/lvds.mjs schedule-xlsx "My project" --template "Company schedule.xlsx" --export --approvedBy "A. Engineer" # your own Excel template, see docs/excel-load-schedule-template.md
node dist-cli/lvds.mjs dxf "My project" --drawing sld --export --approvedBy "A. Engineer"
node dist-cli/lvds.mjs report "My project" --report calc-report --format pdf --export --approvedBy "A. Engineer"
What it does
- Design: boards and circuits in a multi-level hierarchy, load schedules
(DEWA connected load / maximum demand form), building and room data,
feeder presets and an Excel-based equipment library.
- Calculations (
src/calc/, run on every change or with F5): design
current, derated cable rating (ambient and grouping), voltage drop per
circuit and cumulative from the source, overload protection Ib ≤ In ≤ Iz,
fault levels at each busbar and cable end, earth fault loop and
disconnection time, protective conductor adiabatic check, selectivity,
transformer and generator sizing, power factor correction, busbar risers,
UPS and solar PV.
- Checks: a To do list on the dashboard with everything that fails or
needs checking, including invalid inputs (for example a zero breaker rating
or a power factor of 0), supply loops, inputs outside a method’s range and
unverified cable data. Project readiness stages track setup, design,
calculation, issues, drawings and issue.
- Drawings and documents: single line diagram, board sheets, earthing
and riser drawings, an earthing riser for any number of floors (every
level over several sheets, or typical floors grouped on one) with a
floor earthing sheet per floor, DB / cable / equipment schedules, BOQ, study reports
(PDF and Word), calculation report, Excel exports, revisions and
transmittals.
- Projects: JSON files with backup (
.bak), recovery copies of unsaved
work, trash (30 days), conflict detection for synced folders, and a file
version with migration of older files. A file without the structure the app
needs is refused when opened, with a message saying why.
Limitations
- Cable data: the built-in values (Cu/XLPE/SWA multicore, free air,
30 °C) are approximate. Each circuit has an IEC 60364-5-52 installation
method (E free air / tray unless set; C, B1, B2, A1, A2, D1, D2). Ratings for
methods other than E come from the
Rating A1 … D2 columns of Cables.xlsx;
the built-in reference has none yet, so a circuit on such a method shows
DATA REQUIRED until its rating is entered. Grouping with other circuits is
counted only on cable tray routes; otherwise a circuit’s own parallel runs.
- Ambient temperature: the derating table covers 25–70 °C. Above 70 °C the
result is flagged as a failure, below 25 °C as a warning.
- Short circuit: maximum currents use c max = 1.05 (LV systems with a
+6 % tolerance; IEC 60909-0 gives 1.10 for +10 %) and cable R at 20 °C. The
MV network is treated as infinite, the transformer correction factor KT is
not applied and motor contribution is ignored. Use the pandapower comparison
or a full study for final breaking-capacity checks.
- Voltage drop: first-order formulas summed along the radial path; the
incomer to a sub-board uses per-phase P and Q but is not an unbalanced load
flow.
- Selectivity is current-based only; confirm with the breaker
manufacturer’s selectivity tables. Breaker curves are generic.
- Web version (browser, no Electron): projects stay in the browser; the
Excel database, full PDF printing and the external engines need the desktop
app.
Privacy
Projects are plain JSON files in your projects folder (or this browser’s
storage in the web version). The app does not encrypt them: use your
operating system’s disk encryption, and remember that cloud-synced folders and
backups keep their own copies. To share a project for a bug report, use
Project → Share sample: an anonymized copy without the client, site or
people, with the same calculation results. See docs/privacy.md
for what is kept, a checklist before sharing, and the rules for contributors.
Licence
LV Design Studio is open source, dual-licensed under the MIT License or the Apache License 2.0, at your option. You may use, copy, change, distribute, sublicense and sell it, including in commercial and closed-source products — just keep the copyright and licence notice. The Apache 2.0 option also gives an explicit patent licence. See NOTICE.md.
Unless you state otherwise, any contribution you submit for inclusion is dual-licensed as above, without any additional terms.
评论