Amplicode Launch Event – ​​a pipeline for Spring applications directly in IntelliJ IDEA

Last week the team Amplicode held a meetup that lasted for a whole 3.5 hours! During this time, six reports were held, covering all aspects of developing applications on Spring – from setting up the environment to creating business logic and implementing the admin panel on React Admin.

History and Philosophy of Amplicode (Ilya Kuchmin)

Ilya Kuchmin, developer of Amplicode, opened the meetup with a story about how the product was born, where it is heading now, and what problems it helps solve.

Local Environment with Docker Compose for Spring Boot (Kirill Tolkachev)

Then Georgy Vlasov (Developer Advocate Amplicode) and Kirill Tolkachev (member of the JUG RU Group program committee) joined the meetup. They discussed the application they were going to work with and the tasks that needed to be solved. The first step was setting up a local environment with Docker Compose and adding services for PostgreSQL and pgAdmin.

During the video, we demonstrated how Amplicode can be used to efficiently set up an environment for an application using Docker Compose.

Kirill noted that there are three main options for solving the problem:

  1. Create Docker Compose file

  2. Use TestContainers

  3. Use docker-compose-starter for Spring Boot

During the discussions, the guys decided to focus on creating a Docker Compose file. It was shown how using Amplicode you can not only generate services for Docker Compose from scratch, but also how to edit existing services.

JPA Problems in Spring PetClinic and Solutions (Ilya and Fedor Sazonov)

When the application was ready for work, Ilya and Georgy invited experts from the Spring IO community — Ilya and Fedor Sazonov. In 40 minutes, they not only solved several business problems, but also eliminated the problems with JPA that had accumulated over the years of the application’s existence.

The experts started with optimizing the data model in JPA. The first step was to correct one-way relationships that reduce the application's performance. They also paid attention to multiple Eager associations that could also negatively impact performance, but it was decided not to make changes within the current task.

Next, we looked at the ID type used in the application. We discussed why using the strategy Identity may not be the best solution and decided to replace it with Sequence. After that, a new field was added. salary and modified the corresponding screen. Ilya and Fedor were very surprised when they saw that the application was able to launch after changing the identifier type and adding a new field. It turns out that the parameter was not configured in the application hibernate.ddl-auto.

Finally, the panelists and presenters delved into writing Flyway migrations and solving the N+1 problem. Various solutions to this problem were considered, from using join fetch And @EntityGraph and to @BatchSize And spring.jpa.properties.hibernate.default_batch_fetch_size.

Developing a proper REST API for Spring Boot (Rustam Kuramshin)

Then Rustam Kuramshin, another expert of the Spring IO community, joined the meetup. Together they developed a REST API for integration with external services and fixed problems with existing endpoints. They also laid the foundation for a CRUD API, which will later be used by the frontend written in React Admin.

Within 40 minutes, the expert and presenters completed three main tasks: fixed the existing endpoint, implemented a CRUD REST API for the future Admin UI, and developed an API for integrations.

While solving the first problem, the guys discussed the advantages and disadvantages of using MapStruct.

Next, a CRUD REST controller was created using Amplicode capabilities. When generating tests using MockMvc, Rustam expressed a preference for WebTestClient, noting that such tests, although they take longer to run and require solving security issues, provide greater reliability. The guys from the Amplicode team acknowledged this and mentioned plans to support WebTestClient and WireMock.

In the final part, the expert and presenters developed a custom API for external integrations, providing information about owners only if key data is available.

Setting up Spring Security and Keycloak (Pavel Kislov)

Next up was Pavel Kislov, a Spring IO community expert, who helped set up Spring Security and integrate Keycloak for access control.

The guys from Amplicode started to solve security issues, inviting Pasha Kislov to help. Together they analyzed the current and planned infrastructure, including the legacy admin panel on Thymeleaf for managers and administrators, API for external integrations and standardized CRUD API for the admin panel on React Admin. It was decided to use FormLogin for the legacy UI due to the small number of users, and to implement OpenID/OAuth2 based on KeyCloak for the rest of the system.

Admin UI using React Admin for Spring Boot (Alexander Shustanov)

At the end of the meetup, Alexander Shustanov (Product Manager Amplicode) implemented a modern AdminUI using React Admin right in VS Code, adding the final touch to the application.

In the process of creating the admin panel on React Admin, the guys touched upon quite a few interesting questions concerning both technologies that Amplicode Fullstack already supports and those that it only plans to support.

Full recording of the event and answers to questions

For those who missed the meetup or want to re-watch it in its entirety, we've also published the full recording along with the Q&A session.

Subscribe to our Telegram And YouTubeso as not to miss new materials about AmplicodeSpring and related technologies!

And if you want to try Amplicode in action, you can install it absolutely free right now, as in IntelliJ IDEA/GigaIDEand in VS Code.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *