How bigtreemin/playedu works
Project type and purpose
• PlayEdu is a full-stack, front-end/back-end separated e-learning platform.
• It comprises three React-based UIs (Admin, PC, H5/mobile) and a modular Spring Boot 3 monolithic API.
• Uses MySQL for persistence, Redis for caching & locking, Nginx as reverse-proxy/static server, and Docker Compose for container orchestration.
File structure
• Top-level “docker” and “compose.yml” define containers: mysql, redis, nginx, and the API/front-ends.
• “playedu-admin”, “playedu-pc”, “playedu-h5”: three independent React apps built with Vite, TypeScript, Less/SCSS.
• “playedu-api”: a multi-module Maven project with submodules:
• playedu-common (shared DTOs, utils, configs, mappers, services)
• playedu-system (system checks, migrations, AOP aspects)
• playedu-course (domain/services/mappers for courses)
• playedu-resource (domain/services/mappers for resource/video uploads)
• playedu-api (SpringBootApplication, controllers, interceptors, event listeners)
README
• Confirms stack: Java + MySQL + Spring Boot + React18.
• Describes front-end ports (9800, 9801), API port (9700), and quick start via Docker Compose (port 9900 for admin).
Main components
• Front-end UIs
• Admin portal (React18)
• PC student portal (React18)
• H5/mobile portal (React18)
• Reverse proxy / static server: Nginx container routing domains/ports to front-ends and API
• API container: Spring Boot monolith (playedu-api)
• MySQL container (persistent data)
• Redis container (caching, distributed locks, rate-limiting scripts)
• File storage volume: mounted path for uploaded courseware/videos (or S3‐compatible store if configured)
Relationships and interactions
• User browsers → HTTP(S) → Nginx → serves static files or proxies API calls
• React UIs ↔ REST API endpoints in Spring Boot (backend controllers → service layer → mappers → MySQL/Redis)
• Spring events (ApplicationEventPublisher) → internal listeners for domain events (e.g., CourseDestroyEvent)
• Redis used by Spring (via RedisConfig) for caching frequently read data (course cache, user-see-course cache) and locks (RedisDistributedLock)
• Docker Compose networks all containers; volumes ensure data persistence
Architectural patterns & design principles
• Modular monolith: logically separated Maven modules loaded into one Spring Boot process
• Layered architecture: Controllers → Services → Mappers (MyBatis-Plus) → Database
• Event-driven internals: bus/listener pattern for lifecycle events
• AOP aspects for permissions, logging, locking
• Front-end/back-end separation with well-defined API contracts (JSON)
Technologies & frameworks
• Front-end: React18 + Vite + TypeScript + Less/SCSS + Axios-style HTTP client
• Back-end: Spring Boot 3 + MyBatis-Plus + Sa-Token (auth) + Spring Events + SaTokenConfig + RedisConfig
• DB: MySQL 8.x
• Cache: Redis
• Containerization: Docker, Docker Compose, Nginx
• Build: Maven (multi-module)