-
Notifications
You must be signed in to change notification settings - Fork 0
Development
mahdialemi edited this page Jun 12, 2026
·
1 revision
git clone https://github.com/mahdialemi/NexusMap.git
cd NexusMap
# Build with debug info
go build -o nexusmap .
# Build with stripped binary
go build -ldflags="-s -w" -o nexusmap .
# Cross-compile
GOOS=linux GOARCH=amd64 go build -o nexusmap-linux .
GOOS=windows GOARCH=amd64 go build -o nexusmap.exe .
GOOS=darwin GOARCH=amd64 go build -o nexusmap-macos .-
No Go frameworks — standard library
net/httponly -
No ORM — raw SQL queries with
database/sql -
Handler pattern:
func(w http.ResponseWriter, r *http.Request)— methods on*Serverstruct -
Error responses:
serverError(w, err)for 500,badRequest(w, msg)for 400 -
JSON responses:
writeJSON(w, data)for success,jsonError(w, msg, code)for errors -
Frontend: vanilla JavaScript, no frameworks. Event delegation via
data-actionattributes.
Edit internal/nmap/validate.go — add to the defaultProfiles slice:
{
Name: "my-custom-profile",
Description: "Scan with custom settings",
Command: "-sV -p 80,443,8080",
Category: "web",
SortOrder: 50,
IsBuiltin: true,
},-
CSS: Single
app.csswith CSS custom properties for theming. Dark theme is default, light theme via[data-theme="light"]overrides. -
SVG Icons: Single sprite sheet at
web/icons/sprite.svg. Add icons as<symbol>elements and reference with<use href="#icon-name"/>. -
Event handling: Global event delegation in
app.jscatchesdata-actionclicks and callswindow[actionName](). -
Pages are server-rendered HTML with Go's
html/templatefor escaping.
# Run all tests
go test ./...
# With coverage
go test -cover ./...
# Verbose
go test -v ./...The .github/workflows/release.yml automatically builds for Linux, Windows, and macOS when a tag is pushed:
git tag v1.0.0
git push origin v1.0.0This triggers GitHub Actions to build binaries and create a release page.