I recently had some time off from my postgraduate studies, so I wanted to make good use of that time. I decided to deploy the frontend of my Dog Shelter Friend application. I already had the backend running as a demo for my resume, completed with Swagger for testing its functionality. However, since I had already created a simple frontend, why not include it as well?
My visual layer was built using Vaadin. It might not be the most popular or trendy technology, but it was perfect for me to get started. I had never dealt with HTML/CSS before, and my sense of aesthetics was poor, but the frontend works, and that’s what matters. I can now showcase a complete version of my application that I’m proud of.
The frontend is straightforward but effectively demonstrates the application’s features. It uses RestTemplate to communicate with my backend application via REST. I could have built everything in a single application, but I preferred to separate them for learning purposes. I just wanted to create two separate applications that could communicate with each other. You can use the frontend layer, but if someone wants, they can also use Swagger to make REST requests directly to the backend.
The frontend is secured with Vaadin Security, somewhat like Spring Security, but configuring it was a bit strange for me. I also faced some issues with deploying the frontend.
I built my application in developer mode, uploaded the image to my Docker on my OVH VPS, and here came a small surprise: it didn’t work. The logs were showing errors related to access issues to certain folders and other errors. GPT chat, instead of helping, was effectively misleading me. I had to study Vaadin’s documentation on my own. It turned out that I had built the application image incorrectly. I should have built the application in the production version using:
mvnw clean package -Pproduction
but not in the developer version, which is quite obvious now.
After completing these steps, I had the appropriate JAR file to create a Docker image. Maybe for someone who deals with these topics every day, my problems seem quite simple, but I’m effectively learning from my mistakes, especially at the beginning of my learning journey.