How pneum4/molip works
1. This is a three-tier monorepo: a Vue/TypeScript frontend, a Spring Boot backend, and a separate Python AI service. The backend is the system of record for users, workspaces, courses, sessions, quizzes, reviews, and live-chat state. The AI service is a processing tier for speech, emotion, Q&A, and quiz generation.
2. The frontend is organized by role and workflow rather than by generic UI widgets. Major view areas are Common, Admin, Learner, and Trainer, with a separate Live session experience and a Review/Statistics area. Pinia stores hold the application state for courses, sessions, live room state, quiz state, workspace state, and user state, while composables such as recording/timer and utilities such as MediaPipe/gaze tracking support the real-time classroom UX.
3. The backend is a modular Spring Boot application with clear domain boundaries: member/auth, workspace management, course management, session/live-class management, quiz generation and scoring, chatting/Q&A, and post-class review/analytics. Each domain has its own controller, service, repository, entity, DTO, and exception set, so the architecture is a classic layered application with strong domain separation.
4. Authentication and request protection are cross-cutting concerns in the backend. JWT-based auth is wired through security/filter configuration, and the shared filter/config stack also includes logging, async execution, and global exception handling. Workspace membership and role checks are important because most major features are permissioned by workspace, trainer, or learner role.
5. The live class path is the most complex subsystem. The frontend’s live views connect to the backend for session control and to Janus/WebRTC for media transport. Backend classes under session/janus and WebSocket configuration indicate that signaling, JWT handshake validation, and live collaboration are mediated centrally, while the actual audio/video stream is handled by the WebRTC infrastructure.
6. Real-time interaction is split into multiple channels: WebSocket-based messaging for chat, Q&A, alerts, and analysis updates; gRPC streaming for low-latency AI calls; and WebRTC/Janus for the video room itself. In the backend, dedicated handlers and interceptors forward emotion, concentration, and voice data, then listeners persist or redistribute those signals to interested clients.
7. The AI service is a separate FastAPI application with its own gRPC server and generated protobuf contracts. Its servicers are divided by capability: speech-to-text, emotion analysis, Q&A over RAG, quiz generation, and connection testing. Supporting modules include model loading, ChromaDB access, and service-layer logic for retrieval-augmented responses and analysis inference.
8. The shared protobuf files in backend/src/main/proto and ai/protos define the contract between Java and Python services. That boundary is important: the backend orchestrates product behavior, while the AI service performs specialized computation and streams results back. This keeps the high-throughput AI workload isolated from the main business API.
9. Persistence is polyglot and role-specific. MySQL/JPA is used for core transactional entities such as members, workspaces, courses, sessions, quizzes, and chat records. MongoDB is used for analysis-style documents and timelines where flexible time-series aggregation matters. Redis supports low-latency session/cache use cases and ordered timeline retrieval, and the README indicates Redis Sentinel is used for HA in deployment.
10. Event-driven processing is a key internal pattern in the backend. Domain events such as emotion, concentration, STT, and Q&A saves are published and handled asynchronously, then aggregated for review dashboards or pushed to Redis/Kafka as needed. The session and review services are therefore decoupled from the raw live-input flow.
11. The review subsystem turns raw session telemetry into learner-facing and trainer-facing reports. It combines STT transcripts, emotion graphs, concentration timelines, AI-generated quiz artifacts, and session statistics. This subsystem reads from both transactional storage and analytical storage, then exposes summary endpoints for charts and review pages.
12. Course, quiz, and workspace management form the B2B LMS core. Workspaces control tenant boundaries and invite/join flows, courses manage enrollment and certification rules, and quizzes handle exit quizzes plus AI-generated “surprise” or review questions. The automatic certification logic is driven by attendance, concentration, and quiz score data collected from live sessions.
13. Deployment is designed as an integrated multi-service stack. The repo includes Dockerfiles, docker-compose, Nginx, Jenkins, and EC2-oriented artifacts, which suggests a single deployed platform composed of frontend, Spring Boot backend, FastAPI AI, Redis/Sentinel, MongoDB, Kafka, and Janus/WebRTC services behind a unified domain.
14. For an architecture diagram, the main boundaries to draw are: client UI, backend business API, live media infrastructure, AI processing service, and data stores/streaming infrastructure. The most important flows are: user actions from frontend to backend, live session media through Janus, analysis signals from session to AI and back via gRPC/WebSocket, and persisted analytics flowing into review dashboards and certification logic.
Main entry points: SessionController.java Session/live class · server.py gRPC server · LiveVideoConsole.vue Live UX · LearnerLiveSessionView.vue Learner area
Components 28
Frontend
Vue/TypeScript client organized by role and workflow
- App shell · Bootstraps the SPA and route/layout composition
frontend/src/main.ts - Common UI · Landing, login, workspace selection, and mypage flows
frontend/src/views/Common/LandingPage.vue - Admin area · Workspace governance, join requests, and member management
frontend/src/views/Admin/AdminWorkspaceView.vue - Learner area · Learner courses, live class, review, statistics, and workspace views
frontend/src/views/Learner/LearnerLiveSessionView.vue - Trainer area · Trainer courses, live class, workspace, and statistics views
frontend/src/views/Trainer/TrainerLiveSessionView.vue - Live UX · Live console, video area, chat, Q&A, quiz, and engagement controls
frontend/src/components/Live/Console/LiveVideoConsole.vue - Pinia state · Stores for member, workspace, course, session, quiz, live, and stats state
frontend/src/stores/live.ts - Realtime utils · Recording, timer, MediaPipe, and gaze tracking helpers
frontend/src/utils/mediapipe.ts
Backend
Spring Boot business API and real-time orchestration
- Spring app · Backend application bootstrap and module wiring
backend/src/main/java/com/edumax/molip/MolipApplication.java - Security stack · JWT auth, security filters, logging, async, and exception handling
backend/src/main/java/com/edumax/molip/common/config/SecurityConfig.java - Workspace domain · Workspace, membership, roles, invites, and join flows
backend/src/main/java/com/edumax/molip/domain/workspace/controller/WorkspaceController.java - Member auth · Login and member identity management
backend/src/main/java/com/edumax/molip/domain/member/controller/AuthController.java - Course domain · Course creation, enrollment, certification, and course stats
backend/src/main/java/com/edumax/molip/domain/course/controller/CourseController.java - Session/live class · Session control, Janus signaling, analysis events, and participant state
backend/src/main/java/com/edumax/molip/domain/session/controller/SessionController.java - Quiz domain · Exit quiz creation, scoring, and voice/STT event handling
backend/src/main/java/com/edumax/molip/domain/quiz/controller/QuizController.java - Chat/Q&A · Session chat, Q&A messages, and listeners for persisted message flow
backend/src/main/java/com/edumax/molip/domain/chatting/controller/ChattingController.java - Review analytics · Aggregates transcripts, emotion, concentration, and quiz artifacts into reports
backend/src/main/java/com/edumax/molip/domain/review/controller/ReviewController.java
AI Service
FastAPI gRPC processing tier for speech, emotion, and quiz generation
- gRPC server · FastAPI gRPC server exposing capability-specific servicers
ai/app/grpc/server.py - Speech/STT · Speech-to-text inference and voice analysis
ai/app/grpc/servicers/stt_servicer.py - Emotion · Emotion and concentration inference for live signals
ai/app/grpc/servicers/emotion_servicer.py - Q&A RAG · Retrieval-augmented question answering for session and review contexts
ai/app/grpc/servicers/qna_servicer.py - Quiz gen · Quiz generation and answer support
ai/app/grpc/servicers/quiz_servicer.py
Data & Infra
Shared persistence, messaging, and live media infrastructure
- MySQL/JPA · Core records for members, workspaces, courses, sessions, quizzes, and chat
backend/src/main/resources/database/DDL.sql - MongoDB · Flexible analysis documents and timelines
backend/src/main/java/com/edumax/molip/common/config/MongoConfig.java - Redis/Sentinel · Low-latency session cache and ordered timeline state with HA sentinel setup
backend/src/main/java/com/edumax/molip/common/config/RedisConfig.java - Kafka · Asynchronous domain event distribution for live-input processing
backend/src/main/java/com/edumax/molip/common/config/KafkaConfig.java - Janus/WebRTC · Video room and media transport for live sessions
backend/src/main/java/com/edumax/molip/domain/session/janus/SessionJanusService.java - Proto contracts · Shared protobuf definitions between Java backend and Python AI service
backend/src/main/proto/stt.proto
Connections 42
- App shell → Common UI: routes to · SPA routes render role/workflow views
- App shell → Admin area: routes to · Admin screens are mounted from the app shell
- App shell → Learner area: routes to · Learner workflows are routed through the shell
- App shell → Trainer area: routes to · Trainer workflows are routed through the shell
- Learner area → Live UX: uses · Learner live session experience embeds real-time UI
- Trainer area → Live UX: uses · Trainer live session experience embeds real-time UI
- Live UX → Pinia state: reads/writes · Live UI is driven by shared Pinia stores
- Learner area → Pinia state: reads/writes · Learner pages use course, session, quiz, and user state
- Trainer area → Pinia state: reads/writes · Trainer pages use course, session, and stats state
- Live UX → Realtime utils: supports · Recording, timer, and gaze utilities support live session UX
- Live UX → Session/live class: calls · Session control and live-state APIs
- Common UI → Member auth: calls · Login and member identity flows
- Common UI → Workspace domain: calls · Workspace discovery, join, and admin actions
- Learner area → Course domain: calls · Learner course and enrollment flows
- Trainer area → Course domain: calls · Trainer course management and stats
- Learner area → Review analytics: calls · Review and statistics views fetch analytics summaries
- Trainer area → Review analytics: calls · Trainer statistics and post-class review data
- Spring app → Security stack: wires · Application bootstrap enables security and cross-cutting config
- Security stack → Member auth: protects · JWT-authenticated member access
- Security stack → Workspace domain: protects · Workspace roles gate most features
- Workspace domain → Course domain: authorizes · Workspace membership and roles bound course operations
- Course domain → Session/live class: coordinates · Courses own sessions and certification inputs
- Session/live class → Chat/Q&A: publishes · Live session chat/Q&A channels are mediated centrally
- Session/live class → Quiz domain: feeds · Live signals support quiz and analysis flow
- Session/live class → Review analytics: emits · Session telemetry is aggregated into review data
- Chat/Q&A → Kafka: events · Message and analysis events are distributed asynchronously
- Session/live class → Redis/Sentinel: caches · Live state and ordered timeline data use Redis
- Review analytics → MongoDB: reads · Analytical timelines and documents are loaded for reports
- Review analytics → MySQL/JPA: reads · Persistent session, quiz, and course records are joined into summaries
- Course domain → MySQL/JPA: persists · Course, enrollment, certification, and workspace-linked transactional data
- Session/live class → MySQL/JPA: persists · Session and participant records are stored transactionally
- Quiz domain → MySQL/JPA: persists · Exit quiz definitions, answers, and results are stored transactionally
- Session/live class → Janus/WebRTC: signs · Janus handshake and live room signaling
- Session/live class → Proto contracts: contracts · Backend shares protobuf definitions with AI service
- gRPC server → Proto contracts: implements · Python servicers implement the shared protobuf contract
- gRPC server → Speech/STT: serves · Speech-to-text capability
- gRPC server → Emotion: serves · Emotion and concentration capability
- gRPC server → Q&A RAG: serves · RAG-based Q&A capability
- gRPC server → Quiz gen: serves · Quiz generation capability
- Session/live class → gRPC server: streams to · Low-latency analysis calls are sent over gRPC
- Quiz domain → gRPC server: streams to · Quiz generation requests are delegated to AI service
- Live UX → Janus/WebRTC: connects to · Client video transport uses Janus/WebRTC infrastructure