NetAtlas
# NetAtlas
Laravel 13 + React 19 + TypeScript + Inertia 3 network designer. The official Laravel React starter supplies Fortify authentication, password confirmation, TOTP MFA and passkeys. React Flow supplies the diagram editor.
## Implemented release
- Responsive dark dashboard and optional light appearance; all synthetic telemetry is labeled.
- Public, isolated demo at `/demo/topology`, with browser-local storage and no network operations.
- Registration, sessions, login, logout, profile, TOTP MFA and passkeys.
- Per-user organization workspace with sites and topology creation.
- Twenty device types, named port handles, drag/drop, movement, grid, zoom, MiniMap, multi-selection, duplication, deletion, keyboard shortcuts and a device context menu.
- Device and cable properties, access VLAN, cable type/speed/status, group labels/colors, notes.
- SQL persistence, autosave, conflict detection, audit records, version history and restore-as-new-revision.
- JSON import/export, PNG/SVG canvas export, inventory CSV export.
- IPv4 subnet calculator, IPv4/IPv6 subnet registry and VLAN registry.
- Basic logical simulator: IPv4, duplicate IPs, gateways, links, access VLAN compatibility and same-subnet reachability.
- Versioned session-authenticated REST endpoints at `/api/v1/`. CSRF, rate limiting and server-side tenant authorization protect writes.
## Scope and limitations
This is **Network Designer 0.1 with an initial logical simulator**, not the completed Business Platform 1.0. Discovery, agents, live metrics, incidents, configuration vault and device drivers are visibly unavailable until implemented and connected. There are no live network requests, arbitrary shell operations, fabricated live readings or diagram-triggered device changes.
The simulator does not emulate firmware, packet timing, static routes, ACLs, NAT, DHCP, DNS, trunk VLANs or IPv6 communication. A physical cable in a diagram describes a plan, not an observed connection. Group labels categorize and color nodes; they are not nested movable rack containers. Organizations currently provision automatically per account; the schema and policies support membership roles, while invitation and organization-switching UI are future work.
## Installation
Requirements: PHP 8.3+ with Laravel's required extensions and PDO MySQL, Composer 2, Node 22.12+, SQL server. MySQL 8 is supported. This VPS already uses MariaDB 10.11; NetAtlas uses its own `netatlas` database and `netatlas_app` user without replacing the shared server.
```bash
cd /var/www/netatlas.jankaminsky.eu
composer install --no-interaction --prefer-dist
npm ci
# For a NEW installation only:
cp .env.example .env
php artisan key:generate
# Configure database, APP_URL and production sessions in .env before migrating.
php artisan migrate --force
npm run build
```
The active installation already has its own generated key and database settings. **Do not overwrite its `.env` or regenerate the key.** The project root is `/var/www/netatlas.jankaminsky.eu`, matching the existing Nginx configuration; public root is its `public/` directory. The requested `/var/www/netatlas` alternative was not used because it would require changing the existing virtual host.
Set `APP_ENV=production`, `APP_DEBUG=false`, `SESSION_SECURE_COOKIE=true` and `SESSION_ENCRYPT=true`. PHP-FPM needs read access to `.env` and write access to `storage/` and `bootstrap/cache/`, not to all source files. Keep `.env` out of version control and backups encrypted.
The deployed application uses synchronous request persistence and database session/cache drivers. Redis, Horizon and Reverb are not required or running for this release.
Mail defaults to the `array` transport, so no reset secrets are written to log files. Password reset is disabled in production until a real mail transport is configured. Configure SMTP using Laravel's mail environment variables, clear configuration cache, and validate delivery before enabling account recovery. Email verification similarly needs working mail delivery. MFA setup is available under `/settings/security`; this release does not enforce MFA by organizational role.
## Verify
```bash
php artisan config:clear
php artisan test --compact
npm run types:check
npm test
npm run build
# Install test browsers once; may use a temporary PLAYWRIGHT_BROWSERS_PATH.
npx playwright install chromium
npm run test:e2e
```
Backend tests use an in-memory SQLite database; they do not truncate the production SQL database. End-to-end tests exercise the public demo without creating production accounts. Browser tests accept `NETATLAS_TEST_URL` for a staging URL.
## Shortcuts
- Ctrl/Cmd + Z: undo; Ctrl/Cmd + Shift + Z: redo.
- Ctrl/Cmd + C / V: copy and paste devices within the editor.
- Ctrl/Cmd + D: duplicate selected devices, clearing duplicate IPs.
- Ctrl/Cmd + S: save.
- Shift + drag: multi-select.
- Delete/Backspace: delete selection.
Autosave runs after 1.8 seconds of inactivity. A revision conflict returns HTTP 409 and requires reload to avoid overwriting another editor. Imported JSON is limited to 2 MB in the browser, 300 devices and 1,000 edges. Server-side graph rules reject duplicate physical port occupancy and dangling endpoints. Snapshot history is append-only; restoring a version creates a new revision when saved.
## Updates and backup
```bash
cd /var/www/netatlas.jankaminsky.eu
composer install --no-interaction --prefer-dist
npm ci
npm run build
php artisan migrate --force
php artisan config:cache
php artisan route:cache
php artisan view:cache
```
Before updating, back up the SQL database, `.env` and private storage using restricted paths and credentials supplied outside shell arguments. Never run `migrate:fresh` or `db:wipe` on this VPS. Preserve the existing Nginx and HTTPS configuration and other sites.
See [architecture](docs/architecture.md) for extension boundaries and API behavior.