1. Motivation
The initial start of the project was at the beginning of 2019. I was looking for a sparing project which would help me getting hands on experience in Microservices, Spring Boot, Docker and Cloud. As usual, windsurfing proved to be a good “business” domain. The concept behind Windwarner is the following:
- WindwarnerJobs
- Get warned about good conditions (minimum windspeed and optionally minimum temperature) on your favorite windsurfing spots via email. You can chose from a list of data providers which can be used to obtain weather conditions. You can configure arbitrary number of jobs for different spots. Each job is associated with a schedule (All Week, After-work, Weekends). You have the possibility to snooze jobs for specific time-periods e.g. when you are on holidays or not free on a specific day.
- WindCalendarConfigs
- The concept is similar to WindwarnerJobs but this time for weather forecasts. You can configure minimum weather demands for different spots at your favorite data provider. Windwarner will provide you your personal subscribable calendar endpoint which can be included in all major calendar applications. The format used is iCal which is the calendar standard. Your mail program will regularly check the endpoints which will keep you on top of all wind forecast stuff.
From the start, the architecture/technologies were kind of pre-selected as this project should also be a training on things which are useful for my professional life (no PHP). Moreover, the interface between the application and the user should be as small and as standard as possible which makes a lot of sense in my opinion. What use would it have to implement a custom smartphone/tablet applications/browser add-on with custom notifications?
The problem of informing a person about an event is solved: Messaging (Email)
The problem of organising your appointments in the future is solved: Calendar (iCAL)
The chance that a device (seamlessly) supports email or calendars is much higher than the chance that you can install your custom app on it. The only custom part left is an easy user-interface which handles RBAC and CRUD on WindwarnerJobs and WindCalendarConfigs.
2. Architecture
Created with the C4 best practices in mind. Check the C4 diagram legend here.
3. Implementation
Stack for Microservices
- Maven
- Java 14
- Spring Boot with several starters
- Liquibase
- Quartz Scheduler
- Caffeine Cache Implementation
- Springfox
- biweekly for iCal
- openAPI client generator
- Google Jib
- Testcontainers for MySQL-DB in integration tests
Stack for wordpress plugin
- PHP
- WordPress-API
- Select2 for dynamic spot search
- Firebase PHP-JWT
- HTML, JavaScript and CSS
4. Operations
After initially trying out AWS (Fargate + RDS), I soon stopped that after the costs rose quickly and were just too much for a non-profit side-project. As I already host my blog, my personal Jenkins, Kanboard and some other stuff on Hetzner Private Cloud, I registered another Hetzner instance for Windwarner. The smallest instance is enough to run two Spring Boot Docker containers as you can see here.
The prize of just 2,96€ per Month for a small server is unbeatable. Of course, you don’t have the fully managed experience which you’d have in AWS but the prize-tag of that is just unreasonable for a non-profit side project of that scope. As a comparison, the two small services only cost 0.68€ per day on AWS Fargate. Route53, VPC and other necessary helper services would increase it even more.
Necessary steps for operation:
- Install docker and docker-compose
- Installation of nginx reverse proxy with let’s encrypt
- Create DNS entries for subdomains which point to the static IP of the Hetzner Server
- Enable auth for private AWS ECR repository in order to pull the Windwarner docker images
-
docker-compose up -d 😎
1 comment
Wow amazing blog layout How long have you been blogging for you made blogging look easy The overall look of your web site is magnificent as well as the content