Skip to content

chore: extract web dashboard to separate repo, rename dashboard→admin#111

Merged
skyoo2003 merged 3 commits into
mainfrom
chore/extract-web-and-rename-admin
Jul 24, 2026
Merged

chore: extract web dashboard to separate repo, rename dashboard→admin#111
skyoo2003 merged 3 commits into
mainfrom
chore/extract-web-and-rename-admin

Conversation

@skyoo2003

@skyoo2003 skyoo2003 commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

Extract the Next.js web dashboard into its own repository and rename the internal/dashboard package to the more general internal/admin. The Go binary now ships only the opt-in admin API (/devcloud/api/*); the dashboard UI lives in a separate project that consumes it.

Related Issue

Changes

  • Extract the web frontend to skyoo2003/devcloud-dashboard (history preserved via git subtree split). The Go binary no longer builds, bundles, or serves a web UI.
  • Rename internal/dashboardinternal/admin and config key dashboard.enabledadmin.enabled (a general-purpose admin/introspection API, not a UI-bound dashboard). Tracked as git renames so blame is preserved.
  • Drop UI static-serving from cmd/devcloud/main.go; the server is API-only.
  • Purge web from build tooling & infra: Makefile (build-web/build-all), Docker (Next.js build stage + web/out copy, frontend compose service), CI (Node/Next steps), dependabot (npm), labeler, pre-commit (eslint), .gitignore.
  • Docs: README, architecture, getting-started, troubleshooting, configuration, contributing, plugin-api.

Kept: the internal/admin REST + WebSocket API (the external dashboard's backend). Untouched: CloudWatch/CloudTrail "Dashboard" AWS service APIs (unrelated feature).

Test Plan

  • go build ./..., go vet ./..., go test ./internal/... ./cmd/... — all green.
  • golangci-lint run on changed packages — 0 issues.

Checklist

  • Self-reviewed the code
  • Added/updated tests
  • Lint/format passes (golangci-lint run)
  • Updated documentation (if applicable)
  • Added a Changie changelog fragment for user-facing changes (changie new, see docs/release.md) — or N/A (docs/tests/chore only)

@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies Dependency updates ci CI/CD workflows and scripts docker Docker and container related web Web dashboard (Next.js) tests Test code and test infrastructure labels Jul 24, 2026
@skyoo2003 skyoo2003 self-assigned this Jul 24, 2026
@sourcery-ai

sourcery-ai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Extracts the Next.js web dashboard into a separate repository, removes all web build/infrastructure integration, and renames the backend dashboard package and configuration to a generic admin API while keeping the REST/WebSocket backend intact.

File-Level Changes

Change Details Files
Switch the server from a bundled dashboard (UI+API) to an opt-in admin API backend only.
  • Replace internal/dashboard imports with internal/admin in main and gateway wiring.
  • Stop serving static files from web/out and always pass an empty webDir into the gateway.
  • Rename dashboard-enabled conditional logic and logging in main.go to admin-enabled semantics.
cmd/devcloud/main.go
internal/gateway/gateway.go
internal/gateway/gateway_test.go
Rename the dashboard backend package to admin and update types, tests, and log messages accordingly.
  • Move internal/dashboard to internal/admin and update package declarations.
  • Rename DashboardAPI type, constructors, and test names to generic API naming.
  • Update WebSocket hub logging prefixes and comments from dashboard to admin clients.
  • Rename LogCollector-related types/tests under the new package.
internal/dashboard/api.go
internal/dashboard/api_test.go
internal/dashboard/websocket.go
internal/dashboard/websocket_test.go
internal/dashboard/logger.go
internal/dashboard/logger_test.go
internal/admin/api.go
internal/admin/api_test.go
internal/admin/websocket.go
internal/admin/websocket_test.go
internal/admin/logger.go
internal/admin/logger_test.go
Update configuration from dashboard.enabled to admin.enabled and keep defaults/tests consistent.
  • Rename DashboardConfig to AdminConfig and the Config field from Dashboard to Admin.
  • Update YAML keys in default config, sample configs, and config tests from dashboard to admin.
  • Adjust documentation tables and examples to reference admin.enabled and describe the admin API behavior.
internal/config/config.go
internal/config/config_test.go
internal/config/default.yaml
docs/configuration.md
Remove local web dashboard source and all associated build/CI tooling.
  • Delete the web/ Next.js project directory and its contents.
  • Remove web-related Make targets (build-web, build-all) and references in docs.
  • Strip Node/Next.js build steps from CI workflow and dependabot npm configuration.
  • Remove frontend service from docker-compose and web build stage from Dockerfile.
  • Drop eslint pre-commit hook for web and labeler patterns for web and npm files.
  • Clean .gitignore entries related to web artifacts if any.
web/**/*
Makefile
.github/workflows/ci.yml
.github/dependabot.yml
.pre-commit-config.yaml
.github/labeler.yml
docker/Dockerfile
docker/docker-compose.yml
.gitignore
Refresh documentation and changelog to describe the new admin API and external dashboard repo.
  • Rewrite architecture, getting-started, troubleshooting, README, and plugin API docs to talk about the admin API instead of a bundled dashboard.
  • Clarify that /devcloud/api/* is an opt-in admin endpoint with no UI served by the Go binary and that the dashboard UI lives in a separate repository.
  • Add changelog fragments documenting the extraction of the web dashboard and the dashboard→admin rename.
docs/architecture.md
docs/getting-started.md
docs/troubleshooting.md
docs/contributing.md
docs/plugin-api.md
README.md
changes/unreleased/Changed-20260724-000001.yaml
changes/unreleased/Removed-20260724-000000.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Extract the Next.js web frontend to its own repository (skyoo2003/devcloud-dashboard;
history preserved via subtree split). The Go binary no longer builds, bundles, or
serves a web UI — it exposes only the opt-in admin API at /devcloud/api/*.

Rename internal/dashboard → internal/admin and the dashboard.enabled config key
to admin.enabled, reflecting a general-purpose admin/introspection API rather than
a UI-bound dashboard.

Purge web from build tooling and infra: Makefile (build-web/build-all), Docker
(Next.js build stage + web/out copy, frontend compose service), CI (Node/Next
steps), dependabot (npm), labeler, pre-commit (eslint), .gitignore. Update docs
and add changelog fragments.
@skyoo2003
skyoo2003 force-pushed the chore/extract-web-and-rename-admin branch from 6abfad7 to f2887e1 Compare July 24, 2026 14:24

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

Fixed security issues:

  • brace-expansion (link)

  • fast-uri (link)

  • next (link)

  • sharp (link)

  • web/package-lock.json (link) · Dashboard

  • The config rename from dashboard.enabled to admin.enabled is currently a hard break; consider supporting the old key with a deprecation warning for at least one release to avoid silently disabling the admin API for existing deployments.

  • Now that the Go binary no longer serves a UI and webDir is always passed as an empty string, consider simplifying gateway.New and related routing comments by removing the webDir parameter to make the interface reflect the current behavior.

Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The config rename from `dashboard.enabled` to `admin.enabled` is currently a hard break; consider supporting the old key with a deprecation warning for at least one release to avoid silently disabling the admin API for existing deployments.
- Now that the Go binary no longer serves a UI and `webDir` is always passed as an empty string, consider simplifying `gateway.New` and related routing comments by removing the `webDir` parameter to make the interface reflect the current behavior.

## Individual Comments

### Comment 1
<location path="cmd/devcloud/main.go" line_range="103-112" />
<code_context>
+	// Admin API: build the REST + WebSocket handler only when the operator
</code_context>
<issue_to_address>
**suggestion:** Align gateway API and comments with the fact that this binary no longer serves a web UI

The main package now always passes an empty `webDir` and notes that the binary serves no web UI, but `gateway.New` still takes a `webDir` and documents SPA-serving behavior. This discrepancy can mislead users of the API. If static UI serving is truly out of scope, consider removing `webDir` and the SPA behavior from `gateway.New`, or at least updating its doc comment to clarify that `webDir` is only for external callers and not used by this binary.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread cmd/devcloud/main.go Outdated
…key as deprecated alias

gateway.New no longer takes a webDir parameter. Since the binary serves no web
UI (always passed ""), the static/SPA-serving branch and the now-dead
isAWSRequest helper are removed, so the interface reflects actual behavior.

config: honour the deprecated `dashboard.enabled` key for one release — it maps
to admin.enabled with a deprecation warning — so existing deployments don't
silently lose the admin API after the rename. An explicit `admin` block wins.
…lloc

Address code-review findings on the review-response commit:

- config: make Config.Admin a pointer so parse can distinguish an explicit
  `admin` block from an absent one. The deprecated `dashboard` key now applies
  only when no `admin` block is present, so an explicit `admin.enabled: false`
  is no longer re-enabled by a leftover `dashboard.enabled: true`. Admin is
  defaulted to a zero value after, keeping downstream access nil-safe.
- config test: assert the reverse precedence (explicit admin:false wins over
  deprecated dashboard:true), which was the uncovered regression path.
- main: allocate the eventbus only inside the admin-enabled block instead of
  unconditionally discarding it when admin is off (the default).
@skyoo2003

Copy link
Copy Markdown
Owner Author

Code-review findings 4 and 5 were pre-existing (not introduced here) and are tracked as follow-ups:

@skyoo2003
skyoo2003 merged commit b5276b6 into main Jul 24, 2026
9 checks passed
@skyoo2003
skyoo2003 deleted the chore/extract-web-and-rename-admin branch July 24, 2026 14:41
skyoo2003 added a commit that referenced this pull request Jul 24, 2026
The web frontend was extracted to a separate repo in #111, leaving no
JS/TS source. CodeQL's javascript-typescript analysis then fails with
"No source code was seen during the build". Analyze Go only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD workflows and scripts dependencies Dependency updates docker Docker and container related documentation Improvements or additions to documentation tests Test code and test infrastructure web Web dashboard (Next.js)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant