How excali-studio/excali-api works
Main Components
a) External Services Layer:
• Google OAuth Service (for authentication)
• Frontend Client (Excali-front-wrapper)
• Excalidraw Room Service (for live collaboration)
b) API Gateway Layer:
• NestJS Application (main entry point)
• Swagger Documentation endpoint
• Authentication endpoints
• Session management
c) Core Modules Layer:
• Auth Module
• Google Strategy
• Guards (Authentication, Roles)
• Session Serializer
• Canvas Module
• Canvas Management
• Canvas Access Control
• Canvas Tags
• User Module
• User Management
• Role Management
d) Database Layer:
• PostgreSQL Database with entities:
• User
• UserRole
• Canvas
• CanvasAccess
• CanvasState
• CanvasTag
Relationships and Flows
• External client requests → API Gateway
• API Gateway → Auth Module → Google OAuth
• Auth Module → User Module for user management
• Authenticated requests → Canvas Module
• All modules → Database Layer
• Canvas Module → Excalidraw Room Service for live collaboration
Architectural Patterns to Highlight
• Module-based architecture (NestJS)
• Guard-based security pattern
• Repository pattern for data access
• Strategy pattern for authentication
Technical Details
• NestJS as the main framework
• Passport.js integration
• PostgreSQL database
• Session-based authentication
• REST API endpoints