To generate a Spring Boot web project with Tailwind CSS and live reload, you can use ttcli. This tool generates Maven projects with Tailwind CSS and live reload support out of the box. This template was originally generated by ttcli
but has been converted to use Gradle instead of Maven.
- Gradle
- Using
Frontend Gradle Plugin
: https://siouan.github.io/frontend-gradle-plugin/
- Using
- Tailwind CSS
- Modern Frontend Tooling
- Hot-Reload for Development
- WebJars
- Clone the repository.
- Open the project in your favorite IDE.
- Ensure you have JDK 21 set as the Java SDK.
- Run the backend server using:
./gradlew bootRun
- Install Node.js dependencies:
npm install
- Build the frontend assets for development:
npm run build
This will copy and process all relevant frontend resources (HTML, CSS, JS, SVG) into the build/resources/main
directory.
3. Optionally, start the file watcher for live reloading during development:
npm run watch
- For serving the app with hot-reload on file changes, run:
npm run watch:serve
The browser will automatically reload on file changes.