0bb52f9ec6
Create structured plan files with 12 phases covering the full implementation: scaffold, store, crypto, Docker/NPM clients, registry poller, webhook, deployer, API layer, SvelteKit frontend, embedding, and hardening.
2.8 KiB
2.8 KiB
Phase 1: Project Scaffold & SQLite Store
Status: ⬜ Not Started Parent plan: PLAN.md Domain: backend
Objective
Initialize the Go project, establish the directory structure, and implement the SQLite store with schema, migrations, and CRUD operations for all entities.
Tasks
- Task 1: Initialize Go module (
go mod init), create directory structure per PLAN.md - Task 2: Add core dependencies to go.mod (sqlite, chi, yaml, uuid, cron)
- Task 3: Define SQLite schema — tables for projects, stages, registries, settings, instances, deploys, deploy_logs
- Task 4: Implement store initialization with auto-migration (create tables if not exist)
- Task 5: Implement projects CRUD (Create, GetByID, GetAll, Update, Delete)
- Task 6: Implement stages CRUD (Create, GetByProjectID, Update, Delete)
- Task 7: Implement registries CRUD (Create, GetByID, GetAll, Update, Delete)
- Task 8: Implement settings Get/Update (single-row config pattern)
- Task 9: Implement instances CRUD (Create, GetByStageID, GetByID, Update, Delete, UpdateStatus)
- Task 10: Implement deploys CRUD (Create, GetByProjectID, GetRecent, GetByID) + deploy_logs append
- Task 11: Create
cmd/server/main.goentry point (minimal — just opens DB, defers close)
Files to Modify/Create
go.mod— module definition and dependenciesgo.sum— dependency checksumscmd/server/main.go— entry pointinternal/store/store.go— DB connection, schema, migrationsinternal/store/projects.go— project queriesinternal/store/stages.go— stage queriesinternal/store/registries.go— registry queriesinternal/store/settings.go— settings queriesinternal/store/instances.go— instance queriesinternal/store/deploys.go— deploy history queries
Acceptance Criteria
go mod tidysucceeds- All store CRUD functions are implemented with proper error handling
- Schema covers all entities from the architecture plan
- Entry point compiles (may not fully run until later phases wire everything)
Notes
- Use
modernc.org/sqlitefor CGo-free SQLite - Use
go-chi/chi/v5for routing (will be wired in Phase 8) - Settings table uses a single-row pattern (one row, upsert on update)
- Instance status should be an enum-like string: "running", "stopped", "failed", "removing"
- Deploy status: "pending", "pulling", "starting", "configuring_proxy", "health_checking", "success", "failed", "rolled_back"
Review Checklist
- All tasks completed
- Code follows Go conventions (gofmt, proper error returns)
- No unintended side effects
- Schema is normalized and covers all planned entities
- CRUD functions handle not-found cases properly