How streetwriters/notesnook-sync-server works
Main Components
• Streetwriters.Identity – This service acts as the Identity Server. It manages user accounts, multi-factor authentication (MFA), account signups, and other authentication-related features. Notice many controllers (AccountController, MFAController, SignupController) and supporting services (TokenGenerationService, MFAService).
• Streetwriters.Messenger – This service provides the messaging infrastructure, including server-sent events (SSE) and heartbeat signaling. It is responsible for the real-time push or notification mechanisms.
• External dependencies – The README and docker-compose indicate dependencies such as MongoDB (for data storage) and Minio (for S3-compatible storage). Include these as external components that are critical to the system’s operation.
Out the Relationships
• Clients (e.g., the Notesnook client apps) will interface with one or more of these services. You want to show separate communication channels:
• Clients communicate with Notesnook.API for sync operations.
• Authentication/authorization flows pass through the Streetwriters.Identity service.
• Real-time notifications and server-sent event flows are managed by Streetwriters.Messenger.
• That Notesnook.API is likely a consumer of the MongoDB database (via Streetwriters.Data) for storing sync data and possibly also communicating with Minio/S3 for file or object storage.
• The Identity service similarly interacts with MongoDB and uses its own helper methods for token generation, email sending, and MFA.
• The Messenger service may also interact with the database or use in-memory/shared state to maintain heartbeat services and message dispatching.
Architectural Patterns & Design Principles
• The API project follows a layered (MVC-like) architecture separating Controllers, Models, Services, and Repositories.
• Use of real-time communication (via SignalR hubs and SSE endpoints) and an event-driven messaging design, with components like EventSources and MessageHandlers.
• Main services: Notesnook.API, Streetwriters.Identity, Streetwriters.Messenger.
• Shared libraries: Streetwriters.Common, Streetwriters.Data.
• External resources: MongoDB (document storage) and Minio (or S3-compatible storage).
• Service communications: API endpoints for sync, RESTful endpoints for identity, real-time hubs (SignalR/SSE) for Messenger.
Details
• Be explicit with labels for endpoints (e.g., specify that the API uses “Controllers,” “Hubs,” and “Authorization Extensions”).
• Including deployment details (Docker, docker-compose) to show how the orchestrator schedules each container and manages their interactions.