|
| 1 | +# Custom project from Hilla |
| 2 | + |
| 3 | +This project can be used as a starting point to create your own Hilla application with Spring Boot. |
| 4 | +It contains all the necessary configuration and some placeholder files to get you started. |
| 5 | + |
| 6 | +## Running the application |
| 7 | + |
| 8 | +The project is a standard Maven project. To run it from the command line, |
| 9 | +type `mvnw` (Windows), or `./mvnw` (Mac & Linux), then open |
| 10 | +http://localhost:8080 in your browser. |
| 11 | + |
| 12 | +You can also import the project to your IDE of choice as you would with any |
| 13 | +Maven project. |
| 14 | + |
| 15 | +## Deploying to Production |
| 16 | + |
| 17 | +To create a production build, call `mvnw clean package -Pproduction` (Windows), |
| 18 | +or `./mvnw clean package -Pproduction` (Mac & Linux). |
| 19 | +This will build a JAR file with all the dependencies and front-end resources, |
| 20 | +ready to be deployed. The file can be found in the `target` folder after the build completes. |
| 21 | + |
| 22 | +Once the JAR file is built, you can run it using |
| 23 | +`java -jar target/myapp-1.0-SNAPSHOT.jar` (NOTE, replace |
| 24 | +`myapp-1.0-SNAPSHOT.jar` with the name of your jar). |
| 25 | + |
| 26 | +## Project structure |
| 27 | + |
| 28 | +<table style="width:100%; text-align: left;"> |
| 29 | + <tr><th>Directory</th><th>Description</th></tr> |
| 30 | + <tr><td><code>frontend/</code></td><td>Client-side source directory</td></tr> |
| 31 | + <tr><td> <code>index.html</code></td><td>HTML template</td></tr> |
| 32 | + <tr><td> <code>index.ts</code></td><td>Frontend entrypoint, contains the client-side routing setup using <a href="https://hilla.dev/docs/routing/router">Hilla Router</a></td></tr> |
| 33 | + <tr><td> <code>main-layout.ts</code></td><td>Main layout Web Component, contains the navigation menu, uses <a href="https://vaadin.com/docs/latest/ds/components/app-layout">App Layout</a></td></tr> |
| 34 | + <tr><td> <code>views/</code></td><td>UI views Web Components (TypeScript)</td></tr> |
| 35 | + <tr><td> <code>themes/</code></td><td>Custom |
| 36 | +CSS styles</td></tr> |
| 37 | + <tr><td><code>src/main/java/<groupId>/</code></td><td>Server-side |
| 38 | +source directory, contains the server-side Java views</td></tr> |
| 39 | + <tr><td> <code>Application.java</code></td><td>Server entry-point</td></tr> |
| 40 | +</table> |
| 41 | + |
| 42 | +## Useful links |
| 43 | + |
| 44 | +- Read the documentation at [hilla.dev/docs](https://hilla.dev/docs/). |
| 45 | +- Ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/hilla) or join our [Discord channel](https://discord.gg/MYFq5RTbBn). |
| 46 | +- Report issues, create pull requests in [GitHub](https://github.com/vaadin/hilla). |
0 commit comments