Start with the simplest app possible and evolve from there.
In this repo I implement a sample full stack app with Spring Boot and HTMX. Apache Freemarker is used as a template language and Bootstrap as a CSS framework.
For complex interaction heavy use cases the sample includes a mechanism to render a vue app at a specific route as well.
The accompanying blog post can be read in this repo and on my employers blog
Run ./gradlew bootRun
and open http://localhost:8080
Note: the build artifacts of the vue app are checked in at the correct places for your convenience.
cd vue-app
yarn install
yarn dev
yarn install
yarn build
Note: The binary rsync
has to be present in the PATH
This will build your lambda as jar and deploy it inside a standard java lambda runtime. For better boot times this will also utilize the AWS SnapStart feature. Make sure to have the AWS sam cli installed. Log into your target AWS account and then run:
sam build
sam deploy --guided
The app can be reached at the URL shown at the bottom of this command. Be aware that the first request after ~15 Minutes of inactivity takes around 6 seconds to initialize the app again. Subsequent requests should be fast.