
Explore the architecture of a microservices-based online course application, including API gateway, user management, authentication and authorization, course and purchase services, React frontend, and discovery via Eureka.
Compare microservices with monolithic apps, highlighting independent modules, separate databases, and scalable deployments, and their impact on continuous integration and deployment pipelines.
Build a full-stack course enrollment app with home, purchase, login, and admin dashboard, featuring role-based access, error handling, and profile purchase details via springboard microservices backend and React frontend.
Install Java 11 as the minimum long-term support version by downloading the Oracle installation file from the Oracle downloads page, signing in, and installing with default settings.
install IntelliJ, weigh free community vs licensed version, note faster learning curve, code completion, and easy default setup before starting.
Install and configure Lumbergh, the library for the server side, to escape getter and setter methods. Enable annotation processing in settings to complete the setup.
Download and install Postman to test APIs. Create API endpoints and test them with Postman, using various request methods and authorization headers.
discover how spring boot uses dependency injection to build loosely coupled systems with beans and configuration, using constructor, setter, or field injection, and annotations like component, repository, service, and controller.
Explore how http requests move between client and server using get, post, put, and patch mappings in spring controllers, enabling read, create, update, and partial update with response entities.
Explore sql basics for relational databases, including creating databases and tables, defining primary keys, and performing create, read, and delete operations with insert and select statements.
Discover how Lombok reduces boilerplate by generating getters, setters, equals and hashCode, and constructors with @Data, @NoArgsConstructor, and @AllArgsConstructor, enabling immutable and well-encapsulated classes.
Learn how the @RequestParam annotation in Spring handles query parameters and form parameters in REST APIs. Configure parameter names with name property, set required or optional, and provide default values.
Explore the PathVariable annotation in Spring to extract URI template variables and map them as method parameters, with optional customization of variable names and handling required versus optional path variables.
Explore how the @RequestBody annotation maps an HTTP request body to a domain object and how Spring uses HTTP message converters, including Jackson, to handle JSON and other content types.
Download and install PostgreSQL for your operating system, launch the installer, and use default configurations with a password for the default user. Open pgAdmin on localhost to manage servers.
Explore the architecture and concerns of the course microservice, implement course CRUD operations, and expose a secure REST API using Spring Security, MVC, and PostgreSQL, with Hibernate ORM and Lombok.
Create your first microservice with Spring Initializr, using a Maven Java project and dependencies like security, persistence API, REST repositories, PostgreSQL, Eureka client, and Lombok; import into IntelliJ.
Create and configure a PostgreSQL database using pgAdmin, including defining a login role with admin privileges, creating a database, and setting up a schema and user permissions.
Configure application properties for Spring Cloud microservices by setting the service name, ports, and PostgreSQL data source details (host, port, db name, credentials), plus active schema and Hibernate settings.
Model a course as a JPA entity with identity generation, including title, price, and create date, mapped by table and column annotations, and Lombok Data for getters and equals.
Explore primary key generation strategies in Spring Data and Hibernate, including auto, identity, sequence, and table generator, with practical examples, repository testing, and best-use guidance.
Implement the course repository by extending JpaRepository to enable automatic CRUD operations and query generation, such as findByTitle, with support for custom queries, pagination, and sorting.
Implement the course service class as the business layer, inject the course repository, and provide save, delete, find by id, and find all methods.
Build a course controller that maps rest api requests to the core service, and implement save, delete by id, and get all courses methods with dependency injection.
Explore how Spring Security authenticates users via http filters and the basic authentication filter, decoding base64 username and password, validating with authentication providers, and storing the security context.
Explore authorization architecture in Spring Security, using interceptors and access decision managers and voters to grant or deny access based on roles, authentication status, and remember-me.
Explore how Spring Security manages authentication and authorization, covering default configurations and customization from form login and basic authorization headers to session policies, csrf protection, and role-based access controls.
Configure in-memory authentication with basic authentication to secure all microservices using predefined users. Extend web security configuration with an authentication manager, define usernames, passwords, roles, and load credentials from properties.
Install Postman and discover its API development capabilities for building, testing, and sending HTTP requests, then convert calls to code across languages.
Start the Spring application and test the course endpoints with Postman, sending authorized post, get, and delete requests for save course, find all courses, and delete course.
Explore the purchase service architecture as the second microservice, mapping user and course relations via a Springboard MVC REST API, with h2 in-memory, hibernate, lombok, and security.
Create a spring boot microservice via spring initializer with maven and java 11, include mvc, security, jpa, rest repositories, h2, eureka client, and loan book, import to IntelliJ.
Configure application properties for Spring Cloud microservices by setting the application name, per-service ports, an in-memory H2 database, and data source credentials, driver, dialect, while disabling the Eureka client.
Implement the purchase entity in model package as a JPA entity, with id, userId, title, price, and purchase time, mapped to a database table, using Lombok for getters, setters, and hashCode.
Implement the purchase repository class by extending JPA repository, enabling automatic basic database operations and derived queries such as findByTitle, findByPriceGreaterThan, and findByUserId.
Create a Spring purchase service in the business layer, implement save and find all purchases, wire in the purchase repository via dependency injection, and expose methods to controllers.
Create a purchase controller in spring, wire it to the purchase service via dependency injection, expose REST API endpoints under /api/purchase, and return responses with created status.
Configure in-memory authentication and web security for the purchase microservice, defining predefined users and roles, enabling http basic auth, and securing endpoints with encoded credentials.
In this course, we will create a project like an online-course-application.
When I say online-course-application, we can think of it like that we will have a product-list page such as book-list, food-list or course-list. Somehow users or customers will see these product-lists and they can buy one of the products. Of course, at the end of it, this transaction will be logged.
Actually, in our application, we will try to implement these processes with different microservices.
To implement this application, we will use five different microservices.
Our microservices will be api-gateway, course-service, purchase-service, eureka-discovery-service and frontend-with-react.
In api-gateway, we will manage APIs. This microservice will be a gateway for the whole application. To access the other services, we will use this microservice. In this microservice, we will handle user-management also. We will authorize users and if the users are authorized, other services can be available.
In course-service, we will manage course CRUD operations. This service will be a course-management-service.
In purchase-service, we will manage purchase CRUD operations. This service will store the logs coming from the course purchases. For example, the UserX bought the CourseX on DateX etc.
Our other microservice will be eureka discovery service. To provide it we will use spring-cloud-netflix-eureka library.
This microservice allows services to find and communicate with each other without hard coding hostname and port.
With eureka service, other services can register eureka servers and all of them can reach each-other with application name.
These four microservices will be used for server side.
On the client side, we will use React to consume all data which come from these microservices. And we will provide a user-friendly UI with react.
Our microservices dependency process will be like that.
Clients can access the system from the UI. On react-UI,users can take different actions like creating courses, purchasing courses etc. All requests coming from react-UI will go to api-gateway. So all traffic will pass over api-gateway.
To access the api-gateway, the client should pass the login process. Then other services will be accessible over the api-gateway.
Spring-security will be one of the main topics in our application. Also, we will use JWT to provide security.
Here, the important point is, we will also use secure connections among microservices. To provide it, we will use secure-key-tokens.
As a database, we will use MySQL, PostgreSQL and H2Database. We will use different databases to show the functionalities of microservices.
We will provide connections between microservices with the OpenFeign library. OpenFeign will handle connection problems in the gateway.
Also, on the backend to provide the connection among all microservices, we will use eureka discovery server. Eureka-discovery-server will be aware of all microservices and it helps to create connections between microservices easily.
In addition to these libraries, In our project, we will use lots of technologies like Spring Boot, Spring Security, Hibernate, MySQL, PostgreSQL, Maven, Lombok, JWT etc.
Of course here, our main library will be Spring-boot. It will provide a simpler and faster way to set up, configure, and run rest API applications.
At the end of each microservices, we will test our applications with Postman. Postman is another amazing tool to debug networking.