How forever-violet/oce works
Project type and purpose
• This is a full-stack, multi-module examination system (“一键生成考卷系统”) that automates exam creation and management.
• It consists of:
• A Vue3+TypeScript SPA (ocepgen-ui)
• A Spring-Boot admin backend (ocepgen-admin)
• A code-generation service (ocepgen-generator)
• Shared Java libraries (ocepgen-common, ocepgen-dynamic-datasource)
• Persistence (MySQL) and caching (Redis)
File structure
• Top-level modules:
• ocepgen-ui: front-end UI, Vite build, static assets, Vue Router & Pinia store
• ocepgen-admin: SpringBoot REST API, layered (controller/service/dao), AOP (logging, data-filter), Quartz jobs, OSS integration, Shiro security
• ocepgen-generator: SpringBoot code-generator service + its own front UI
• ocepgen-common: shared DTOs, utils, Redis config, base service/DAO
• ocepgen-dynamic-datasource: AOP aspect and config for multi-DB dynamic routing
• Docker files and docker-compose.yml suggest containerized deployment.
README
• Confirms tech stack: Spring Boot + MyBatis-Plus + Shiro + Quartz + Druid + Vue3 + Element Plus + Vite
• Outlines modules: job, log, oss, security, sys, exam, question, course
• Mentions MySQL initialization and Swagger, and OSS providers (Aliyun, Qiniu, Qcloud)
Main components
a. Frontend:
• Browser / ocepgen-ui (Vue3 SPA)
b. Backend services:
• Admin Service (ocepgen-admin SpringBoot)
• Generator Service (ocepgen-generator SpringBoot)
• Shared modules (ocepgen-common, ocepgen-dynamic-datasource)
c. Data stores:
• Primary relational DB (MySQL)
• Redis cache
d. External integrations:
• OSS providers (Aliyun/Qiniu/Qcloud)
• Email SMTP (for notifications)
• Swagger UI (documentation)
Relationships and interactions
• UI → Admin Service: HTTP(S)/Axios REST calls (authentication, CRUD, exam generation, scheduling, OSS uploads)
• UI → Generator Service: HTTP calls to generate code templates
• Admin Service → MySQL: MyBatis-Plus mappers
• Admin Service → Redis: caching, data-scope permissions
• Admin Service → OSS cloud: via RestTemplate, dynamic credentials
• Admin Service → Quartz scheduler: triggers DB-backed tasks
• Generator Service → MySQL: reads schema metadata
• Both services reference ocepgen-common and dynamic-datasource libs at build time
Architectural patterns and principles
• Layered MVC (Controller → Service → DAO → DB)
• AOP for cross-cutting concerns: logging, data filtering, dynamic datasource switching
• Shared-library pattern: common utils and config extracted into separate modules
• Template-driven code generation (Velocity/VM)
• Microservice-like separation: admin vs. generator, each SpringBoot app can scale independently
Must-include
• Arrowheads with verbs or protocols (e.g., “GET /api/courses”, “MQ trigger”, “Redis GET/SET”)