How shuhongfan/sky-take-out works
Project Type and Purpose
• This is a full-stack “苍穹外卖” (Sky Take-Out) application comprising:
• A Vue+TypeScript admin web app (project-rjwm-admin-vue-ts)
• A Weixin Mini Program client (mp-weixin) for end users
• A Java SpringBoot backend (sky-take-out with sky-common, sky-pojo, sky-server modules)
• Nginx for serving static assets, reverse proxy and load balancing
• Demonstration/sample modules (springcache-demo, etc.) used in training
File Structure
• Top-level:
• .idea, PPT, Readme.md, assets – training materials
• mp-weixin – Weixin Mini Program code
• nginx-1.20.2 – Nginx distribution, conf for reverse proxy/load balancing
• project-rjwm-admin-vue-ts – Admin front-end SPA
• sky-take-out – Java backend multi-module Maven project
• springcache-demo, other subdirs – demo applications
• Backend follows layered MVC:
• sky-common (constants, exceptions, utils)
• sky-pojo (entities, DTOs, VOs)
• sky-server (controllers, services, mappers, config, tasks, WebSocket)
• Front-ends:
• Admin SPA built with Vue, router, store, Element UI, charts, service worker
• Mini Program built with uni-app components
README Insights
• Describes system comprised of:
• 管理端 (Admin): employee/category/dish/setmeal/order management, data statistics, voice reminders
• 用户端 (Mini Program): WeChat login, menu browsing, cart, checkout, order history
• Tech stack:
• User layer: Vue.js, Element UI, ECharts, Weixin Mini Program
• Gateway: Nginx (static, reverse proxy, load balancing)
• Application: SpringBoot, SpringMVC, Spring Task, Spring Cache, JWT, Swagger/Knife4j, MyBatis, WebSocket, Ali OSS, HTTPClient, POI
• Data: MySQL, Redis
Main Components
a. Clients:
• Browser (Admin SPA)
• Weixin Mini Program (mp-weixin)
b. Gateway:
• Nginx – serves /sky static assets, proxies /api/ to backend cluster
c. Backend Monolith/Cluster:
• SpringBoot app (sky-server) – HTTP REST controllers (/admin/, /user/, /notify/**)
• Scheduler (Spring Task) for order status cleanup, reminders
• WebSocket server for live order notifications
• JWT interceptors for admin and user authentication
d. Data Services:
• MySQL – core relational data (employees, categories, dishes, orders, cart, etc.)
• Redis – caching (pagehelper, Spring Cache), session or temporary data
• Ali OSS – image/file storage via HTTPClient
• External Services: WeChat Pay (PayNotifyController), SMS/voice (HttpClientUtil)
Relationships and Data Flows
• Admin SPA / Mini Program → Nginx → SpringBoot REST controllers
• Controllers → Services → MyBatis Mappers → MySQL
• Service layer uses Spring Cache/Redis for hot data (e.g., dish listings)
• File uploads/downloads → Ali OSS
• Order events → WebSocket → Mini Program to push live updates
• Scheduled tasks → cleanup stale orders, send reminders via WebSocket or SMS
• Swagger/Knife4j exposes /doc.html for API documentation
Architectural Patterns & Principles
• Layered MVC architecture in backend (Controller / Service / Mapper)
• Front-end/back-end separation with a gateway (Nginx)
• Stateless JWT-based auth with interceptors
• Caching layer (Redis) for performance
• Asynchronous notifications via WebSocket
• Scheduled tasks via Spring Task for periodic processing
• Externalized configuration (application-dev.yml, application.yml) for environments
Important: Detail over breadth
• Break the backend into sub-components: Auth (JWT), Order, Dish, User, Reporting
• Interceptors and tasks as distinct modules
• Service interactions with Redis vs direct DB calls
• Convey load-balancing/upstream if multiple SpringBoot instances are deployed