ArchDoc Documentation

Design Documents

Create detailed technical designs with Design Docs

Design Documents

Design Docs are comprehensive technical documents that describe the detailed design of a significant feature or system.

What is a Design Doc?

A Design Doc is a thorough document that:

  • Details the complete technical design
  • Guides implementation decisions
  • Serves as a reference during development
  • Documents the system for future maintenance

Design Docs are more detailed than ADRs or RFCs. They're intended to be the complete blueprint for implementation.

When to Write a Design Doc

Write a Design Doc when:

  • ✅ Building a complex new feature
  • ✅ Redesigning an existing system
  • ✅ Creating a new service or component
  • ✅ Making changes that span multiple teams
  • ✅ Building something that will need long-term maintenance

Design Doc Structure

A comprehensive Design Doc includes:

Title & Metadata

  • Document title
  • Author(s)
  • Reviewers
  • Status and dates

Overview

Brief summary of what's being designed (1-2 paragraphs).

Goals & Non-Goals

Explicitly state:

  • What this design aims to achieve
  • What's explicitly out of scope

Background

Context needed to understand the design:

  • Current system state
  • Related systems
  • Previous decisions

High-Level Design

Architecture overview:

  • System components
  • Data flow
  • Key interactions

Include diagrams!

Detailed Design

In-depth specifications:

  • API definitions
  • Data models
  • Algorithm details
  • Error handling

Security Considerations

  • Authentication/authorization
  • Data protection
  • Potential vulnerabilities

Testing Strategy

  • Unit testing approach
  • Integration testing
  • Performance testing

Deployment Plan

  • Rollout strategy
  • Feature flags
  • Rollback plan

Monitoring & Observability

  • Metrics to track
  • Alerting strategy
  • Logging requirements

Timeline & Milestones

  • Implementation phases
  • Dependencies
  • Estimated completion

Example Design Doc

# Design Doc: Real-time Collaboration System

**Author**: Jane Developer
**Reviewers**: John Architect, Sarah Security
**Status**: In Progress
**Last Updated**: February 2026

## Overview

This document describes the design for adding real-time
collaboration to the ArchDoc document editor, allowing
multiple users to edit documents simultaneously.

## Goals

- Enable multiple users to edit the same document
- Show presence indicators (who's viewing/editing)
- Display cursors and selections of other users
- Maintain document consistency across clients

## Non-Goals

- Offline editing (future work)
- Conflict resolution UI (auto-resolve only)
- Mobile app support (web only)

## Background

Currently, ArchDoc uses optimistic locking for edits.
When two users edit simultaneously, the second save
fails. This leads to a poor user experience.

Related systems:
- TipTap editor (current)
- NextAuth authentication
- Prisma database layer

## High-Level Design

┌─────────────┐ WebSocket ┌────────────────┐ │ Client A │◄──────────────►│ Collab Server │ └─────────────┘ │ (Hocuspocus) │ │ │ ┌─────────────┐ WebSocket │ ┌────────┐ │ │ Client B │◄──────────────►│ │ Yjs │ │ └─────────────┘ │ │ CRDT │ │ │ └────────┘ │ └───────┬────────┘ │ ▼ ┌───────────────┐ │ Database │ │ (Persistence)│ └───────────────┘


### Components

1. **Yjs CRDT**: Conflict-free replicated data type
2. **Hocuspocus**: WebSocket server for Yjs
3. **TipTap Collaboration**: Editor integration

## Detailed Design

### WebSocket Protocol
[Detailed protocol specification...]

### Data Model Changes
[Schema updates...]

### API Endpoints
[New endpoints...]

## Security Considerations

- Authenticate WebSocket connections via JWT
- Validate company membership for document access
- Rate limit connection attempts

## Testing Strategy

1. Unit tests for CRDT operations
2. Integration tests with multiple clients
3. Load testing with 50 concurrent users

## Deployment Plan

1. Phase 1: Deploy collab server (feature flagged)
2. Phase 2: Enable for internal testing
3. Phase 3: Gradual rollout by company
4. Phase 4: General availability

## Timeline

- Week 1-2: Server implementation
- Week 3-4: Client integration
- Week 5: Testing and fixes
- Week 6: Rollout

Best Practices

Include Diagrams

  • Architecture diagrams
  • Sequence diagrams
  • Data flow diagrams

Use Excalidraw or Mermaid for diagrams.

Be Specific

  • Include actual API schemas
  • Define data models precisely
  • Specify error cases

Consider Edge Cases

  • What happens during failures?
  • How do we handle partial states?
  • What are the limits?

Get Early Feedback

  • Share drafts with key stakeholders
  • Iterate before full review
  • Address concerns early

Update as You Go

  • Design Docs are living documents
  • Update when implementation differs
  • Note changes and reasons

Creating a Design Doc in ArchDoc

  1. Navigate to Dashboard > Documents
  2. Click New Document
  3. Select Design Doc as the document type
  4. Enter a descriptive title
  5. Write your detailed design
  6. Add diagrams as needed
  7. Request sign-offs from stakeholders
  8. Update throughout implementation

On this page