Creation Of The Hammurabi Game - Part 1: Spring Boot Server From Scratch

Hello world,

I want to set up a server, that has a webfrontend, access to a database and some logic. In my case it is a simple "Hammurabi"-game, which everyone can play. Maybe in the future it gets some features, where the player get some advantages, when he does something in the "hive" world, i.e. some advertising. And in the long run I maybe want to benefit the player with some token. But that is far in the future.

grafik.png
origin

In this post I explain how to set up a simple web server, that runs on java spring boot:

Preparing git

I have created a folder, which I want to synch with github. So I created in Github a new branch from my existing Hammurabi repository. (There I have created some simple game logic in the past. I want to merge it later with the springboot-server we install now).
On my local folder I checked out this new branch.
The I deleted the content via the file explorer.
(The "ll" was done after I have unpacked the content from start.spring.io in this folder):

grafik.png

Creating Spring Boot Server from scratch

Go to https://start.spring.io/ and fill out the content like this:

It is very important to write the right package name. By default the artifact-name is added. This leads to very strange errors. The package name has to be the same as the group name!

grafik.png

I unpacked the downloaded jar file into the prepared git folder:

grafik.png

I started the folder with IntelliJI:

grafik.png

I created a new package named org.chary.controller and created a new java file there:

grafik.png

After that I started the HammurabiApplication and checked with the browser, if I can reach it: It works!

grafik.png

Don't forget to:
git add .
git commit -m "springboot from scratch"
git push

You can find my code on Github: https://github.com/achimmertens/Hammurabi. (Be aware, that it is not finished at the moment).

In my next post, I explain how to push this server to a docker container in a raspberry pi.

Regards, Achim

Sort:  

pixresteemer_incognito_angel_mini.png
Bang, I did it again... I just rehived your post!
Week 104 of my contest just started...you can now check the winners of the previous week!
!BEER
5

Congratulations @achimmertens! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s):

You distributed more than 35000 upvotes.
Your next target is to reach 36000 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Check out the last post from @hivebuzz:

Feedback from the May 1st Hive Power Up Day
Be ready for the 5th edition of the Hive Power Up Month!
Hive Power Up Day - May 1st 2022
Support the HiveBuzz project. Vote for our proposal!