How phunguyen-byte/lilishop works
The Lilishop project is a full‐featured e-commerce “mall” system offering multiple frontends (buyer/PC, seller/store, platform manager/admin, mobile app, and even an IM service) and a rich backend with a modular architecture. In other words, it is not a single monolithic application but a distributed collection of RESTful API services and consumers—with a shared framework library—that cover most aspects of an e-commerce platform, from goods and orders to promotions, payments, messaging, and scheduling.
Major layers and components
• Frontend Clients:
– Buyer/PC Web Interface (mall storefront)
– Seller Dashboard (store management)
– Platform Manager/Admin (back-office)
– Mobile App/uniapp client (also supporting mini programs)
– IM/Chat clients (websocket based)
• API Services:
– Separate modules like “buyer-api”, “manager-api”, “seller-api”, “im-api” and “admin” show that each business role or domain (buyer, seller, admin/manager, IM) has its own dedicated service.
• Shared Modules and Framework:
– The “common-api” and the extensive “framework” directory contain business domain modules (goods, orders, promotions, store management, payment, logistics, analytics, etc.). These represent core business logic and shared libraries.
• Asynchronous/Background Components:
– “consumer” module: Dedicated event consumers to process asynchronous operations (e.g. order events, notifications, status changes).
– “xxl-job” directory, which provides the scheduled task engine for timed and delayed jobs.
• Infrastructure & External Systems:
– The “DB” directory with SQL scripts indicates a central relational database (MySQL) for persisting application data.
– Caches (Redis + MongoDB) and a search engine (Elasticsearch) are used, as mentioned in the README.
– Message broker (RocketMQ) is evident from both the file names and the messaging modules under “rocketmq” and “trigger” directories.
– Additional support components include Docker for containerization, Nginx for load balancing, and OSS for static resource storage.
– Security (JWT, Spring Security), logging (Log4j/Logback), and database connection pooling (Druid) form part of the cross-cutting concerns.
Relationships and interactions
– Buyer API (buyer-api)
– Seller API (seller-api)
– Manager API (manager-api)
– Admin Service (admin)
– IM API (im-api)
• That the “common-api” and “framework” modules are used by many of these services to provide common business logic.
• A dedicated “Consumer” component (and optionally a “Message Queue” component) – illustrating that asynchronous events (like order updates, promotions, notifications) flow from API services into RocketMQ and are processed by the consumer module.
• “xxl-job” scheduler as a separate component that triggers periodic jobs such as statistics updates or batch processes.
• Central “Database” (MySQL) that all services interact with for CRUD operations.
• Additional external systems such as “Cache” layers (Redis/MongoDB), “Search Engine” (Elasticsearch), and “OSS” for static resources.
• Finally, indicate integration with third-party services (SMS, payment gateways, and logistics providers).
Architectural patterns and design principles
• The design is based on a microservices—or at least a modular—architecture, with clear border separation between the API services that serve different client roles.
• Both synchronous RESTful calls (client to service) and asynchronous messaging (services to consumer via RocketMQ).
• That a “shared framework” layer supports cross-cutting features like security, token generation, caching strategies and distributed tasks.
• The frontends are completely decoupled from the backend services to facilitate a full “前后端分离” (front-end/back-end separation) architecture and distributed deployment.
Relevant technologies
• Backend: Spring Boot, Spring MVC, MyBatis-Plus, Spring Security, Druid, RocketMQ, and xxl-job for scheduling.
• Frontend: Vue.js with Vue Router/Vuex (for Manager and Seller dashboards) and uni-app for mobile.
• Infrastructure: MySQL, Redis, MongoDB, Elasticsearch, Docker, Nginx, OSS.
• Communication: RESTful APIs, JWT-based authentication, and asynchronous messaging.
• Additional modules: A robust business framework layer (“framework” directory) and consumer modules for handling business events.