# test1202 **Repository Path**: lzh2019/test1202 ## Basic Information - **Project Name**: test1202 - **Description**: test1202 - **Primary Language**: Unknown - **License**: Unlicense - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-03 - **Last Updated**: 2025-02-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # test1202 #### 介绍 test1202 #### 软件架构 软件架构说明 #### 安装教程 1. xxxx 2. xxxx 3. xxxx #### 使用说明 1. xxxx 2. xxxx 3. xxxx #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) # Project Base for Vaadin and Spring Boot This project can be used as a starting point to create your own Vaadin application with Spring Boot. It contains all the necessary configuration and some placeholder files to get you started. The best way to create your own project based on this starter is [start.vaadin.com](https://start.vaadin.com/) - you can get only the necessary parts and choose the package naming you want to use. ## Running the Application There are two ways to run the application : using `mvn spring-boot:run` or by running the `Application` class directly from your IDE. You can use any IDE of your preference,but we suggest Eclipse or Intellij IDEA. Below are the configuration details to start the project using a `spring-boot:run` command. Both Eclipse and Intellij IDEA are covered. #### Eclipse - Right click on a project folder and select `Run As` --> `Maven build..` . After that a configuration window is opened. - In the window set the value of the **Goals** field to `spring-boot:run` - You can optionally select `Skip tests` checkbox - All the other settings can be left to default Once configurations are set clicking `Run` will start the application #### Intellij IDEA - On the right side of the window, select Maven --> Plugins--> `spring-boot` --> `spring-boot:run` goal - Optionally, you can disable tests by clicking on a `Skip Tests mode` blue button. Clicking on the green run button will start the application. After the application has started, you can view your it at http://localhost:8080/ in your browser. If you want to run the application locally in the production mode, use `spring-boot:run -Pproduction` command instead. ### Running Integration Tests Integration tests are implemented using [Vaadin TestBench](https://vaadin.com/testbench). The tests take a few minutes to run and are therefore included in a separate Maven profile. We recommend running tests with a production build to minimize the chance of development time toolchains affecting test stability. To run the tests using Google Chrome, execute `mvn verify -Pit,production` and make sure you have a valid TestBench license installed. Profile `it` adds the following parameters to run integration tests: ```sh -Dwebdriver.chrome.driver=path_to_driver -Dcom.vaadin.testbench.Parameters.runLocally=chrome ``` If you would like to run a separate test make sure you have added these parameters to VM Options of JUnit run configuration ### Live Reload (optional) With live reload, you can see the results of your code changes immediately. When you edit your Java code and recompile it, the application changes will be automatically reloaded and the browser is refreshed. This is done by leveraging [Spring Boot Developer Tools](https://docs.spring.io/spring-boot/docs/2.1.5.RELEASE/reference/html/using-boot-devtools.html). To be able to see the changes in the browser tab, the page still needs to be reloaded. That can also be automated via a LiveReload browser extension. One such extension for Google Chrome is [LiveReload](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei). In Firefox, [LiveReload - Web extension](https://addons.mozilla.org/en-US/firefox/addon/livereload-web-extension/) can be used. You can find such similar extensions for other major browsers too. These extensions add an icon to your browser next to the address bar. To enable the extension, you should click that icon after you opened your application. You can find more information at [Live Reload in Spring Boot Applications](https://vaadin.com/docs/flow/workflow/tutorial-spring-boot-live-reload.html) document. ## Structure Vaadin web applications are full-stack and include both client-side and server-side code in the same project. | Directory | Description | |:-------------------------------------------| :--- | | `src/main/frontend/` | Client-side source directory | |     `index.html` | HTML template | |     `index.ts` | Frontend entrypoint | |     `main-layout.ts` | Main layout Web Component (optional) | |     `views/` | UI views Web Components (TypeScript / HTML) | |     `styles/` | Styles directory (CSS) | | `src/main/java//` | Server-side source directory | |     `Application.java` | Server entrypoint | |     `AppShell.java` | application-shell configuration | ## Code Formatting The project includes the Spotless code formatter. To use it in IntelliJ, install the [https://plugins.jetbrains.com/plugin/22455-spotless-applier](IntelliJ plugin) To use it in VS Code, install the [https://marketplace.visualstudio.com/items?itemName=richardwillis.vscode-spotless-gradle ](VS Code extension) To use it from the command line, run `mvn spotless:apply` ## Useful links - Read the documentation at [vaadin.com/docs](https://vaadin.com/docs). - Follow the tutorials at [vaadin.com/tutorials](https://vaadin.com/tutorials). - Watch training videos and get certified at [vaadin.com/learn/training](https://vaadin.com/learn/training). - Create new projects at [start.vaadin.com](https://start.vaadin.com/). - Search UI components and their usage examples at [vaadin.com/components](https://vaadin.com/components). - View use case applications that demonstrate Vaadin capabilities at [vaadin.com/examples-and-demos](https://vaadin.com/examples-and-demos). - Discover Vaadin's set of CSS utility classes that enable building any UI without custom CSS in the [docs](https://vaadin.com/docs/latest/ds/foundation/utility-classes). - Find a collection of solutions to common use cases in [Vaadin Cookbook](https://cookbook.vaadin.com/). - Find Add-ons at [vaadin.com/directory](https://vaadin.com/directory). - Ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/vaadin) or join our [Discord channel](https://discord.gg/MYFq5RTbBn). - Report issues, create pull requests in [GitHub](https://github.com/vaadin/platform). 什么是服务端驱动 UI 开发 服务端 Web UI 开发通常表示 UI 与服务端通过紧耦合的方式执行某些业务功能。在这种紧耦合的架构中,UI 和业务域的后端具有很高的内聚性,共同为特定的业务功能提供服务。 我们将其与采用 SPA 的分离架构进行比较。在前后端分离架构中,通过显式定义 API 使得前端和后端之间有清晰的分界线。此时,前后端的耦合度要低很多,仅通过预先定义的 API 合约进行通信。 一般来说,独立组件之间的架构耦合度是越低越好。但是问题在于,UI 和后端是否真正的独立组件?还是说在功能上他们其实属于一个逻辑组件?如果他们是一个逻辑组件,那么耦合度高反而更好,因为这是单个组件的性质。 在企业级应用程序后台 UI 的场景中,前后端的功能是非常一致的。因此,在这种场景下引入低耦合的成本会非常高,不但不能带来额外的价值,还会在效率和进行不必要的低耦合架构方面造成损害。 使用服务端驱动的 UI,前端和后端代码通常使用相同的编程语言编写。对于 Web 应用程序,以前是可以使用服务端渲染的 HTML 进行呈现的。在 Java 世界中,像 JSP 或 Thymeleaf 这样的解决方案也是使用这种方式通过 Java 创建用户界面。会有一些特定领域的语言或者 API,但是语言都差不多。尽管如此,开发者还是需要使用 HTML 和 CSS 并掌握基础的 Web 知识。 特别是随着 JavaScript 和 SPA 的兴起,Web 浏览器承载了更多的业务逻辑,使用同一语言开发前后端也变得不太流行。但是,一些强大的框架出现使得服务端驱动的 Web UI 成为可能,例如 Phoenix Liveview,C# 的 Blazor 以及 Java 生态中的 Vaadin。 从概念上讲,这些框架都遵循相同的原则:开发人员使用他们首选的后端语言(如 Elixir,C# 或 Java)编写 UI 逻辑。框架执行一些转换以使其能在浏览器中展示。这样,开发人员就不必仅仅因为技术限制而将前端和后端视为单独的组件