How evershopcommerce/evershop works
Main Components
• Frontend Clients: Two distinct frontends exist – one for the customer “frontStore” and one for the administrative backend.
• GraphQL API Gateway: The central API is GraphQL based; it serves as a unified endpoint that aggregates functionality from the various modules.
• Core and Module Services: The monorepo organizes core commerce logic (the “evershop” package) and many discrete modules (catalog, auth, cms, checkout, customer, tax, oms, promotion, etc.). Each module encapsulates its own API endpoints, GraphQL types, resolvers, migration scripts, pages, and services.
• External Services & Integrations: These include payment processors (Stripe, PayPal, COD), file storage (Azure, AWS S3), email providers (SendGrid, Resend), and third-party authentication (Google Login). Also included are the integrations for shipping, notifications, and analytics.
• Database and Persistence: Although not explicitly shown, integration with a relational data store (Postgres is likely given the “postgres-query-builder” package and migration scripts) should be depicted.
Relationships & Interactions
• The React-based frontends communicate with the GraphQL API gateway, which in turn calls into the underlying modules.
• Each module has its own set of API endpoints (often using middleware, body parsers, and route files) that are orchestrated to process store operations – for example, product creation, category management, checkout, customer authentication, etc.
• The modules not only communicate with the database for CRUD operations but also emit and respond to events through internal event managers (e.g., for triggering email notifications using SendGrid/Resend or file operations using S3/Azure).
• The system supports extension and customization via a modular architecture, so the core platform loads extensions dynamically from “modules” and “packages” folders.
Architectural Patterns and Design Principles
• Modular/Extension-based Architecture: The monorepo is organized by packages, enabling easy plug-and-play of features. Each module is self-contained with its API, GraphQL types, migrations, and pages.
• Layered Separation: There is a clear separation between the presentation layer (React frontends), the business logic layer (GraphQL API resolvers and underlying services), and data persistence (Postgres and possibly external caches).
• Use of Middleware: Many modules leverage middleware functions (as shown by the file naming conventions for route validation, context injection, etc.) for handling API calls and data processing.
• External Integration Abstraction: Distinct packages abstract external integrations (e.g., google_login, s3_file_storage, sendgrid, and azure_file_storage), facilitating easy replacement or extension.
• Rectangles for internal modules and services.
• Notes on how Docker is used to package/deploy the entire application, emphasizing that deployment is containerized.
Detailed Steps for the Principal Software Engineer
c. From the API Gateway, branch out into the internal modules. Group these modules by their domain (e.g., Catalog-related modules, Customer/Authentication modules, Checkout, CMS, Payment, Promotion, etc.). Include sample module names if needed (as seen in packages such as “catalog”, “checkout”, “customer”, “cms”, “tax”, “paypal”, “stripe”, “cod”, “oms”, etc.).