vaadin / skeleton-starter-hilla-react-gradle

The Unlicense
1 stars 2 forks source link

skeleton-starter-hilla-react-gradle

This project can be used as a starting point to create your own Hilla application with React, Spring Boot, and Gradle. It contains all the necessary configuration and some placeholder files to get you started.

Running the application

The project is a standard Gradle Spring Boot project. To run it from the command line, type gradlew bootRun (Windows), or ./gradlew bootRun (Mac & Linux), then open http://localhost:8080 in your browser.

You can also import the project to your IDE of choice as you would with any Gradle project. Then you can run the main method of Application.java.

Deploying to Production

To create a production build, call gradlew -Philla.productionMode=true build (Windows), or ./gradlew -Philla.productionMode=true build (Mac & Linux). This will build a JAR file with all the dependencies and front-end resources, ready to be deployed. The file can be found in the build/libs/ folder after the build completes.

Once the JAR file is built, you can run it using:

java -jar build/libs/skeleton-starter-hilla-react-gradle.jar

Project structure

DirectoryDescription
frontend/Client-side source directory
    index.htmlHTML template
    index.tsFrontend entrypoint, bootstraps a React application
    routes.tsxReact Router routes definition
    MainLayout.tsxMain layout component, contains the navigation menu, uses App Layout
    views/UI view components
    themes/Custom CSS styles
src/main/java/<groupId>/Server-side source directory, contains the server-side Java views
    Application.javaServer entry-point

Useful links