Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Normalize line endings: LF in the repo, auto-converted on checkout.
* text=auto eol=lf

# Binary assets never touch these.
# Binary assets - never touch these.
*.png binary
*.jpg binary
*.ico binary
Expand Down
30 changes: 15 additions & 15 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to NetGraph

NetGraph is a vanilla-TypeScript single-page app no framework. It's built with
NetGraph is a vanilla-TypeScript single-page app - no framework. It's built with
[Vite](https://vitejs.dev/), styled with SCSS, and stores everything in the
browser's `localStorage`; there's no backend. State lives in module-scope
variables and the DOM is the renderer.
Expand All @@ -13,7 +13,7 @@ see [README.md](../README.md). For the full architecture and conventions, see

- [Node.js](https://nodejs.org/) 24 or newer (current LTS).

Node is only needed to **build or develop** NetGraph not to run a built copy.
Node is only needed to **build or develop** NetGraph - not to run a built copy.
The output is plain static files (and a single self-contained HTML file) that
run in any modern browser.

Expand All @@ -33,30 +33,30 @@ npm run dev # Vite dev server at http://localhost:5173 with hot reload
```

> If you commit a change that deletes or renames a module, restart `npm run dev`
> Vite's HMR can't always reconcile a moved module graph and the page may go
> - Vite's HMR can't always reconcile a moved module graph and the page may go
> blank until a fresh start. It's not a code bug; `tsc` and the tests stay green.

## Building

```sh
npm run build # type-check, then build BOTH outputs
npm run build:web # multi-file build only dist/
npm run build:single # single-file build only dist/download/netgraph.html
npm run build:web # multi-file build only -> dist/
npm run build:single # single-file build only -> dist/download/netgraph.html
npm run preview # serve the production build locally
```

There are two build outputs:

- A **multi-file build** for hosting on a webserver (split JS/CSS for caching).
- A **single self-contained `netgraph.html`** with JS, CSS, and the favicon all
inlined one file to move around, run from disk, or put on a USB stick.
inlined - one file to move around, run from disk, or put on a USB stick.

```
dist/
── index.html multi-file build (serve this from a webserver)
── assets/ JS, CSS, favicon
── download/
── netgraph.html single-file standalone build
-- index.html <- multi-file build (serve this from a webserver)
-- assets/ <- JS, CSS, favicon
-- download/
-- netgraph.html <- single-file standalone build
```

## Tests & quality bar
Expand All @@ -68,7 +68,7 @@ npx tsc --noEmit # type-check
```

The bar for any change is a **clean `npx tsc --noEmit`** and **passing
`npm test`**. There's no separate linter `tsconfig.json` runs with `strict`,
`npm test`**. There's no separate linter - `tsconfig.json` runs with `strict`,
`noUnusedLocals`, `noUnusedParameters`, and `noFallthroughCasesInSwitch`, so the
compiler is the linter.

Expand All @@ -81,18 +81,18 @@ than unit-tested.

## Project layout

Single entry point at `src/ts/main.ts`. The detailed map state flow, the
Single entry point at `src/ts/main.ts`. The detailed map - state flow, the
render pipeline, connection routing, and the data-validation / SVG-sanitizer
security model lives in [docs/ARCHITECTURE.md](../docs/ARCHITECTURE.md). Start there before changing
security model - lives in [docs/ARCHITECTURE.md](../docs/ARCHITECTURE.md). Start there before changing
routing, persistence, or anything that ingests untrusted data (imports, custom
icons).

## Branches & pull requests

The repo has two long-lived branches:

- `main` stable releases
- `develop` active development
- `main` - stable releases
- `develop` - active development

Create your own branch for your work, then open a pull request into `develop`
(or `main` for an urgent fix). Before you open it:
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ body:
attributes:
value: |
Thanks for taking the time to file a bug. Please don't report security
issues here see the [security policy](../blob/main/.github/SECURITY.md)
issues here - see the [security policy](../blob/main/.github/SECURITY.md)
for private reporting.

NetGraph stores everything in your browser's `localStorage`. If the app
won't load at all, a corrupt saved state is a common cause exporting a
bundle (map dropdown Export) before you try anything destructive is a
won't load at all, a corrupt saved state is a common cause - exporting a
bundle (map dropdown -> Export) before you try anything destructive is a
good idea.
- type: textarea
id: what-happened
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body:
- type: markdown
attributes:
value: |
NetGraph aims to stay a small, local-first, browser-only network mapper
NetGraph aims to stay a small, local-first, browser-only network mapper -
no backend, no accounts, no telemetry, all data in `localStorage`. It's
built for an enthusiast mapping a home or lab network, not a sysadmin
managing a fleet. Proposals that fit that shape are easiest to land.
Expand Down Expand Up @@ -36,6 +36,6 @@ body:
attributes:
label: Scope check
options:
- label: This keeps NetGraph local-first no backend, accounts, or telemetry.
- label: This keeps NetGraph local-first - no backend, accounts, or telemetry.
- label: I searched existing issues and this isn't already requested.
required: true
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Thanks for contributing to NetGraph! Please keep PRs focused one change per PR.
Thanks for contributing to NetGraph! Please keep PRs focused - one change per PR.
See .github/CONTRIBUTING.md for the ground rules. PRs target `develop`.
-->

Expand All @@ -19,7 +19,7 @@ See .github/CONTRIBUTING.md for the ground rules. PRs target `develop`.
- [ ] One focused change, with a short description of the why (above).
- [ ] Targets the `develop` branch (or `main` for an urgent fix).
- [ ] Type-check is clean: `npx tsc --noEmit`.
- [ ] Tests pass: `npm test` and new behavior is covered by a test where practical.
- [ ] Tests pass: `npm test` - and new behavior is covered by a test where practical.
- [ ] Both builds succeed: `npm run build`.
- [ ] Added a note under `## [Unreleased]` in `CHANGELOG.md`.
- [ ] If behavior changed, kept the docs in sync: `README.md`, `docs/ARCHITECTURE.md`, and any in-app help.
Expand Down
12 changes: 6 additions & 6 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Security Policy

NetGraph runs entirely in the browser with no backend, and it ingests untrusted
data in two places imported `.json` bundles and uploaded custom icons (including
data in two places - imported `.json` bundles and uploaded custom icons (including
SVG). That ingest surface is where NetGraph's own correctness has security weight,
so reports are taken seriously.

Expand All @@ -21,7 +21,7 @@ ship in the next tagged release.

Report privately via either:

- GitHub's [private vulnerability reporting][advisories] the **"Report a
- GitHub's [private vulnerability reporting][advisories] - the **"Report a
vulnerability"** button under the repository's *Security* tab (preferred), or
- email to **braininblack@gmail.com** with `[NetGraph security]` in the subject.

Expand All @@ -31,7 +31,7 @@ Please include:
self-hosted, or offline single-file copy),
- your browser and OS,
- a description of the issue and its impact, and
- a minimal reproduction or proof of concept if you have one for ingest bugs,
- a minimal reproduction or proof of concept if you have one - for ingest bugs,
the smallest import bundle or SVG icon that triggers it.

You can expect an acknowledgement within **5 business days**. Once the issue is
Expand All @@ -40,11 +40,11 @@ credit you in the release notes unless you prefer to stay anonymous.

## Scope

In scope vulnerabilities **in NetGraph itself**, for example:
In scope - vulnerabilities **in NetGraph itself**, for example:

- stored or reflected XSS through imported bundles, custom icons, or any
user-controlled field that reaches the DOM (device names, tags, notes, ids),
- a way to get markup or script past the SVG sanitizer (`svg-sanitizer.ts`)
- a way to get markup or script past the SVG sanitizer (`svg-sanitizer.ts`) -
including mutation-XSS that only becomes live after HTML re-parsing,
- attribute-injection through ids or other values interpolated into `data-*`
attributes,
Expand All @@ -53,7 +53,7 @@ In scope — vulnerabilities **in NetGraph itself**, for example:

Out of scope:

- a malicious bundle that only damages **your own** local data importing
- a malicious bundle that only damages **your own** local data - importing
replaces your maps by design; export a backup first,
- weaknesses in the browser, the operating system, or a hosting webserver you
run yourself,
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dist-ssr
*.sln
*.sw?

# AI agent tooling keep each contributor's assistant config local so it never
# AI agent tooling - keep each contributor's assistant config local so it never
# pollutes the repo or disrupts anyone else's setup. Add your own tool here if
# it isn't already listed.
.claude/
Expand All @@ -41,6 +41,8 @@ dist-ssr
CLAUDE.md
CLAUDE.local.md
GEMINI.md
# Workspace ASCII checker config (tool lives in the git-ignored ../.claude/)
.asciiignore

# Personal deploy tooling ties to a specific server, kept out of the repo.
# Personal deploy tooling - ties to a specific server, kept out of the repo.
scripts/deploy.sh
22 changes: 11 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,36 @@ describes the app as it stands at that release.

### Added

- **Network mapping** place modems, gateways, switches, access points,
- **Network mapping** - place modems, gateways, switches, access points,
servers, VMs, and client devices on a pannable, zoomable canvas, each with a
name, type, IP, MAC, domain, tags, and notes.
- **Self-routing connections** orthogonal right-angle paths with rounded
- **Self-routing connections** - orthogonal right-angle paths with rounded
corners that route around other device cards, fall back to U-shapes for
awkward angles, and snap straight when cards line up. Wired or wireless, with
optional labels and a port at each end (a jack number or a named port like
WAN, LAN, or PoE). Multiple links to one device fan out so they don't overlap.
- **Connect mode** fast wiring with three sub-modes: **Hub** (fan out from one
- **Connect mode** - fast wiring with three sub-modes: **Hub** (fan out from one
device), **Single** (one link at a time), and **Advanced** (the editor opens
after each link). A live preview line follows the cursor and turns amber to
block duplicate connections.
- **Select mode** lasso a group of devices (live selection as the box sweeps),
- **Select mode** - lasso a group of devices (live selection as the box sweeps),
drag the whole group together, and copy, paste, duplicate, or delete the
selection.
- **VMs & containers** mark a device as hosted on a parent so the nesting is
- **VMs & containers** - mark a device as hosted on a parent so the nesting is
explicit on the map.
- **Custom icons** use the built-in Lucide set or upload your own SVG, PNG, or
- **Custom icons** - use the built-in Lucide set or upload your own SVG, PNG, or
JPG; icons are shared across every map. Uploaded SVGs pass through an
allow-list sanitizer.
- **Multiple maps** keep separate maps (blank or seeded from a worked example)
- **Multiple maps** - keep separate maps (blank or seeded from a worked example)
and switch between them, rename, or delete.
- **Import / export** save and load maps as plain JSON for backup and sharing,
- **Import / export** - save and load maps as plain JSON for backup and sharing,
with full validation of every imported record.
- **Offline copy** *Download Offline Copy* bakes the entire app into a single
- **Offline copy** - *Download Offline Copy* bakes the entire app into a single
self-contained HTML file that runs from disk or a USB stick, online or
air-gapped.
- **Local-first storage** everything lives in the browser's `localStorage`;
- **Local-first storage** - everything lives in the browser's `localStorage`;
no backend, no accounts, no telemetry. Data never leaves the machine.
- **Touch support** drag to pan, pinch to zoom, and long-press for context
- **Touch support** - drag to pan, pinch to zoom, and long-press for context
menus on tablets.

[Unreleased]: https://github.com/BrainInBlack/NetGraph/compare/v1.3.0...HEAD
Expand Down
Loading