
Explore the architecture of a full-stack book shopping app built with Spring Boot, Angular, and PostgreSQL, featuring user and book CRUD, JWT security, role-based access, and deployment to Heroku.
Install java 11 as the long-term support version, note the six-month release cycle, and download and install it from Oracle with default settings.
Install IntelliJ IDEA using the free community version and compare it with the licensed edition, highlighting fast learning, code completion, and easy project results.
Learn to download and install PostgreSQL across operating systems, set the default postgres user password, and access the PGAdmin console on localhost for local database management.
Install and configure Lombok on IntelliJ, then enable annotation processing in settings to support server-side development and avoid getter and setter methods.
Download and install Postman, then use it for API testing by creating API points in your project and testing them with various request methods and authorization headers.
Explore how Spring enables dependency injection to build coupled apps. Learn to define beans with configuration and inject dependencies via constructor, setter, or field in repository, service, and controller components.
Explore how rest controllers handle http requests and responses, including get, post, put, and patch mappings, with request bodies and parameters shaping the response entity.
Explore SQL basics for CRUD operations, including creating databases and tables, primary keys, inserting and deleting records, and querying with select in relational databases.
Explore Lombok overview for Java, generating getters, setters, equals and hashCode, toString, and constructors automatically with @Data, @AllArgsConstructor, and @NoArgsConstructor.
Explore how git acts as a version control system that tracks file changes with commits and branches, and how GitHub hosts repositories for collaboration via pull requests.
Explore how the @RequestParam annotation captures query and form parameters from requests in Spring, including required vs optional, default values, and custom parameter names for API methods.
Explore how the PathVariable annotation handles template variables in REST API requests, mapping them to method parameters, customizing names, and making variables optional or required in Spring.
Explore how the @RequestBody annotation maps the HTTP request body to a transfer or domain object, using HTTP message converters to handle JSON content via libraries like Jackson.
Create your backend project with spring initializer in IntelliJ, choosing Gradle with Java 11, and add dependencies like security, Joab Persistence API, and Lombok.
Choose Gradle for project dependencies, citing easier configuration and better performance than Maven. Enable incremental builds by checking updated tasks and processing only changed files, shortening build times.
Learn to create a PostgreSQL database with PgAdmin by creating a login role, a database named DBI book, and a new schema, preparing for deployment on Heroku.
Configure database properties on application properties to customize spring defaults, using PostgreSQL with host, port, database, credentials, and schema, plus driver class name, dialect, and Hibernate ddl auto options.
Outline the project model and diagram for an online book shopping system, defining users, book, and purchase tables with roles for user, admin, and system manager.
Define user entity as JPA model mapped to users with username, password, name, and role (USER, ADMIN, SYSTEM_MANAGER), using generated id and Lombok accessors for sign in and sign up.
Explore primary key generation strategies in JPA with Hibernate, including auto, identity, sequence, and table generators, with practical examples and repository-based testing.
Create a book entity class as a jpa entity with an auto-incremented primary key, map to a table, include title, price, and description, and use lombok for getters and setters.
Implement the purchase history entity mapped to the purchase_history table with id, userId, bookId, price, purchaseDate, and createTime, using identity generation and Lombok @Data for getters, setters, equals, and hashCode.
Implement the user repository by creating a JpaRepository-based interface, benefiting from automatic CRUD, query derivation from method names, and custom queries with @Query and @Modifying for update operations.
Implement a purchase history repository extending JpaRepository, use projections to map joined results to a purchase item projection with title, price, and purchase time, enabling user id based queries.
Implement a spring user service to manage business logic, including save and find by username, change roles, and password encoding with repositories and transactional updates.
Create the book service interface and its implementation to encapsulate the business logic, using the book repository via dependency injection. Implement save book, latest by id, and find all books.
Implement the purchase history service layer in Spring by defining the service interface and implementation, wiring the repository, and adding save and find user purchase methods.
Learn how Spring Security authenticates users via HTTP filters, using a basic auth header with base64 credentials, then validates them with providers and updates the security context.
Explain how authorization in Spring Security uses interceptors and uri rules: permit all, deny all, and access for fully authenticated users, guided by access decision managers and voters.
Implement a user details service in spring security to load users by username, map roles to authorities with the role prefix, and secure authentication with jwt, providers, and security context.
Configure web security to customize the authentication manager and http security with JWT, enabling CORS, disabling CSRF, and enforcing stateless sessions for login and register endpoints under API authentication.
Fix a bean cycle in spring boot 2.6+ by enabling circular references in application properties, resolving a cycle between security config, custom user data service, and user service.
Explain jwt usage for authorization after authentication, show login with username and password, and implement by adding the jwt dependency to build.gradle and configuring secret and expiration.
Explore building a jwt provider in spring boot to generate tokens from authentication, extract authentication from authorization header, and validate token expiration with configurable secret and claims.
Create a custom JWT authorization filter, validate tokens, set the user in the security context, and order it before the username and password authentication filter in the security chain.
Implement the authentication service using an authentication manager to validate username and password and issue a jwt token by converting user info to a user principal and returning the token.
Create an internal authentication filter to authorize internal API requests with a secret access key. Map a super user role and set the security context with a username-password authentication token.
Configure the security filter chain so the internal filter runs before the JWT authorization and the username/password authentication filters, and use should not filter to target internal API parts.
In this course, we will create a new project like online-book-shopping.
When I say online-book-shopping application, we can think of it like that we will have a book-list page. Somehow users or customers will see these book-lists and they can buy one of them. Of course, at the end of it, this purchase will be stored and displayed later.
And we will implement this project using Spring Boot, Angular, and PostgreSQL.
In our project, we will implement CRUD operations. These CRUD operations will be for users and books. We will use users for user sign-in, sign-up and authorization operations. And we will use the books for creating, editing, deleting book operations.
These CRUD operations will be requested from Angular. So on the backend, we will create an infrastructure for these CRUD operations and on the frontend, we will serve them with the user interface.
Our project goes on with User and book operations.
Our main operations will be user login, register, book-list, create-book, delete-book etc.
Also, we will go on with the role based application. So we will use different roles like “Admin”, “User”. Then we will provide different authorizations to these users according to the role.
And this all things will be provided with a secure way in both Angular and Spring Boot.
We will have two main components to implement our project.
These are server side and client side.
In Server Side:
Of course here, our main library will be Spring-boot. We will implement the whole infrastructure on the backend with the Spring boot. It will provide easy and fast configuration to us.
We will implement the Model view controller architecture on our project.
Spring-security will be one of the main topics in our application. Also, we will use JWT to provide security.
In Spring Boot, Data will be presented to the client as an API call so Spring Rest Controller will be used to handle it.
We will use PostgreSQL as Database. We can use other databases also but at the end of it we will deploy our codes to Heroku. Postgresql can be used on Heroku for free so we chose that.
We will also use Object Relational Mapping with Java Persistence API and Hibernate.
You know, We can map our database tables to objects with hibernate.
We will use JPA Repository and Crud Repository in Spring Boot.
So these repository templates will handle common database operations like save, update, find, delete.
With Spring Boot, we will also use Lombok library to clear code.
You know that we don't want to implement getter, setter, equals and hash code. So we can escape it using Lombok @Data or @Value annotation.
We will use Gradle To handle all dependencies on server side.
For our all services, we will create cloud deployment with Heroku. Heroku is an amazing free framework. We can deploy our spring-boot projects with some configuration over github easily. So At the end of the course, we will have an application on production and we will have a code on github that is accessible by everyone.
That's all about Server side.
Let's talk about Client Side.
We will create an angular application on the client side and it will provide a cool user-interface. So we will create some pages like home-page, admin dashboard, login page and register-page. Then we will assign the server apis to these pages and we will consume and produce the data from the user-interface easily and user friendly.
On angular, we will also implement the model view controller architecture. We will use the cool features of typescript etc.
At the end of it, we will build it and we will serve it to heroku also. So at the end of the course, we will have a live application on production.
Last but not least, we will implement security and authorization on angular also. We will work with different roles and according to these roles, we will implement unauthorized and not-found pages on the user interface also.
We will see the details of them one by one.