How toddbirchard/ghost-webhook-api works
Main Components
a) Core API Layer:
• FastAPI application at the center
• Endpoints into logical groups as shown in the app directory (posts, analytics, images, accounts, etc.)
b) External Services Integration:
• Ghost CMS (primary integration)
• Cloud Services:
• Google Cloud Storage (for CDN/images)
• BigQuery (for analytics)
• Email Services (Mailgun)
• Analytics Services:
• Plausible
• Algolia
• Mixpanel
• Authentication Services (Netlify Auth)
• Notification Services (SMS)
• Github API
c) Database Layer:
• SQL Database (shown by SQLAlchemy usage)
• Query management system (database/queries directory)
Component Relationships
1. Incoming Webhooks:
• Ghost CMS -> API Endpoints -> Business Logic -> Database/External Services
2. Data Flows:
• Image Processing: API -> GCS -> CDN
• Analytics: BigQuery/Algolia -> API -> Database
• Notifications: API -> Mail/SMS Services
• User Management: Netlify Auth -> API -> Ghost Members
Specific Implementation Details
a) API Layer (Top):
• Endpoints by feature modules (posts, analytics, images, etc.)
• Webhook entry points
b) Processing Layer (Middle):
• Business logic modules
• Image optimization pipeline
• Analytics aggregation
• Notification handling
c) Storage Layer (Bottom):
• Database with tables/models
• Query management system
• External storage (GCS)
Important Architectural Patterns to Highlight
• Modular design (shown by clear separation in app directory)
• Service-oriented architecture (multiple external service integrations)
• Event-driven architecture (webhook-based)
• Data pipeline patterns (analytics and image processing)
Technical Details
• Python 3.10+ runtime
• FastAPI framework
• SQLAlchemy ORM
• Pydantic models for data validation
• Google Cloud integration
• Ghost API v5.0.0 compatibility