feat: bootstrap OSDB full-stack skeleton (story #01) #1

Merged
julia merged 3 commits from feature/01-bootstrap-the-project into main 2026-06-17 12:45:14 +00:00
Owner

Summary

  • Bootstrap full-stack OSDB skeleton: Go (Echo v4 + pgxpool + embedded golang-migrate) backend + Vue 3 (Vite + TypeScript + Pinia + vue-router + Tailwind CSS v4) frontend
  • Health endpoints at /health and /api/v1/health; Postgres via docker-compose with env-interpolated credentials
  • embed.FS migrations at backend/migrations/ (000001 no-op baseline); server migrate subcommand applies/rolls back
  • Vite proxy /api:3000 (no CORS needed in dev); strictPort: true on :5000

Test plan

  • make dev-db → Postgres healthy
  • make migrate-upschema_migrations version=1 dirty=f
  • make run-backendcurl localhost:3000/health and /api/v1/health return {"status":"ok"}
  • make run-frontend → browser at :5000 shows "Hello, OSDB!" with backend status "ok"
  • make test → Go handler test + 2 Vue component tests all green

Code review fixes applied

  • Makefile: -include .env (soft) — no hard-fail on fresh clone
  • main.go: error channel replaces log.Fatalf in goroutine — defer pool.Close() always runs
  • main.go: 30 s context.WithTimeout on DB connect — fails fast vs. unreachable Postgres
  • router.go: pool stored on Echo context via middleware — future story handlers can access DB
  • config.go: DATABASE_URL required; log.Fatal if missing — no silent credential fallback
  • HelloWorld.test.ts: URL-aware fetch stub + afterEach(restoreAllMocks) + flushPromises test

🤖 Generated with Claude Code

## Summary - Bootstrap full-stack OSDB skeleton: Go (Echo v4 + pgxpool + embedded golang-migrate) backend + Vue 3 (Vite + TypeScript + Pinia + vue-router + Tailwind CSS v4) frontend - Health endpoints at `/health` and `/api/v1/health`; Postgres via docker-compose with env-interpolated credentials - embed.FS migrations at `backend/migrations/` (000001 no-op baseline); `server migrate` subcommand applies/rolls back - Vite proxy `/api` → `:3000` (no CORS needed in dev); `strictPort: true` on `:5000` ## Test plan - [ ] `make dev-db` → Postgres healthy - [ ] `make migrate-up` → `schema_migrations` version=1 dirty=f - [ ] `make run-backend` → `curl localhost:3000/health` and `/api/v1/health` return `{"status":"ok"}` - [ ] `make run-frontend` → browser at :5000 shows "Hello, OSDB!" with backend status "ok" - [ ] `make test` → Go handler test + 2 Vue component tests all green ## Code review fixes applied - `Makefile`: `-include .env` (soft) — no hard-fail on fresh clone - `main.go`: error channel replaces `log.Fatalf` in goroutine — `defer pool.Close()` always runs - `main.go`: 30 s `context.WithTimeout` on DB connect — fails fast vs. unreachable Postgres - `router.go`: pool stored on Echo context via middleware — future story handlers can access DB - `config.go`: `DATABASE_URL` required; `log.Fatal` if missing — no silent credential fallback - `HelloWorld.test.ts`: URL-aware fetch stub + `afterEach(restoreAllMocks)` + `flushPromises` test 🤖 Generated with [Claude Code](https://claude.com/claude-code)
julia added 3 commits 2026-06-16 15:34:48 +00:00
- Go backend: Echo v4 + pgxpool + embedded golang-migrate; health endpoints
  at /health and /api/v1/health; TDD health handler (httptest)
- Vue 3 frontend: Vite + TypeScript + Pinia + vue-router + Tailwind CSS v4;
  TDD HelloWorld component (@vue/test-utils + jsdom + vitest)
- Infra: docker-compose postgres:16 with env-interpolated credentials;
  Makefile with dev-db health-wait loop, migrate-up/down, run, test, fmt
- embed.FS migrations at backend/migrations/ (000001 no-op baseline)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Makefile: -include .env (soft) so fresh clone doesn't hard-fail
- main.go: replace log.Fatalf-in-goroutine with error channel; startup
  failures now reach main goroutine so defer pool.Close() always runs
- main.go: context.WithTimeout(30s) on database.Connect to fail fast
  instead of hanging indefinitely on unreachable Postgres
- router.go: store pool on Echo context via middleware so future story
  handlers can retrieve it with c.Get("pool")
- config.go: require DATABASE_URL explicitly (log.Fatal if missing)
  instead of falling back to hardcoded credentials
- HelloWorld.test.ts: URL-aware fetch stub + afterEach restoreAllMocks;
  add flushPromises test verifying backend status renders

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
julia merged commit b0cb64bdaf into main 2026-06-17 12:45:14 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: julia/osdb-1-claude-opusplan#1