Skip to main content

Introduction

EverShop is built on a modular, extension-based architecture that separates business logic from presentation. This design allows you to extend functionality without modifying core files, ensuring upgradability and maintainability.

Core Technology Stack

Backend

  • Runtime: Node.js
  • Framework: Express.js
  • Database: PostgreSQL
  • API: REST + GraphQL

Frontend

  • Library: React 19
  • Styling: Tailwind CSS
  • Rendering: SSR (Server-Side Rendering)
  • Build: Webpack + Parcel

Architectural Principles

1. Modular Extension System

EverShop uses a plugin architecture where all custom functionality is encapsulated in extensions:
Extensions are isolated modules that can provide APIs, GraphQL types, page components, event subscribers, and scheduled jobs.

2. Theme System

Themes handle visual presentation only and are separate from business logic:
Never put business logic in themes. Use extensions for APIs, database operations, and business rules.

3. Component-Based Pages

Pages are assembled from React components using an area-based layout system:
The layout export determines where (areaId) and when (sortOrder) the component renders.

Request Flow

1

HTTP Request

Client sends request to Express server
2

Route Matching

EverShop routes the request based on route.json files in extensions
3

Middleware Chain

Request passes through middleware functions (named with [middleware] prefix)
4

Business Logic

Extension handles the request (API endpoint, page component, etc.)
5

Response

  • API: Returns JSON response
  • Page: Renders React components server-side with GraphQL data

API Request Example

Middleware functions are executed in alphabetical order based on their [middleware] prefix.

Page Request Example

Event-Driven Architecture

EverShop includes an event system for decoupled functionality:
Subscribers respond to events like product_created, order_placed, customer_registered, etc.

Scheduled Jobs (Cron)

Extensions can register scheduled tasks:

GraphQL Integration

EverShop uses GraphQL for data fetching in page components:
Components can query this data using the query export:

Build Process

  • Hot-reload enabled
  • TypeScript compilation on-the-fly
  • File watching for extensions and themes
  • Source maps enabled
  • Compiles all TypeScript to JavaScript
  • Bundles frontend assets
  • Optimizes for performance
  • Output goes to .evershop/ and dist/ directories
Never edit files in .evershop/ or dist/ directories. These are generated during build and will be overwritten.

Key Directories

Next Steps

Project Structure

Explore the directory layout and file organization

Configuration System

Learn how to configure EverShop using JSON files