Skip to content

This repo implements a sample full stack app with Spring Boot and HTMX. Apache Freemarker is used as a template language and Bootstrap as a CSS framework. The goal is to provide a simple base to evolve an app from.

Notifications You must be signed in to change notification settings

mircohacker/Spring-Boot-and-HTMX

Repository files navigation

Spring Boot and HTMX: The boring app

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

Start the spring app with embedded vue app

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.

Start vue app in standalone mode

cd vue-app
yarn install
yarn dev

open http://localhost:5173/

Build a new version of the vue app to be included in the Spring Boot app

yarn install
yarn build

Note: The binary rsync has to be present in the PATH

Deploy to AWS

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.

About

This repo implements a sample full stack app with Spring Boot and HTMX. Apache Freemarker is used as a template language and Bootstrap as a CSS framework. The goal is to provide a simple base to evolve an app from.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published