NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content
Middle+3 views

Design a service for collaboratively planning renovations with contractors, estimates, and changes.

Practice

Asked at

AI answer

Architecture

  • Web and mobile clients communicate with an API gateway. Core modules include projects and tasks, contractors, estimates and payment milestones, discussions and notifications, files, and audit. Initially, this can be a modular monolith; services should be split out as load and team size grow.
  • PostgreSQL stores projects, participants, tasks, estimate versions, and approvals. Files are stored in object storage, while metadata and access permissions are stored in the database. A message queue is used for notifications, file processing, and background tasks.

Changes and approvals

Estimates and work plans are versioned: a new revision does not overwrite an approved one. A change records its author, time, reason, previous and new values, and required approvers. States: draft → pending approval → approved or rejected. Approval is performed transactionally with a version check (optimistic locking) so that concurrent edits are not lost. Once approved, a new baseline version is created rather than changing the history.

Access and reliability

Use a role-based model with scopes: project owner, contractor, and observer; a contractor can see only the projects and data assigned to them. Permissions must be checked server-side for every resource. Changes are audited, and sensitive documents are shared using temporary links. Use TLS, back up the database and files, verify recovery, and monitor error and latency metrics, tracing, and alerts. For reliable event delivery, use a transactional outbox and idempotent handlers.