Module 1: Introduction
What is the project about?
Brief introduction to the course
Demonstration of the final result: Project, main Classes, Database
End result demo: Swagger, Postman, Docker and Hosting
Tools and dependencies required for the course
Module 2. Creating and customizing a project: basic structure and config files
Creating a Spring Boot project from scratch
Project structure
Customizing configuration files and profiles
Module 3: Spring Basics (IoC, DI). Repository on GitLab. RestController
Plan
Access to GitLab repository
Dependency injection via constructor (+GitLab, RestController, Interfaces)
Deploying Dependencies via Setter
Customizing service implementation via @Primery and @Qualifier annotations
Module 4. Working with Database. Flyway migrations. SQL queries and entities
Plan
Installing and connecting the Database (PostgreSQL)
Setting up configurations and connecting dependencies
SQL queries. CREATE, INSERT, DROP. Migration of data to tables.
Working with entities (Entity)
Module 5. GRUD operations. Controllers, services, repositories, DTO mapping
Plan
Technical note (working branches)
JpaRepository + @GetMapping, get data from the database
DTO, Service, Mapping, create response structure
Exception Handling: global error handler (@ControllerAdvice)
MapStruct, replace manual mapping in services (@Mapper)
POST request, add objects to the database via API
Data validation, @NotNull, @NotBlank and handling duplicates
PUT request: update data in the database via API
Lossless deletion, @DeleteMapping and softDelete
Pagination, big data processing (Pageable, Page)
Filtering, searching and sorting (Specification, Criteria API)
Module 6. Authentication, Security, Roles, and Access Rights Delineation
Accessing the GitLab repository
Plan
Adding a User entity. Extending the base schema
Search user by ID. Controller, service, mapping
User creation: POST-request, validation and saving
Linking Post and User. @ManyToOne, @OneToMany, FOREIGN KEY
Add the name of the post author (createdBy) to the API
Extend UserController: update, delete, search
Connect Spring Security. First security configuration
Password encryption. BCrypt and PasswordEncoder
Add user roles (User, Admin, SuperAdmin)
Add Role entity and link users to roles
Add roles to DTO. Update services and mapping
Implement JWT for authentication and authorization
Spring Security + UserDetailsService. Working with users
Preparing API for login. Request, validation, DTO
Implementing user authentication. JWT and login processing
Setting up Spring Security, closing endpoints and setting up API security
Add AuthController, test login process in Postman
Adding Refresh Token, new table and entity
Create RefreshTokenRepository and service to work with tokens
Validate and update Refresh Token, automatic session renewal
Add Refresh Token to API response, update mapping and service
Create endpoint for Refresh Token, test in Postman
Create DTO for new user registration
Implementation of the registration process + password hashing and token issuance
Adding password validation. Checking complexity and matches
Handling registration errors, improve validation and exceptions
Optimize registration code, move validations to a separate class
Bind posts to an authorized user, use JWT.
Restrict access to posts, method-level protection
Restrict access to endpoints via SecurityConfig
Optimizing access rights protection
Restricting access in User Service
Module 7. Implementation of Comment Service. GRUD, search and filtering
Plan
Preparing the database, creating the table and the Comment entity
Creating a DTO for the service
Repository and service layer implementation
Creating a controller (@RestController)
Adding a new comment (@PostMapping)
Updating comments (@PutMapping)
Deleting comments (@DeleteMapping)
Getting a list of all comments (findAll)
Searching, sorting and filtering of objects
Access restriction and service security
Module 8. Sprint Boot + Docker. Containerization and service management
Plan
Preparing the environment and installing Docker
Creating a Dockerfile, packaging an IAM service into a container
Building and running an application in a Docker container
Managing containers and images, useful commands
Module 9. Swagger and OpenAPI. API documentation
Plan
Basics of API documentation. OpenAPI vs Swagger
Plug Swagger into the project and configure Security
Configuring OpenAPI. JWT and endpoint groups
Customizing Swagger UI, improving the interface
Export API documentation: JSON, YAML and integration with Postman
Module 10. Unit tests, mocha data, service layer
Plan
Introduction to UserService testing (test overview)
Setting up the test environment [UserService]
Testing getting a user by ID [UserService]
Testing creating a new user [UserService]
[Post service] Patching dependencies, preparing test data
[Post service] Test getting a post by ID
[Post service] Test creating a new post
[Comment service] Mock dependencies, prepare test data
[Comment service] Test getting comments by ID
[Comment service] Test creating a new comment
[Auth service] Mock dependencies, prepare test data
[Auth service] Test login method (valid/invalid)
[Auth service] Test user registration
Module 11. Integration tests
Plan
Overview of integration tests (simple and advanced tests)
Writing the first integration test [UserController]
Negative scenarios and testing of access rights differentiation
Parsing a JSON response and checking the content of the response [advanced tests]
Integration tests for PostController, prepare data
Writing tests for PostController
Advanced API response tests [PostController]
Integration tests for CommentController
Module 12. Utilservice. New microservice for notifications and log collections
Plan
Basic project setup + GitLab and database connection
Creating action_logs table via Flyway migration (CREATE, INCERT INTO)
Creating entity and ENUM classes (@Entity, @Converter, stream, lambda)
Creating DTO, repository and service interface
GET method implementation, @Mapper, @RestController, testing in Postman
ExceptionHandler, findAll method + pagination (Page, Pageable)
Module 13. Bonus 1: Kafka
Communication between microservices.
Module 14. Bonus 2: Hosting
Deploying an application to hosting
Module 15. Bonus 3: CORS, Nginx
Integration of backend with web. CORS, Nginx