# linlinjava/litemall architecture

> Architecture diagram of the GitHub repository linlinjava/litemall, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/linlinjava/litemall
- Repository: https://github.com/linlinjava/litemall

## Overview

##### Project type and purpose
- This is a full-stack, multi-module e-commerce system (“litemall”) supporting:
- A Spring Boot-based Java backend (multi-module Maven project).
- A Vue admin console frontend.
- A Vue mobile web frontend.
- Two WeChat Mini Program frontends (litemall-wx and renard-wx).
- It implements shop functionality (products, cart, orders, coupons, group buys, user management) and an admin platform (member, product, order, marketing, system and config management).

##### File structure
- Top-level directories/modules:
- deploy/docker: scripts, Dockerfiles, docker-compose for DB and services.
- litemall-db: MyBatis-generated DAO/mapper layer and SQL scripts (MySQL).
- litemall-core: shared services (storage, SMS/notify, express/logging, config, utils).
- litemall-admin-api and litemall-wx-api: backend Spring Boot REST services for admin console and WeChat Mini Program.
- litemall-all / litemall-all-war: fat-jar/WAR packaging modules bundling all Spring Boot services.
- litemall-admin: Vue-based SPA for administrators.
- litemall-vue: Vue-based mobile web storefront.
- litemall-wx and renard-wx: two WeChat Mini Program clients.
- doc: architecture, Nginx, database, API docs; docker and deploy subdirs.
- .github/workflows & .workflow: CI/CD pipelines for build/test/deploy.

##### README for additional insights
- Technology stack graphic: Spring Boot, Vue, WeChat Mini Program.
- Deployment instructions reference local MySQL, Java fat-jar launch, npm dev servers, Docker, Nginx configs.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Clients
    subgraph "Clients"
        AdminSPA["Admin SPA (Vue)"]:::frontend
        MobileSPA["Mobile Web SPA (Vue)"]:::frontend
        MiniA["WeChat Mini Program A"]:::frontend
        MiniB["WeChat Mini Program B"]:::frontend
    end

    %% Java Backend Modules
    subgraph "Java Backend"
        AdminAPI["litemall-admin-api (Spring Boot)"]:::backend
        WXAPI["litemall-wx-api (Spring Boot)"]:::backend
        Core["litemall-core (shared services)"]:::backend
        DBLayer["litemall-db<br/>(MyBatis DAOs & SQL)"]:::database
        AllJar["litemall-all (Fat JAR packager)"]:::backend
        AllWar["litemall-all-war (WAR packager)"]:::backend
    end

    %% Infrastructure
    subgraph Infrastructure
        DockerCompose["docker-compose.yml"]:::infra
        Dockerfile["litemall/Dockerfile"]:::infra
        DeployScripts["deploy/bin/*.sh"]:::infra
        CI["CI/CD pipelines"]:::infra
        Nginx["Nginx Proxy<br/>(doc/conf/nginx.conf)"]:::infra
    end

    %% External Services
    subgraph "External Services"
        SMS["SMS Gateway"]:::external
        Storage["Cloud Storage"]:::external
        Express["Express API"]:::external
    end

    %% Client to API interactions
    AdminSPA -->|"REST/JSON over HTTPS"| AdminAPI
    MobileSPA -->|"REST/JSON over HTTPS"| AllJar
    MiniA -->|"REST/JSON over HTTPS"| WXAPI
    MiniB -->|"REST/JSON over HTTPS"| WXAPI

    %% API to Core and DB
    AdminAPI -->|"calls"| Core
    WXAPI -->|"calls"| Core
    AdminAPI -->|"MyBatis/JDBC"| DBLayer
    WXAPI -->|"MyBatis/JDBC"| DBLayer

    %% Packaging bundler
    AllJar -->|"bundles APIs"| AdminAPI
    AllJar -->|"bundles APIs"| WXAPI

    %% API to External
    AdminAPI -->|"SMS/SDK"| SMS
    WXAPI -->|"SMS/SDK"| SMS
    Core -->|"Storage SDK"| Storage
    Core -->|"Express HTTP"| Express

    %% Deployment flow
    CI -->|"triggers"| DockerCompose
    DeployScripts -->|"scripts"| DockerCompose
    DockerCompose -->|"deploys"| AdminAPI
    DockerCompose -->|"deploys"| WXAPI
    DockerCompose -->|"deploys"| DBLayer

    %% Click Events
    click AdminSPA "https://github.com/linlinjava/litemall/tree/master/litemall-admin/"
    click MobileSPA "https://github.com/linlinjava/litemall/tree/master/litemall-vue/"
    click MiniA "https://github.com/linlinjava/litemall/tree/master/litemall-wx/"
    click MiniB "https://github.com/linlinjava/litemall/tree/master/renard-wx/"
    click AdminAPI "https://github.com/linlinjava/litemall/tree/master/litemall-admin-api/"
    click WXAPI "https://github.com/linlinjava/litemall/tree/master/litemall-wx-api/"
    click Core "https://github.com/linlinjava/litemall/tree/master/litemall-core/"
    click DBLayer "https://github.com/linlinjava/litemall/tree/master/litemall-db/"
    click AllJar "https://github.com/linlinjava/litemall/tree/master/litemall-all/"
    click AllWar "https://github.com/linlinjava/litemall/tree/master/litemall-all-war/"
    click DockerCompose "https://github.com/linlinjava/litemall/blob/master/docker/docker-compose.yml"
    click Dockerfile "https://github.com/linlinjava/litemall/tree/master/docker/litemall/Dockerfile"
    click DeployScripts "https://github.com/linlinjava/litemall/blob/master/deploy/bin/deploy.sh"
    click DeployScripts "https://github.com/linlinjava/litemall/blob/master/deploy/bin/reset.sh"
    click DeployScripts "https://github.com/linlinjava/litemall/blob/master/deploy/bin/stop.sh"
    click CI "https://github.com/linlinjava/litemall/blob/master/.github/workflows/main.yml"
    click CI "https://github.com/linlinjava/litemall/blob/master/.workflow/BranchPipeline.yml"
    click CI "https://github.com/linlinjava/litemall/blob/master/.workflow/MasterPipeline.yml"
    click CI "https://github.com/linlinjava/litemall/blob/master/.workflow/PRPipeline.yml"
    click Nginx "https://github.com/linlinjava/litemall/blob/master/doc/conf/nginx.conf"

    %% Styles
    classDef frontend fill:#8FBC8F,stroke:#333,stroke-width:1px
    classDef backend fill:#87CEFA,stroke:#333,stroke-width:1px
    classDef database fill:#FFA500,stroke:#333,stroke-width:1px
    classDef external fill:#FF6347,stroke:#333,stroke-width:1px
    classDef infra fill:#D3D3D3,stroke:#333,stroke-width:1px
```
