NetLogic is a FastAPI + in-process scan engine (api/, src/, entry netlogic.py) with a React/Vite dashboard (dashboard/). Dependencies are installed by the environment bootstrap. This file is only the non-obvious run/test caveats.
- Web app:
python3 netlogic.py --guionhttp://localhost:8000(FastAPI + built SPA). It writes~/.netlogic/secrets.jsonand rebuildsdashboard/distwhen source is newer. Start it in tmux; do notpkillin the same compound command as the start. - CLI scan:
python3 netlogic.py <target> [flags]. The engine undersrc/is stdlib.
- Console scripts may not be on
PATH. Preferpython3 netlogic.py,python3 -m pytest,python3 -m bandit. - Clerk publishable key is inlined at Vite build time.
--guiloadsVITE_*fromdashboard/.env.example, then.env, then.env.local. The example file has the demo publishable key. If a build still has no key, the SPA showsMissingConfiginstead of a black screen. Never commit.env.local. - Human UI login is Clerk. There is no local auth bypass. For headless scans, use the machine API:
NETLOGIC_API_KEYin~/.netlogic/secrets.json(printed as the Agent key by--gui— machine credential, not interactive login).POST /v1/auth/tokenwith{"api_key": "..."}→ JWT.Authorization: Bearer <jwt>on/v1/jobs(not/jobs; that hits the SPA catch-all).
- Chrome/dbus/GPU noise from
webbrowser.openis harmless.
- Python:
python3 -m pytest test_*.py -qfrom repo root.conftest.pyisolates on-disk state. Postgres tests stay skipped unlessNETLOGIC_DATABASE_URLandNETLOGIC_SECRETS_KEYare set. - SAST:
python3 -m bandit -r src api --severity-level high. - Dashboard:
npm --prefix dashboard testandnpm --prefix dashboard run build(tscthenvite build).