Skip to content

atrifyllis/spring-boot-startup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot Starter project

General Info

<port> in the following is either 8076 for http (dev mode) or 8443 for https (prod mode) === Database initialization An H2 in-memory database is used for this project, initialized at startup. The database is initialized using http(s)://flywaydb.org/[flyway].

H2 database

You can browse the database here: http(s)://localhost:<port>/h2-console entering in JDBC URL the following: jdbc:h2:mem:testdb

HAL browser

Go to http(s)://localhost:<port>/api for browsing the exposed REST API

Entry points

Users

Users with ADMIN role can access the REST endpoint for user(s):

http(s)://localhost:<port>/api/users

Keystore

To create the keystore for Tomcat HTTPS the following command was used (password is 'tomcat'):

keytool -genkey -alias tomcat -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore keystore.p12 -validity 4000

To create the keystore for JWT signing the following command was used:

keytool -genkeypair -alias jwt -keyalg RSA -keypass jwtjwt -keystore jwt.jks -storepass jwtjwt -validity 4000

Then to export the public key separately the command:

keytool -list -rfc --keystore jwt.jks | openssl x509 -inform pem -pubkey

Then copy paste only the Public Key to a separate file. (This command needs openssl installed on your machine. Alternatively you can use a tool like Keystore Explorer for the export).

Production

Running with spring profile 'prod' will run in HTTPS mode.

Note
A MySQL database is needed for production mode with name 'spring_boot_startup'. You must change username password in application-prod.yaml file.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published