How ajacques/certmanager works
Main System Components
Frontend Layer:
• React components (under app/javascript/components)
• Asset pipeline (CSS/JS under app/assets)
• HAML templates (under app/views)
Application Layer:
• Rails Controllers (app/controllers)
• Models (app/models)
• Background Jobs (app/jobs)
• Mailers (app/mailers)
Infrastructure Layer:
• Nginx (reverse proxy)
• Unicorn (app server)
• Redis (for caching and job queues)
• PostgreSQL (primary database)
• Resque (background job processing)
Component Relationships
a) Client-facing flow:
Client → Nginx → Unicorn → Rails Application
b) Background processing flow:
Redis ← Resque Worker ← Scheduler
c) Data flow:
Rails Application ↔ PostgreSQL
Rails Application ↔ Redis
Specific Components to Highlight
Certificate Management:
• Certificate model (app/models/certificate.rb)
• Certificate bundles (app/models/certificate_bundle)
• Public/Private key management (app/models/public_key.rb, private_key.rb)
• ACME integration (app/controllers/lets_encrypt_controller.rb)
Service Integration:
• Service deployments (app/models/service/*)
• Agent system (app/models/agent.rb)
• Background jobs for deployment (app/jobs/deploy_certificate_job.rb)
Important Architectural Patterns
• MVC pattern implementation
• Background job processing architecture
• Service-oriented deployment system
• Certificate lifecycle management
• Authentication/Authorization flow
Specific Implementation Details
• OAuth integration points
• Let's Encrypt ACME challenge flow
• Certificate deployment paths
• Monitoring and health check endpoints
• Email notification system