Skip to content

Utopia: add normalized schema, data layer, HTTP server and web UI (Phase 1+2)#113

Open
CrazyVulcan wants to merge 2 commits intomasterfrom
codex/refactor-database-layer-for-utopia
Open

Utopia: add normalized schema, data layer, HTTP server and web UI (Phase 1+2)#113
CrazyVulcan wants to merge 2 commits intomasterfrom
codex/refactor-database-layer-for-utopia

Conversation

@CrazyVulcan
Copy link
Copy Markdown
Owner

Motivation

  • Introduce a normalized, queryable data model and migration path to replace the denormalized legacy payload and to provide a stable persistence boundary.
  • Provide a simple developer-facing HTTP server and a minimal browser UI to exercise read/write flows against the new schema.
  • Enable deterministic migration/backfill of legacy data and tooling to verify migration integrity.
  • Support basic list/board/card operations, tag joins, saved views and drag/drop ordering using numeric position gaps.

Description

  • Add SQL migrations db/migrations/001_create_utopia_v2_up.sql and ..._down.sql, seed SQL, and schema.md documenting the ERD and ordering strategy.
  • Introduce utopia_data package with db.py, models.py, repositories.py, and services.py to encapsulate DB access and service-level creation helpers.
  • Add a small stdlib HTTP server main/server.py with REST endpoints for GET /api/bootstrap, GET /api/boards/:id/state, POST /api/boards, POST /api/boards/:id/columns, POST /api/cards, POST /api/cards/:id/move, POST /api/boards/:id/views, and PATCH /api/cards/:id implementing tag handling, midpoint positioning, and JSON payload normalization.
  • Add a minimal single-page web UI under main/static (index.html, app.js, styles.css, domain/adapters.js) wired to the server REST API and using canonical board -> columns -> cards contracts.
  • Provide migration and verification tooling: scripts/migrate_utopia_data.py, migrate_utopia_data wrapper, and scripts/verify_utopia_data.py for backup, backfill, and integrity checks.
  • Add developer docs and notes: README.md, NOTES.md, and a basic smoke test tests/smoke_phase2.py that exercises end-to-end server + API flows.

Testing

  • Executed the smoke script python3 Frontiers/Utopia/tests/smoke_phase2.py which launches the server and exercises board/column/card create, edit, move, tag filtering, and saved view persistence, and it completed successfully.
  • No additional unit test suite was included in this rollout beyond the provided end-to-end smoke test.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant