How kennymario3012/documenso works
High-Level Architecture Components
a) Frontend Layer:
• Marketing App (apps/marketing) - Next.js-based marketing website
• Web App (apps/web) - Main application interface
b) API Layer:
• tRPC Router (packages/trpc)
• REST API (packages/api)
• NextAuth.js Authentication
• As a middleware layer between frontend and backend
c) Core Services Layer:
• Document Service (packages/lib/server-only/document)
• Signing Service (packages/signing)
• User Service (packages/lib/server-only/user)
• Team Service (packages/lib/server-only/team)
• Template Service (packages/lib/server-only/template)
• Webhook Service (packages/lib/server-only/webhooks)
d) Infrastructure Layer:
• PostgreSQL Database (via Prisma ORM)
• Email Service (packages/email)
• Storage Service (for PDFs)
• Redis Cache
• Stripe Integration (for payments)
Key Interactions to Highlight
a) Document Flow:
• Upload → Processing → Storage → Signing → Completion
• PDF manipulation and signing processes
• Webhook triggers
b) Authentication Flow:
• User Registration/Login
• 2FA Authentication
• Passkey Support
• Session Management
c) Team Collaboration:
• Team Management
• Document Sharing
• Permission Controls
Integration Points
• External Email Providers
• Stripe Payment Processing
• S3-compatible Storage
• Webhook Consumers
• PDF Processing Tools
Specific Implementation Details
• Next.js server components architecture
• TRPC endpoint organization
• Database schema relationships
• Email template flow
• PDF signing certificate handling
Remember to include:
• Version control integration points
• CI/CD pipeline connections
• Error handling flows
• Data backup paths
• Security certificate management
• Rate limiting and protection layers
This architecture should reflect the modern, open-source nature of the project while maintaining enterprise-grade security and scalability features.