Overview of the Stripe Service
mainStripeService class, which provides a wrapper around the Stripe API and encapsulates webhook handling logic.repository·main·Indexed 13 days ago
https://github.com/TryGhost/GhostAn open-source, headless Node.js CMS for professional publishing. The platform features a React-based Admin interface transitioning from legacy Ember via an Ember Bridge, a lightweight Preact-based Admin Toolbar, and the Admin X Framework for shared micro-frontend functionality. It supports both hosted (Ghost(Pro)) and self-hosted deployments via the Ghost CLI.
StripeService class, which provides a wrapper around the Stripe API and encapsulates webhook handling logic.Koenig is the post editor for Ghost. It consists of a React-based rich text editor UI and a suite of supporting TypeScript libraries that handle node definitions, rendering, and data conversion.
Key architectural components include:
The Acceptance tier provides full-app tests using the real Admin app (the same provider stack as src/main.tsx) booted in a real Chromium instance via Vitest Browser Mode. Instead of a real server, it uses a fake Ghost Admin API served in-browser via MSW.
Key Characteristics:
renderAdminApp call gets a fresh QueryClient and the fake API resets between tests. There is no page reload.renderAdminApp mounts into a stand-in of the production host page (using the react-admin body class and #root), ensuring scroll-driven behaviors like virtualized lists and infinite paging work as they do in production.window.EmberBridge events) is unreachable because there is no Ember app in this tier. If a component relies on ember-bridge hooks, the test must be moved to the e2e/ tier.@tryghost/kg-html-to-lexical package provides functionality to convert HTML strings into Lexical editor state objects. This is useful when migrating content or integrating HTML-based content into a Lexical-powered editor environment.Portal is the visitor-facing membership widget embedded on a Ghost site. It is responsible for managing the following visitor journeys:
Portal is the visitor-facing membership widget that is embedded on a Ghost site. It serves as the primary interface for members and handles the following workflows:
Detailed implementation context can be found in apps/portal/CONTEXT.md.
In this tier, any request not handled by a fake returns a 418 error. This is used to identify missing fakes in the app's network graph. If a test fails with a 418, you must either:
renderAdminApp.fakeEndpoint(method, url, response) for external origins.allowUnhandledRequests() for a single test if you want to opt-out (e.g., when navigating to a different app like Settings or ActivityPub that owns its own request graph).Important Rules:
EXTERNAL_URL_BLOCKLIST in worker.ts to ensure forgotten fakes fail the test rather than hitting the real network in CI.fakeEndpoint only serves JSON bodies. For image URLs, point them at a non-blocklisted host.When a member signs up for a paid plan, the following sequence occurs:
customer.subscription.created, checkout.session.completed, customer.subscription.updated, and invoice.payment_succeeded). Ghost uses these events to upsert member/subscription data and record payments.