1 Star 3 Fork 3

begcode / monolith-mybatis-antdv

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

monolithMybatis

本应用程序由BegCode8.1.0-beta.0生成, 你可以在 https://www.begcode.com/documentation-archive/v8.1.0-beta.0 找到文档和帮助。

截图展示

登录

登录

首页

首页

菜单列表

菜单列表

角色列表

角色列表

用户列表

用户列表

短信配置

短信配置

图片上传

图片上传

字典管理

字典管理

操作日志

操作日志

消息发布

消息发布

Api列表

Api列表

Icon选择参考

Icon选择参考

查看通知

查看通知

项目结构

生成时需要 Node,并建议在开发过程中使用它。package.json 文件始终会生成,以提供更好的开发体验,包括 prettier、commit hooks、脚本等等。

在项目的根目录中,JHipster会生成用于配置诸如git、prettier、eslint、husky等众多常见工具的配置文件。你可以在网络上找到有关这些工具的参考文档。

/src/* 目录结构遵循默认的Java结构。

  • .yo-rc.json - Yeoman配置文件(BegCode/JHipster配置文件) BegCode的配置存储在key为generator-begcode的属性中,这里定义了BegCode生成器的全局配置。此外,你可能会在项目根目录下的.yo-rc.json文件中找到类似generator-begcode-*的蓝图配置,它包含了项目特定的配置选项。

  • .yo-resolve (可选) - Yeoman 冲突解决器 允许在发现冲突时使用特定操作,跳过匹配模式的文件的提示。每一行应该匹配 [模式] [操作],其中模式是一个 Minimatch 模式,操作是 skip(如果省略则为默认操作)或者 force 中的一个。以 # 开头的行被视为注释,将被忽略。

  • .jhipster/*.json - JHipster实体配置文件

  • npmw - 用于本地安装的npm的包装器 JHipster默认使用构建工具在本地安装Node和npm。此包装器确保本地安装npm并使用它,避免了不同版本可能引起的一些差异。通过使用./npmw而不是传统的npm,您可以配置一个无需Node的环境来开发或测试您的应用程序。

  • /src/main/docker - 应用程序及其依赖的服务的Docker配置

开发

在构建此项目之前,您必须在计算机上安装并配置以下依赖项:

  1. Node.js: 我们使用 Node 来运行开发 Web 服务器并构建项目。 根据您的系统,您可以从源代码安装 Node,也可以将 Node 安装为预打包的捆绑包。

安装 Node 后,您应该能够运行以下命令来安装开发工具。 仅当 package.json 中的依赖项发生更改时,您才需要再次运行此命令。

pnpm install

我们使用 pnpm 脚本和 [Vite][] 作为我们的构建系统。

在两个单独的终端中运行以下命令,以创建更好的开发体验,其中当硬盘上的文件发生更改时您的浏览器自动刷新。

./mvnw
pnpm start

Npm 还用于管理此应用程序中使用的 CSS 和 JavaScript 依赖项。 您可以通过以下方式升级依赖项 在 package.json 中指定较新版本。 您还可以运行pnpm updatepnpm install来管理依赖项。 在任何命令上添加help标志以查看如何使用它。 例如,pnpm help update

pnpm run 命令将列出可用于该项目运行的所有脚本。

PWA支持

BegCode 附带 PWA(渐进式 Web 应用程序)支持,并且默认情况下处于关闭状态。 PWA 的主要组件之一是 Service Worker。

The service worker initialization code is commented out by default. To enable it, uncomment the following code in front/src/index.html:

<script>
  if ('serviceWorker' in navigator) {
    navigator.serviceWorker.register('./service-worker.js').then(function () {
      console.log('Service Worker Registered');
    });
  }
</script>

Note: Workbox powers JHipster's service worker. It dynamically generates the service-worker.js file.

依赖管理

例如,要将 Leaflet 库添加为应用程序的运行时依赖项,您可以运行以下命令:

pnpm install --save --save-exact leaflet

To benefit from TypeScript type definitions from DefinitelyTyped repository in development, you would run following command:

pnpm install --save-dev --save-exact @types/leaflet

Then you would import the JS and CSS files specified in library's installation instructions so that Webpack knows about them: Note: There are still a few other things remaining to do for Leaflet that we won't detail here.

For further instructions on how to develop with JHipster, have a look at Using JHipster in development.

系统构建

创建Jar包

要优化monolithMybatis应用程序创建Jar包并进行生产部署,请运行:

./mvnw -Pprod clean verify

这将压缩客户端和重新打包CSS和JavaScript文件。 它还将修改index.html,以便引用这些新文件。 为了确保一切正常,请运行:

java -jar target/*.jar

Then navigate to http://localhost:8080 in your browser.

Refer to Using JHipster in production for more details.

创建War包

要将您的应用程序打包为 war 以便将其部署到应用程序服务器,请运行:

./mvnw -Pprod,war clean verify

JHipster Control Center

JHipster Control Center 可以帮助您管理和控制您的应用程序。 您可以使用以下命令启动本地控制中心服务器(可通过 http://localhost:7419 访问):

docker compose -f src/main/docker/jhipster-control-center.yml up

测试

Spring Boot tests

To launch your application's tests, run:

./mvnw verify

Client tests

Unit tests are run by Jest. They're located in front/src/test/javascript/ and can be run with:

pnpm test

其他

使用Sonar进行代码质量控制

Sonar用于分析代码质量。 您可以使用以下命令启动本地 Sonar 服务器(可通过 http://localhost:9001 访问):

docker compose -f src/main/docker/sonar.yml up -d

Note: we have turned off forced authentication redirect for UI in src/main/docker/sonar.yml for out of the box experience while trying out SonarQube, for real use cases turn it back on.

You can run a Sonar analysis with using the sonar-scanner or by using the maven plugin.

Then, run a Sonar analysis:

./mvnw -Pprod clean verify sonar:sonar -Dsonar.login=admin -Dsonar.password=admin

If you need to re-run the Sonar phase, please be sure to specify at least the initialize phase since Sonar properties are loaded from the sonar-project.properties file.

./mvnw initialize sonar:sonar -Dsonar.login=admin -Dsonar.password=admin

Additionally, Instead of passing sonar.password and sonar.login as CLI arguments, these parameters can be configured from sonar-project.properties as shown below:

sonar.login=admin
sonar.password=admin

For more information, refer to the Code quality page.

Using Docker to simplify development (optional)

You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the src/main/docker folder to launch required third party services.

For example, to start a mysql database in a docker container, run:

docker compose -f src/main/docker/mysql.yml up -d

To stop it and remove the container, run:

docker compose -f src/main/docker/mysql.yml down

You can also fully dockerize your application and all the services that it depends on. To achieve this, first build a docker image of your app by running:

npm run java:docker

Or build a arm64 docker image when using an arm64 processor os like MacOS with M1 processor family running:

npm run java:docker:arm64

Then run:

docker compose -f src/main/docker/app.yml up -d

When running Docker Desktop on MacOS Big Sur or later, consider enabling experimental Use the new Virtualization framework for better processing performance (disk access performance is worse).

For more information refer to Using Docker and Docker-Compose, this page also contains information on the docker-compose sub-generator (jhipster docker-compose), which is able to generate docker configurations for one or several JHipster applications.

Continuous Integration (optional)

To configure CI for your project, run the ci-cd sub-generator (jhipster ci-cd), this will let you generate configuration files for a number of Continuous Integration systems. Consult the Setting up Continuous Integration page for more information.

MIT License Copyright (c) 2023 begcode Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

基于JHipster生成的支持Mybatis-Plus和Ant-Design-Vue单体应用 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/begcode/monolith-mybatis-antdv.git
git@gitee.com:begcode/monolith-mybatis-antdv.git
begcode
monolith-mybatis-antdv
monolith-mybatis-antdv
main

搜索帮助

344bd9b3 5694891 D2dac590 5694891