
Explore the architecture of a microservices online course app with API gateway, purchase service, Eureka discovery service, and an Angular frontend, using JWT security and multiple databases for data storage.
Compare monolithic and microservice architectures, noting advantages and disadvantages for large projects, and see how microservices split apps into independent services with own databases.
Create a closed enrollment app with course listings, purchases, login, admin dashboard, admin and user roles, profile purchases, payouts, using Spring Boot and Spring Cloud microservices with an Angular frontend.
Install Java 11 as the minimum supported version, explain long-term support concepts, and download and install the Oracle JDK with default settings after signing into Oracle.
Install IntelliJ community edition for the course, highlighting its ease of use, code completion, and fast learning curve, while noting license options and available TypeScript support and database tools.
Install and configure Lombok in IntelliJ before 2021, and enable annotation processing in settings to bypass boilerplate getter and setter methods for server-side code.
Download and install Postman to test APIs for your project. Use Postman to create API endpoints, test all request methods, and set authorization headers after registration.
Explore how Spring's dependency injection creates loosely coupled systems by using interfaces and repositories, and learn bean creation, configuration, and common annotations for components, services, and controllers.
Explore rest controllers in Spring and use get, post, put, and patch mappings to process requests, handle parameters and payloads, and return responses with response entity.
Learn sql basics and basic CRUD operations by creating databases and tables, defining primary keys, and performing create, insert, delete, and select queries with standard sql syntax.
Explore how Lombok simplifies Java model classes by auto-generating getters, setters, equals and hashCode, and by creating no-args and all-args constructors for immutable and mutable patterns.
Learn how the Spring @RequestParam annotation extracts query and form parameters from REST API requests. Customize parameter names, mark parameters optional or required, and set default values.
Explore how the PathVariable annotation extracts template variables from URIs, binds them to method parameters, and controls requiredness and naming in Spring REST APIs.
Understand how the @RequestBody annotation maps the HTTP request body to a method parameter and uses HttpMessageConverters, like Jackson, to convert JSON or XML when library is on the classpath.
Install PostgreSQL on your system with a simple setup, click next to apply default configurations, set the default postgres user password, and access the PGAdmin console via localhost.
Builds a course microservice architecture with mvc and rest api, enabling course crud operations like list, edit, and delete, secured by Spring Security.
Create your first microservice using Spring Initializer by configuring a Maven Java project with PostgreSQL, Spring Security, JPA/REST repositories, Eureka discovery client, and Lombok, then import and start coding.
Create a PostgreSQL database and a login role with admin privileges using pgAdmin, set the owner to admin, create a database template, and configure a schema for future connections.
Configure application properties for spring cloud microservices by setting service name, ports, and a PostgreSQL data source with credentials and active schema; enable hibernate settings and disable the Eureka client.
Define a course model as a JPA entity mapped to a database table, with identity id and fields for title, price, and create date, plus column annotations and Lombok.
Master the four primary key generation strategies in Hibernate and JPA: auto, identity, sequence, and table generators, with practical examples and testing guidance.
Create a course repository by extending Spring Data JPA repository to enable basic CRUD operations, auto-generated queries like find by title, and support for pagination, sorting, and custom queries.
Define a course service in the business layer, with an interface and implementation annotated with @Service, wired to the repository, and capable of saving, deleting, and finding courses for controllers.
Create a course controller to map REST API requests to the core service, inject dependencies, and expose endpoints to save, delete, and fetch all courses via the /api/course endpoint.
Authenticate users with Spring Security by decoding a base64 basic authorization token via HTTP filters and validating credentials with authentication providers to establish a security context.
Explore authorization architecture in Spring Security, using interceptors and UARS to enforce access, and explain how access decision managers and voters—role, authenticated, and remember-me—grant or deny.
Explore how Spring Security handles authentication and authorization through default and custom configurations, including form login and basic header authentication, session management, CSRF, CORS, public endpoints, and role-based access control.
Configure spring security for the course microservice by enabling web security, defining in-memory users with basic authentication, and customizing authorization rules and password encoding via properties.
Explore Postman, an API development tool for building, testing, and sending HTTP requests with headers and authorization types. Learn to save APIs and generate code in multiple languages.
Test the course microservice endpoints with Postman by starting the Spring application from the main class and using basic authorization to call save, get all, and delete api routes.
Architect the purchase service to model user–course purchases with secure Spring Boot APIs, while implementing an MVC structure, H2 database, Hibernate mapping, and Lombok to reduce boilerplate.
Create a second spring boot microservice using spring initializr with maven, java 11, mvc, security, jpa, rests repositories, h2, eureka client, loan book, then import into IntelliJ.
Configure application properties for a microservices setup by customizing the application name and service ports. Configure the H2 in-memory database with data source credentials, driver, dialect, and JPA settings.
Create a purchase entity in model package as a JPA entity mapped to a table, with id, user ID, course title, price, purchase time, and Lombok for getters and hashCode.
Create a purchase repository by extending JPA repository to enable automatic CRUD operations and derived queries, including find by title and find by user id, in a Spring Data context.
Implement the purchase service class in Spring to handle business logic, connect to the purchase repository, and expose save and find all purchases methods.
Define and wire the purchase controller as a RESTful endpoint in Spring, using @RestController, @RequestMapping, and dependency injection to call the purchase service and return HTTP responses.
Configure security on the purchase microservice by enabling in-memory authentication and web security adapters, disable CSRF, and use properties for username and password with password encoding.
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-angular.
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 Angular to consume all data which come from these microservices. And we will provide a user-friendly UI with angular.
Our microservices dependency process will be like that.
Clients can access the system from the UI. On angular-UI,users can take different actions like creating courses, purchasing courses etc. All requests coming from angular-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.