Skip to content

Add comprehensive documentation: architecture.md and CLAUDE.md#3

Merged
figassis merged 1 commit intomasterfrom
agent/docs-architecture
Jan 11, 2026
Merged

Add comprehensive documentation: architecture.md and CLAUDE.md#3
figassis merged 1 commit intomasterfrom
agent/docs-architecture

Conversation

@figassis
Copy link

@figassis figassis commented Jan 11, 2026

Summary

  • Added architecture.md: Detailed system architecture with ASCII diagrams, fork additions, REST API, storage architecture, complete database schema documentation, and reference configuration
  • Added CLAUDE.md: Development guidelines, quick reference commands, fork context, development patterns, and common tasks

Test Plan

  • Documentation files created and readable in markdown editors
  • All referenced file paths verified to exist
  • Environment variables match actual implementation
  • REST API endpoints match code in api.go
  • Database schema matches go-imap-sql implementation

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guide covering REST API integration, architecture design, and configuration for user and mailbox provisioning.
    • Included build, test, and deployment instructions with environment variable reference.
    • Documented API endpoints, request/response models, middleware stack, and storage architecture.
    • Provided example configurations and testing procedures for REST API usage and integration.

✏️ Tip: You can customize this high-level summary in your review settings.

- architecture.md: Detailed system architecture with ASCII diagrams, fork additions, storage architecture, database schema, and reference configuration
- CLAUDE.md: Development guidelines, quick reference, fork context, and common tasks for maintainers and contributors

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 11, 2026

Walkthrough

This PR introduces two comprehensive documentation files for the Maddy Mail Server fork. CLAUDE.md provides developer guidance on building, testing, and extending REST API endpoints with schema and testing examples, while architecture.md details the REST API design, mailbox provisioning workflows, storage architecture, DNS provider integration, and production configuration patterns.

Changes

Cohort / File(s) Summary
Documentation Files
CLAUDE.md, architecture.md
Added developer and architecture documentation totaling 785 lines. CLAUDE.md (+248) covers REST API development patterns, build/test guidance, and database schema overview. architecture.md (+537) documents REST API design, mailbox provisioning workflows, storage architecture, DNS provider integration, and configuration guidance.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding two comprehensive documentation files (architecture.md and CLAUDE.md) to the repository.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@figassis figassis merged commit 1e4ea31 into master Jan 11, 2026
2 of 4 checks passed
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (5)
architecture.md (4)

13-41: Add language specifiers to ASCII diagram code blocks.

Markdown code blocks should declare a language identifier for proper syntax highlighting. ASCII diagrams can use plain text or a generic language.

♻️ Proposed fixes for code block language specifiers

Update the fenced code block markers:

-```
+```text

Apply this change to the ASCII diagram blocks at:

  • Lines 13-41 (architecture diagram)
  • Lines 85-123 (REST API middleware stack)
  • Lines 191-242 (user/mailbox workflows)
  • Lines 276-317 (storage architecture)
  • Lines 394-415 (fork-added directories)
  • Lines 419-432 (upstream directories)

Also applies to: 85-123, 191-242, 276-317, 394-415, 419-432


141-159: Add language specifier to Go code block.

Line 141 declares a Go struct definition but lacks the go language identifier.

♻️ Proposed fix
-```go
+```go
 // Create user with optional mailbox provisioning
 type CreateUserDto struct {

322-327: Add language specifier to SQL code block.

Line 322 contains SQL but lacks the sql language identifier.

♻️ Proposed fix
-```sql
+```sql
 CREATE TABLE credentials (
     username varchar NOT NULL PRIMARY KEY,
     password varchar NOT NULL  -- bcrypt hash
 );

465-531: Add language specifier to configuration code block.

Line 465 contains Maddy configuration syntax but lacks a language identifier.

♻️ Proposed fix
-```
+```conf
 # Base variables
 $(hostname) = example.org
CLAUDE.md (1)

228-234: Add language specifier to configuration code block.

Line 228 contains Maddy configuration syntax but lacks a language identifier.

♻️ Proposed fix
-```
+```conf
 storage.imapsql local_mailboxes {
     sent_mailbox "Sent Messages"
     trash_mailbox "Deleted Items"
     # ...
 }
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between f4147b4 and 5b70a68.

📒 Files selected for processing (2)
  • CLAUDE.md
  • architecture.md
🧰 Additional context used
🪛 LanguageTool
architecture.md

[grammar] ~260-~260: Ensure spelling is correct
Context: ...er Support Added build support for AWS Route53 and Cloudflare DNS providers for ACME c...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🪛 markdownlint-cli2 (0.18.1)
CLAUDE.md

228-228: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

architecture.md

13-13: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


85-85: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


191-191: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


276-276: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


334-334: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


346-346: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


364-364: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


394-394: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


419-419: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


465-465: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (8)
CLAUDE.md (5)

1-50: Approve documentation structure and cross-referencing.

The document provides a clear quick-reference guide complementing architecture.md well. The cross-reference at line 3 properly directs readers to the detailed architecture documentation, and the organization facilitates both quick lookups and deep-dive learning.


164-186: Approve testing guidance and manual API examples.

The manual API testing section with curl examples and integration testing guidance is practical and well-documented. The basic auth examples correctly reflect the implementation approach.


1-10: Commands in quick reference are correct and align with build.sh.

The documented build commands follow the correct syntax pattern and are supported by the build.sh script. Both ./build.sh build and ./build.sh --tags 'libdns_route53' build are valid, matching the expected ./build.sh [options] {build,install} usage pattern.


141-145: The documented module names are correctly implemented in the codebase. Both local_authdb (authentication configuration in util.go:50) and local_mailboxes (IMAP storage in util.go:69) are actively used in configuration handling throughout the CLI tools and tests. The descriptions match their actual implementations.


54-128: The global database variables are correctly initialized in api.go (lines 18-22) with the exact types referenced in the documentation. Verification confirms:

  • userDb (module.PlainUserDB) initialized at line 27 via openUserDB() and used in users.go handlers
  • imapDb (module.ManageableStorage) initialized at line 34 via openStorage() and used in imapAccounts.go handlers
  • mailboxes (Mailboxes) initialized at line 34 via openStorage() and used in imapAccounts.go for folder names

The documentation accurately reflects the actual implementation.

architecture.md (3)

125-138: REST API endpoints in architecture.md are accurate and consistent with the actual implementation in api.go. All 9 endpoints match their implementations, auth requirements are correctly specified, and query parameters/options are documented appropriately.


1-50: All file paths and module references in the documentation are verified and accurate. All REST API handler files (api.go, users.go, imapAccounts.go, util.go), upstream component files (internal/endpoint/smtp/smtp.go, internal/endpoint/imap/imap.go, internal/msgpipeline/msgpipeline.go, internal/storage/imapsql/imapsql.go), framework modules (framework/module/auth.go, framework/module/storage.go), and REST utility infrastructure (internal/rest/model/user.go, internal/rest/util/server/server.go, internal/rest/util/server/secure.go, internal/rest/util/middleware/basic_auth/basic_auth.go) exist in the repository. Module names PlainUserDB, ManageableStorage, and pass_table match their actual code interface definitions.


319-387: Verify database schema documentation against go-imap-sql implementation.

The documented schema tables (users, mboxes, msgs) and their columns should be verified against the actual go-imap-sql v0.5.1-0.20240831122236-655e4cb87d20 implementation in the schema.go and sql.go files of the foxcpp/go-imap-sql repository to ensure column names, types, and constraints match.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant