Spring Boot service for managing courses in an EdTech platform. The application models courses, course materials, and enrollments and exposes REST endpoints for course lookup, lifecycle management, and user enrollment.
The service acts as a course catalog and enrollment backend for an EdTech system. Administrators can create and update courses, learners can view course details, and the platform can enroll users into courses while coordinating with user and payment services.
- List all courses
- Retrieve courses by id, name, or instructor
- Inspect course materials for a course
- Create, update, and delete courses
- Enroll a user in a course
- Verify users through a user-service Feign client before enrollment
- Create a payment record through a payment-service Feign client after enrollment
- Provide a Hystrix fallback for enrollment failures
- Persist course, material, and enrollment data with JPA
- Return simple success/error messages for course operations
GET /coursesGET /courses/{id}GET /courses/name/?name=...GET /courses/courseMaterial/?id=...GET /courses/instructor/?instructor=...POST /coursesPUT /courses/{id}DELETE /courses/{id}POST /courses/course/{courseId}/register/{userId}
The v5 snapshot moves the service-to-service communication into Feign clients.
- The API receives a course id and user id.
- The service calls the user-service client to verify the user exists.
- If the course exists, an
Enrollmentrecord is created and stored. - The service calls the payment-service client to create a payment record.
- If the remote call fails, the controller returns a fallback response.
user-serviceviaEdTech.Course.feign.UserServicepayment-serviceviaEdTech.Course.feign.PaymentServiceRestTemplatebean remains available for compatibility with the existing configuration
Courserepresents the core catalog itemCourseMaterialstores content tied to a courseEnrollmentlinks users to coursesCourseDtois used for create and update requestsResponseMessagestandardizes simple API responsesPaymentis used when forwarding enrollment charges to the payment service
- Main application port:
8081 - Datasource:
edtech_course_service - Hibernate is configured for
updatemode - The service uses Spring Boot 2.7.13
- The app registers a load-balanced
RestTemplatebean for service-to-service calls - Hystrix fallback support is enabled for enrollment requests
- Java 17
- Spring Boot 2.7.13
- Spring Data JPA
- Spring JDBC
- Spring Web
- Spring Cloud LoadBalancer
- Spring Cloud OpenFeign
- Hystrix
- MySQL
- Lombok
- The repository is intended to be extended with additional enrollment and payment workflows.
- The current service layer includes Feign-based user and payment integration.
- Generated build output is intentionally not tracked in git.