Skip to content

Add architecture overview with Mermaid diagram to README#1408

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-architecture-overview-to-readme
Draft

Add architecture overview with Mermaid diagram to README#1408
Copilot wants to merge 3 commits intomainfrom
copilot/add-architecture-overview-to-readme

Conversation

Copy link
Contributor

Copilot AI commented Oct 29, 2025

The README lacked architectural context, forcing contributors to reverse-engineer component relationships from code. This adds a comprehensive Architecture section with structured documentation.

Changes

  • Mermaid diagram showing layered architecture:

    • Application Layer → Database API → Core Logic → Storage → Persistence
    • Component relationships with clear data flow paths
    • Color-coded by functional layer
  • Component descriptions for each layer with source file references:

    • Database API: db.rs, V2 API
    • Core Logic: Revision Manager, Merkle Trie, Proof Generation, Root Store
    • Storage: Node Store, Linear Storage, Hashers
    • FFI: C bindings and Go wrappers
  • Data flow documentation for critical paths:

    • Write path: Proposal creation → merkle hashing → node allocation → disk persistence → root store update
    • Read path: View lookup → trie traversal → cache/disk retrieval
    • Proof generation: Trie traversal → node/hash collection → proof serialization
  • Operation flows as ASCII diagrams showing component interaction chains

The existing SVG diagram reference is retained as supplementary material.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add architecture diagram and overview to README</issue_title>
<issue_description>### Problem
The main README provides terminology and build instructions but lacks a high-level architectural overview. Contributors and integrators find it difficult to understand the overall design and how modules fit together.

Proposed Solution

Create a dedicated "Architecture" section in the top-level README.md with a mermaid diagram illustrating Firewood's major components and their interactions.

Content to Include

  • Mermaid diagram showing the relationship between major components:
    • Storage layer
    • Merkle trie implementation
    • Database API
    • FFI layer
    • Proof generation
    • Root store and revision management
  • Brief descriptions of each major component
  • Data flow explanations
  • How components interact during common operations (read, write, commit)

Current State

  • No architectural documentation exists
  • Component relationships must be inferred from code
  • New contributors have difficulty understanding the big picture

References

  • firewood/src/ - Main database implementation
  • storage/src/ - Storage layer
  • ffi/src/ - Foreign function interface
  • Existing terminology section in README.md</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…README

Co-authored-by: rkuris <3193068+rkuris@users.noreply.github.com>
Copilot AI changed the title [WIP] Add architecture diagram and overview to README Add architecture overview with Mermaid diagram to README Oct 29, 2025
Copilot AI requested a review from rkuris October 29, 2025 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add architecture diagram and overview to README

2 participants

Comments