Skip to content

feat(api): add site events REST endpoints and dashboard integration#71

Open
heydemoura wants to merge 9 commits intov2-add-site-eventsfrom
v2-add-site-events-rest-api
Open

feat(api): add site events REST endpoints and dashboard integration#71
heydemoura wants to merge 9 commits intov2-add-site-eventsfrom
v2-add-site-events-rest-api

Conversation

@heydemoura
Copy link
Copy Markdown
Contributor

Summary

  • Add a new REST API surface for site events and integrate it into the dashboard/server wiring.
  • Harden migration behavior to reconcile state instead of failing hard in partially migrated environments.
  • Improve onboarding and operator documentation with a new getting-started guide and cross-links.

Key Changes vs Base (v2-add-site-events)

  • New API layer
    • Added internal/dashboard/api.go with authenticated REST handlers under /api/v1.
    • Updated internal/dashboard/dashboard.go and cmd/jetmon2/main.go to serve dashboard + API on the same listener.
    • Added API behavior for site management and event reads, including auth/rate-limit handling.
  • DB + query path updates
    • Updated internal/db/queries.go and internal/db/site_events.go for site CRUD/event-read support used by the API.
    • Added/updated tests in internal/db/queries_test.go and internal/dashboard/dashboard_test.go.
  • Migration resilience
    • Updated internal/db/migrations.go to reconcile migration 8 schema pieces idempotently (instead of hard-failing when columns/index already exist), so later migrations can still apply.
  • Config and local infra
    • Updated internal/config/config.go and internal/config/config_test.go with API token/rate-limit config behavior.
    • Updated docker/docker-compose.yml for container naming adjustment.
  • Docs
    • Added GETTING_STARTED.md.
    • Added references in README.md, PROJECT.md, and config/config.readme.

Testing

  • go test ./internal/dashboard ./internal/db ./internal/config ./cmd/jetmon2
  • go test ./internal/db

Risk / Rollout

  • Primary risk is migration/query behavior touching site-event paths.
  • Mitigations:
    • Validate migrations on fresh and pre-existing DB states.
    • Verify API auth and endpoint behavior in Docker.
    • Roll out with normal rolling update and monitor migration/API logs.

@heydemoura heydemoura force-pushed the v2-add-site-events-rest-api branch from 11f5078 to 6d02669 Compare April 24, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant