NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content
Middle1 view

Design a service for collaboratively creating and reviewing business plans, with versioning, comments, and roles.

Practice

AI answer

I would divide the system into a web client, an API, an authorization and business-logic service, storage, and background tasks. Documents can be stored as structured blocks in PostgreSQL, while uploaded files can go in object storage. For each version, store the author, timestamp, and changes; protect editing with optimistic locking to avoid overwriting someone else’s edits. Associate comments with a document or a specific passage and version.

Define roles at the organization and document levels—for example, owner, editor, commenter, and reader. Check permissions on the server with every request. Record changes and access-related actions in an audit log. Run the business-plan review asynchronously: the task goes into a queue, a review service analyzes the document, and the results and comments are returned to the interface. Reliability requires backups, monitoring for errors and latency, rate limiting, and recovery tests. Deploy through CI/CD with separate environments and managed secrets.