Architecture Philosophy
EverShop is a modular, TypeScript-first eCommerce platform built on a flexible architecture that allows for easy customization and extension. The platform is organized as a monorepo with a clear separation between core modules and extensions.Monorepo Structure
EverShop uses a monorepo structure located inpackages/:
Core Platform Structure
The main EverShop package (packages/evershop/) follows this organization:
Module Anatomy
Each module follows a standardized structure:Every module can contain any combination of these directories. Not all directories are required.
Extension System
EverShop supports extensions that follow the same structure as core modules:Core Modules
EverShop includes these core modules:- base - Fundamental configuration and utilities
- catalog - Products, categories, collections, attributes
- checkout - Cart, checkout flow, shipping
- customer - Customer accounts and authentication
- oms - Order management system
- cms - Content management and pages
- graphql - GraphQL schema and API
- auth - Authentication and authorization
- promotion - Coupons and promotions
- tax - Tax configuration and calculation
- stripe, paypal, cod - Payment methods
Configuration Schema
Modules can extend the configuration schema in theirbootstrap.js:
packages/evershop/src/modules/catalog/bootstrap.js
Library Organization
Thelib/ directory contains reusable core functionality:
- router/ - Route registration and matching
- middleware/ - Middleware parsing, sorting, and execution
- event/ - Event emitter and subscriber system
- componee/ - React component management
- webpack/ - Build configuration and compilation
- util/ - Registry, hooks, and utility functions
- postgres/ - Database connection
- locale/ - Internationalization
- log/ - Logging utilities
The architecture is designed to be extensible. Extensions can override or extend any part of the core system without modifying core files.
Build System
EverShop uses a dual-build approach:- Server-side: TypeScript compiled to JavaScript
- Client-side: React components bundled with Webpack
- API routes
- Page components
- GraphQL schemas
- Middleware functions
Registry and Processors
EverShop uses a processor pattern for extensibility. Processors allow modules to transform data at key points:Next Steps
Module System
Learn how modules are loaded and initialized
Routing
Understand route configuration and middleware