You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🐘 Looking for the Laravel & Livewire edition? A companion monolithic edition built with Laravel 13, Livewire 3, and Laravel Reverb is available at: https://github.com/mfarim/laravel-elearning
A full-featured web-based E-Learning and Computer Based Test (CBT) platform for managing modern academic learning activities between Admin, Teacher, and Student. Built as a containerized modular monolith with a decoupled SPA frontend: Java 21 LTS, Spring Boot 3.5+, React 19, and Tailwind CSS v4, featuring stateless JWT authentication with Redis-backed refresh-token rotation and impersonation, WebSocket STOMP real-time candidate proctoring, and Apache POI Excel batch processing.
The platform is a modular monolith (one Spring Boot service split into domain modules) with a separate React SPA, deployed as Docker containers on a VPS behind Cloudflare, with defense-in-depth at every layer. Data model, request flows, design decisions, and scaling limits are documented in docs/ARCHITECTURE.md.
Method-level security (@PreAuthorize) on all administrative and user directory endpoints; classroom ownership validation preventing IDOR on assignments and discussions; STOMP WebSocket ChannelInterceptor verifying teacher/admin privileges.
A02: Cryptographic Failures
BCrypt password hashing; HMAC-SHA256 JWT tokens with mandatory 256-bit+ secret key validation on application boot; automated fail-fast if JWT_SECRET is missing.
A03: Injection
100% parameterized Spring Data JPA queries eliminating SQL Injection; no OS command execution; strict input DTO @Valid constraints.
A04: Insecure Design
Examination answer keys and explanations strictly stripped (null) from student payloads; examination duration deadlines enforced on the server-side, not trusting client clocks.
A05: Security Misconfiguration
Spring Boot Actuator endpoints strictly blocked (404) from public Nginx reverse proxy; all Docker service ports bound to loopback 127.0.0.1; security headers (X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN) enforced.
A06: Vulnerable Components
Java 21 LTS, Spring Boot 3.5.7, PostgreSQL 16, Redis 7, React 19. Multi-stage Docker containers running under non-root spring:spring user.
A07: Identification Failures
Login Rate Limiter: 5 attempts per minute per account email and 100 per minute per IP address (sized for a computer lab behind one public IP, APP_RATE_LIMIT_LOGIN_PER_IP), returning 429 Too Many Requests with Retry-After header. Signed-in API calls are limited per user, not per IP.
Anti-cheat proctoring violation alerts logged with student NIS; internal /actuator/health probe available for container healthchecks.
A10: SSRF
Zero user-controlled outbound HTTP requests from backend services.
🏗️ Real-Time Telemetry & WebSocket Architecture
The live examination monitoring feature uses Spring WebSocket with STOMP and Spring's in-memory simple broker to push candidate progress to the teacher in real time. Answers and attempts are persisted in PostgreSQL first, then an event is broadcast. Moving to a Redis/RabbitMQ broker relay for multi-instance deployments is on the roadmap (see docs/ARCHITECTURE.md).
Use the optimized multi-stage backend/Dockerfile and frontend/Dockerfile.
Configure external production PostgreSQL and Redis connection strings in environment variables (SPRING_DATASOURCE_URL, SPRING_DATA_REDIS_HOST).
Set a strong JWT secret (JWT_SECRET) with a minimum of 256 bits.
Deploy behind Nginx or Cloudflare with SSL/TLS termination and WebSocket header forwarding (Upgrade and Connection headers).
Add your public domain to APP_CORS_ALLOWED_ORIGINS (also used as the allowed WebSocket origins).
Default accounts must change their password on first login. Set APP_DEMO_MODE=trueonly on a public demo instance with shared demo accounts.
Keep SPRINGDOC_ENABLED=false and APP_REGISTRATION_ENABLED=false unless you need them.
The refresh token is an httpOnly Secure cookie, so serve the app over HTTPS. Set APP_REFRESH_COOKIE_SECURE=false only for plain-HTTP local runs (the local docker-compose.yml already does).
The SPA sends a Content-Security-Policy. If you enable analytics, allow its hosts on the frontend container, e.g. CSP_SCRIPT_SRC_EXTRA="https://www.googletagmanager.com" and CSP_CONNECT_SRC_EXTRA="https://*.google-analytics.com".
Several backend instances: set APP_REALTIME_MODE=redis, APP_RATE_LIMIT_STORE=redis, and APP_STORAGE_TYPE=s3 with APP_STORAGE_S3_BUCKET (plus APP_STORAGE_S3_ENDPOINT and APP_STORAGE_S3_PATH_STYLE=true for MinIO), and enable sticky sessions for /ws. Details in docs/ARCHITECTURE.md.
Time zone: exam schedules and deadlines are compared against the backend's clock. The image runs in Asia/Jakarta (WIB); set APP_TIMEZONE=Asia/Makassar (WITA) or Asia/Jayapura (WIT) for other regions. Change it outside exam hours: attempts in progress are timed against this clock.
Real client IP / rate limiting: the backend trusts X-Forwarded-For only from internal proxies (Docker network). If the site is behind Cloudflare, restore the visitor IP on the host Nginx, otherwise all users share Cloudflare's IPs for rate limiting:
# http {} block of the host nginx — keep the list in sync with https://www.cloudflare.com/ips/set_real_ip_from173.245.48.0/20; # ...add every Cloudflare IPv4/IPv6 range
real_ip_header CF-Connecting-IP;# and in the proxied location:proxy_set_header X-Forwarded-For $remote_addr;
📄 License
This project is open-sourced software licensed under the MIT license.
About
E-Learning for online examination at Junior high school