How devcyberlearnix-art/cyberlearnixapi works
Purpose and topology
CyberLearnix is a Java/Spring LMS backend organized as independently deployable domain services. Gradle multi-project files (settings.gradle, build.gradle) coordinate modules; each service has a Spring Boot entry point and Dockerfile. The public edge is api-gateway/src/main/java/com/swachvega/apigateway/ApiGatewayApplication.java; local shared infrastructure is defined in docker/compose.yml and docker/init-databases.sql.
Edge gateway, identity, and authorization
The reactive API gateway routes requests, validates JWTs, and manages sessions backed by Redis. Its key request boundary is api-gateway/src/main/java/com/swachvega/apigateway/filter/JwtAuthenticationFilter.java, with session APIs in api-gateway/src/main/java/com/swachvega/apigateway/controller/SessionManagementController.java and Redis wiring in api-gateway/src/main/java/com/swachvega/apigateway/config/RedisConfig.java.
User service is the principal identity lifecycle owner: registration, unified login/refresh/password-reset/OTP flows, OAuth2 success handling, token blacklisting, sessions, audit logs, and instructor applications. Core paths: user-service/src/main/java/com/user/register/controller/UnifiedAuthenticationController.java, user-service/src/main/java/com/user/register/service/UnifiedAuthenticationService.java, and user-service/src/main/java/com/user/register/entity/UserSession.java. Services also contain local JWT filters/configurations; commonlibs/src/main/java/com/cyberlearnix/security/SharedJwtValidator.java provides a shared validation implementation.
Learning content and instructor operations
Course service owns learner-facing course structure and enrollment records: courses, sections, lectures, previews, and enrollments. Entry APIs are split across course-service/src/main/java/com/lms/courseservice/controller/CourseController.java, course-service/src/main/java/com/lms/courseservice/controller/EnrollmentController.java, and persistence entities under course-service/src/main/java/com/lms/courseservice/entity/.
Instructor service is a separate authoring and instructor-workflow boundary: instructor profiles, course/modules/content/resources, announcements/messages, dashboard and earnings data. It exposes authoring/public-course endpoints through instructor-service/src/main/java/com/example/instructorservice/controller/CourseController.java and instructor-service/src/main/java/com/example/instructorservice/controller/PublicCourseController.java; it integrates course data through instructor-service/src/main/java/com/example/instructorservice/integration/CourseIntegrationService.java. Cloudinary configuration indicates external media/document storage (instructor-service/src/main/java/com/example/instructorservice/config/CloudinaryConfig.java).
Discovery, cart, and promotions
Wishlist and cart are user-scoped commerce-preparation services. Both call course service through clients: wishlist-service/src/main/java/com/lms/wishlist_service/client/CourseClient.java and cart-service/src/main/java/com/lms/cart_service/client/CourseClient.java. Cart also calls coupons and handles checkout-oriented summaries in cart-service/src/main/java/com/lms/cart_service/service/CartServiceImpl.java.
Coupon service owns campaigns, coupons, usage/redeeming, validation, auto-apply, and referral/bulk operations. Its transactional boundary is represented by coupon-service/src/main/java/com/lms/coupon_service/entity/CouponUsage.java; service behavior is in coupon-service/src/main/java/com/lms/coupon_service/service/CouponServiceImpl.java. Redis is configured here (coupon-service/src/main/java/com/lms/coupon_service/config/RedisConfig.java).
Order, payment, and fulfillment flow
The commerce flow is synchronous service-to-service orchestration: order service reads cart and coupon state via Feign clients, persists orders/items/refunds, then payment service creates/verifies payment links/callbacks and handles refunds. Key integration points are order-service/src/main/java/com/lms/orderservice/client/CartClient.java, order-service/src/main/java/com/lms/orderservice/service/OrderService.java, and payment-service/src/main/java/com/lms/paymentservice/service/PaymentService.java.
Payment explicitly integrates PayU via payment-service/src/main/java/com/lms/paymentservice/service/PayUCommandService.java and payment-service/src/main/java/com/lms/paymentservice/service/PayUPaymentLinkService.java. It calls enrollment through payment-service/src/main/java/com/lms/paymentservice/client/EnrollmentClient.java, making successful payment the likely boundary that grants course access.
Engagement and moderation
Review service manages submitted reviews, ratings summaries, and administrative moderation. It verifies course/enrollment/user eligibility through Feign clients and fallbacks: review-service/src/main/java/com/lms/review/service/ReviewService.java, review-service/src/main/java/com/lms/review/client/EnrollmentClient.java, and review-service/src/main/java/com/lms/review/service/AdminReviewService.java.
Notification service persists notifications, delivery state, device tokens, templates, and user preferences; it supports course/instructor/admin/reminder workflows and sends push notifications through Firebase. Core paths: notification-service/src/main/java/com/example/notification/service/FirebasePushService.java, notification-service/src/main/java/com/example/notification/entity/DeviceToken.java, and notification-service/src/main/java/com/example/notification/service/NotificationService.java.
Administrative control plane
Admin service provides privileged authentication, bootstrap/main-admin setup, permission checks, audits, reports, and cross-service administration. It acts as an aggregation/orchestration layer through REST clients for users, courses, carts, coupons, instructors, notifications, and wishlists: admin-service/src/main/java/com/example/admin/controller/AdminController.java, admin-service/src/main/java/com/example/admin/service/AdminPermissionService.java, and admin-service/src/main/java/com/example/admin/client/AdminUserServiceClient.java. Its own persisted admin/course records and audit service establish a separate administrative authority boundary.
Main entry points: EnrollmentController.java Course & enrollment · ApiGatewayApplication.java API Gateway · AdminController.java Admin control plane · JwtAuthenticationFilter.java JWT & sessions
Components 18
Edge & Identity
- API Gateway · Public reactive request edge.
api-gateway/src/main/java/com/swachvega/apigateway/ApiGatewayApplication.java - JWT & sessions · Validates JWTs and manages Redis-backed sessions.
api-gateway/src/main/java/com/swachvega/apigateway/filter/JwtAuthenticationFilter.java - User identity · Owns registration, login, tokens, sessions, and account recovery.
user-service/src/main/java/com/user/register/service/UnifiedAuthenticationService.java - Shared JWT validator
commonlibs/src/main/java/com/cyberlearnix/security/SharedJwtValidator.java
Learning
- Course & enrollment · Owns learner course structure and enrollment records.
course-service/src/main/java/com/lms/courseservice/controller/EnrollmentController.java - Instructor authoring · Owns instructor workflows and authored course content.
instructor-service/src/main/java/com/example/instructorservice/controller/CourseController.java - Cloudinary · Stores instructor media and documents.
instructor-service/src/main/java/com/example/instructorservice/config/CloudinaryConfig.java
Commerce
- Wishlist
wishlist-service/src/main/java/com/lms/wishlist_service/client/CourseClient.java - Cart · Builds checkout-oriented user cart summaries.
cart-service/src/main/java/com/lms/cart_service/service/CartServiceImpl.java - Coupons · Owns campaigns, validation, redemption, and usage.
coupon-service/src/main/java/com/lms/coupon_service/service/CouponServiceImpl.java - Orders · Orchestrates cart and coupon state into orders, items, and refunds.
order-service/src/main/java/com/lms/orderservice/service/OrderService.java - Payments · Creates, verifies, and refunds payments; grants enrollment after success.
payment-service/src/main/java/com/lms/paymentservice/service/PaymentService.java - PayU
payment-service/src/main/java/com/lms/paymentservice/service/PayUCommandService.java
Engagement
- Reviews & moderation · Checks enrollment eligibility and moderates ratings.
review-service/src/main/java/com/lms/review/service/ReviewService.java - Notifications · Persists delivery state and notification preferences.
notification-service/src/main/java/com/example/notification/service/NotificationService.java - Firebase push
notification-service/src/main/java/com/example/notification/service/FirebasePushService.java
Admin
- Admin control plane · Provides privileged administration, permissions, audits, and reports.
admin-service/src/main/java/com/example/admin/controller/AdminController.java
Other components
- Local shared infrastructure · Defines local shared services and database initialization.
docker/compose.yml
Connections 25
- API Gateway → JWT & sessions: filters requests
- JWT & sessions → User identity: identity/session flows
- JWT & sessions → Shared JWT validator: validates with
- API Gateway → Course & enrollment: routes learner APIs
- API Gateway → Instructor authoring: routes authoring APIs
- API Gateway → Cart: routes commerce APIs
- API Gateway → Orders: routes checkout APIs
- Instructor authoring → Course & enrollment: integrates course data
- Instructor authoring → Cloudinary: stores media
- Wishlist → Course & enrollment: course lookup
- Cart → Course & enrollment: course lookup
- Cart → Coupons: applies coupons
- Orders → Cart: reads cart
- Orders → Coupons: reads coupon state
- Orders → Payments: initiates payment
- Payments → PayU: payment links & callbacks
- Payments → Course & enrollment: grants enrollment
- Reviews & moderation → Course & enrollment: verifies enrollment
- Notifications → Firebase push: sends push
- Admin control plane → User identity: administers users
- Admin control plane → Course & enrollment: administers courses
- Admin control plane → Coupons: administers promotions
- Admin control plane → Notifications: administers notifications
- JWT & sessions → Local shared infrastructure: Redis sessions
- Coupons → Local shared infrastructure: Redis cache