Choose technologies for your project - A brief report
Tags: productivity, codenewbie, learning
Published: 2023-06-20 18:51:37

For your interest this is a post about my own experience with my private project and how the process of development has chosen my used technologies. This shows how important it is to know which technology is the right for your purpose.

## Conditions
I have chosen much conditions which my software project should meet. First of all I want access from every web device of my home network. Second it should be deploy-able on a raspberry pi. And at last it should start automatically on boot up of the raspberry without any action by my side.
So we can see the three conditions which I had for my software project.

1. Run on every OS
2. Raspberry Pi deployment
3. Automatic start on device boot

## Choose of the tech stack
First of all my decision was a web app because of condition one. A web app run on every device which has a internet browser. For the framework I have chosen Vue.js because it looks very interesting and I had play around a little bit with Vue.js version 2 in the past. But I needed a possibility to save the data the users will produce by use of the app. So I have chosen Java Spring Boot because I am a java dev and wanted to see how my code style has changed by the few years of job experience. As database I have chosen MongoDB because of the design as an document oriented database. To fix my condition number 3 I wanted to use docker for deployment. With an argument I can give a docker container the command to restart on every stop of himself.
But for sure this should not be the tech stack of the final project.

## Euphoria gives way to problems
After my first euphoria for the new project and the detailed tech stack the reality has kicked me. In every project will be conditions by environment which let you overthink your decisions. First of all there were many time since I used Vue.js for the last time. At start of my project version 3 of Vue.js was just released. My Vue.js experience based on version 2 of the framework. What are you doing now? Go with the old version and upgrade later or start learning to use the new version? At this moment all tutorials of Vue.js were written for version 2. After that I have chosen to use Angular instead of Vue.js. This decision was easy because I had much more experience with Angular as web framework than vue.js. After that the first of my planned tech stack components was changed. But it wasn't the last one.

## ARM is not x86
No much time since the next problem was coming. As database I have chosen MongoDB. For the deployment I needed an docker image of it. But the support for the MongoDB docker image for ARM32 architecture has ended. You will remember. One of my conditions was to run the software on a raspberry pi. To have less problems with this or other database images I have decided to use an h2 database. This database can be run in the same docker container as the java server. As a java developer I know that my software can run on every architecture as long as it has a java runtime environment. But this kind of luxury let me forget that in other cases the architecture of the host system is very important for the whole parts of a project.

## Apply a web server for the angular web app
After this I had a stable backend based on a docker container containing a java spring boot server and a h2 database. The last I needed was a web server respectively a http server. To archive this goal I have read many tutorials to build a docker image and docker container for the angular app. The web app runs. Fine. But there was a bug on it. If anyone types a specific route in the url bar of the browser there was an error that the path can not be found. This was happening because the web server layer try to find a specific file or directory like the route in the browser. But angular works in another way. Angular has there own scripts to process routes. So I have needed to tell the web server layer to pass on the task to angular. But to configure the docker container required a lot of deep knowledge about docker. Knowledge that I was not ready to learn for this project. Instead I have used the classic apache web server. For the apache web server I could write rules to pass on the routing tasks to angular. This was very easy on the one hand and on the other hand the apache web server started automatically on every system boot.

## What have I learned?
Through this amount of problems and solutions I have learned to go other ways if your way is blocked. Be flexible in use of technologies. Try something new so you can choose the right technology from your knowledge stock. Have the brave to learn different technologies like different frameworks for web apps, desktop guis, smartphone apps, backend server and so on. So you can make the right choice to solve a specific use case on the most efficient way.
What are your experiences in choosing a tech stack for projects? Let it me know.

Keep coding.