Skip to content

refactor: restructure repo — Go code to root, module path → github.co…#3

Merged
Koopa0 merged 1 commit into
mainfrom
refactor/repo-restructure
Mar 30, 2026
Merged

refactor: restructure repo — Go code to root, module path → github.co…#3
Koopa0 merged 1 commit into
mainfrom
refactor/repo-restructure

Conversation

@Koopa0
Copy link
Copy Markdown
Owner

@Koopa0 Koopa0 commented Mar 30, 2026

…m/Koopa0/koopa0.dev

  • Move all Go source from backend/ to repo root
  • Module path: github.com/koopa0/blog-backend → github.com/Koopa0/koopa0.dev
  • Update 125 Go files with new import path
  • Merge backend/CLAUDE.md into root CLAUDE.md (single source of truth)
  • Merge backend/docs/ and backend/scripts/ into root
  • Move backend/.claude/ to root .claude/
  • Update docker-compose.yml build contexts (./backend → .)
  • Update deploy.yml VPS path (~/blog → ~/koopa0.dev)
  • Add .dockerignore to exclude frontend from Go Docker builds
  • All 35 test packages pass, go build/vet clean

…m/Koopa0/koopa0.dev

  - Move all Go source from backend/ to repo root
  - Module path: github.com/koopa0/blog-backend → github.com/Koopa0/koopa0.dev
  - Update 125 Go files with new import path
  - Merge backend/CLAUDE.md into root CLAUDE.md (single source of truth)
  - Merge backend/docs/ and backend/scripts/ into root
  - Move backend/.claude/ to root .claude/
  - Update docker-compose.yml build contexts (./backend → .)
  - Update deploy.yml VPS path (~/blog → ~/koopa0.dev)
  - Add .dockerignore to exclude frontend from Go Docker builds
  - All 35 test packages pass, go build/vet clean
@Koopa0 Koopa0 merged commit 7fdb266 into main Mar 30, 2026
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Mar 30, 2026

🤖 Augment PR Summary

Summary: This PR refactors the repo into a true monorepo layout by moving the Go backend from backend/ to the repository root and aligning configuration/docs accordingly.

Changes:

  • Moves Go entrypoints to cmd/app and cmd/mcp at repo root (removing the backend/ nesting).
  • Renames the Go module to github.com/Koopa0/koopa0.dev and updates imports across the codebase.
  • Updates Docker build setup: new root .dockerignore, and docker-compose.yml build contexts now point to ..
  • Adjusts deploy workflow to deploy from ~/koopa0.dev on the VPS.
  • Consolidates/relocates backend docs, scripts, and Claude/Gemini guidance into root-level equivalents.
  • Refreshes .env.example to reflect current runtime configuration variables (OAuth, AI providers, Notion optionality, notifications, R2).

Technical Notes: Primary impact is path/module renaming; runtime behavior should remain the same, but local/dev and deployment configs need to stay in sync with the new root build context.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 5 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread .env.example

# === GitHub ===
GITHUB_WEBHOOK_SECRET=your-webhook-secret-here
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

.env.example:18 — The placeholder GITHUB_TOKEN=ghp_... looks like a real GitHub PAT format and can trigger secret-scanning / security tooling even when it’s intended as an example. That can create noisy alerts or CI policy failures for contributors.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread .env.example
SITE_URL=http://localhost:8080

# === Database ===
DATABASE_URL=postgres://blog:blogpass@localhost:5432/blog?sslmode=disable
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

.env.example:7 — DATABASE_URL here points at localhost with blog:blogpass, but the default docker-compose.yml uses a different host/user (postgres, koopa). This mismatch can make “copy .env.example and run compose” setups fail or be confusing.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread go.mod
@@ -1,4 +1,4 @@
module github.com/koopa0/blog-backend
module github.com/Koopa0/koopa0.dev
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

go.mod:1 — The module path is now github.com/Koopa0/koopa0.dev, which won’t be fetchable via go get unless the GitHub repo is renamed (or you’re using a vanity import setup). If the repo remains Koopa0/blog, downstream consumers/build systems may break when resolving the module.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.


> 45 tools across 4 domains. Last audit: 2026-03-26.
> Server: single Go binary (`/Users/koopa/blog/backend/`) + PostgreSQL.
> Server: single Go binary (`/Users/koopa/blog/./`) + PostgreSQL.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

docs/MCP-TOOLS-REFERENCE.md:4 — The server location string now reads /Users/koopa/blog/./, which is syntactically valid but easy to misread as a typo. This can confuse readers about the intended on-disk layout after the restructure.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread docker-compose.yml
backend:
build:
context: ./backend
context: .
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

docker-compose.yml:64 — After updating build context to the repo root, the compose file still references env vars like NOTION_PROJECTS_DB/NOTION_TASKS_DB that are no longer present in .env.example. That drift makes it unclear which variables are actually required for a working local/prod compose deploy.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@Koopa0 Koopa0 deleted the refactor/repo-restructure branch March 31, 2026 14:19
Koopa0 added a commit that referenced this pull request Apr 8, 2026
HIGH fixes:
- #1-2: GoalDetail projects are goal siblings, not milestone children
  (projects.goal_id → goals.id, no milestone_id FK exists)
  Restructured GoalDetail: milestones[] + projects[] as separate arrays

MEDIUM fixes:
- #3: signal_type uses weakness/improvement/mastery (not misconception)
- #4: outcome uses schema 7-values (incomplete, not partial)
- #5: duration_minutes not duration_seconds
- #6: removed ease_rating (FSRS rating is in review_logs, not attempts)
- #8: mastery is aggregated from observations, not a stored score
- #12: drop only affects daily_plan_item status, doesn't delete task
- #13: ClarifyAsInsight requires invalidation_condition (schema NOT NULL)

LOW fixes:
- #7: session start uses session_mode, focus_concepts noted as metadata
- #9: concept drilldown uses observation_trend, not mastery_trend
- #10: removed stale directive schema note (resolved_at already exists)

NEW:
- #11: Added Learning Plans API section (§7.5) — plans list, detail,
  item status update with mandatory reason for completions
- Added PlanStatus, PlanItemStatus, LearningPlanSummary, LearningPlanDetail,
  PlanItemDetail, PlanProgress types to admin.model.ts
Koopa0 added a commit that referenced this pull request Apr 8, 2026
Dashboard (new page at /admin/dashboard):
- Trends analytics answering '系統方向對嗎?' (not stat cards)
- 4-card grid: execution velocity, goal health, learning signals, content+inbox
- Every metric shows trend direction + comparison with last period
- Compact directive health footer
- DashboardTrends model + DashboardService with mock data
- Route + sidebar nav added (between Today and Inbox)

Schema alignment fixes (round 2):
- #1: GoalBreadcrumb simplified — removed milestone_id/title (no FK exists)
- #2: streak marked as derived (computed from sessions, not stored)
- #3: Added missing learning plan management endpoints (add/remove/reorder/update)
- #4: DirectiveLifecycle simplified to 3 values + has_report boolean
- #5: Domain examples changed from 'algorithms' to 'leetcode'
- #6: Added GET /api/admin/learn/review-queue (FSRS detail endpoint)
- #7: estimated_minutes marked as derived from tasks table
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