Giter VIP home page Giter VIP logo

everything-kaleidoscope's Introduction

1 企业万花筒

1.1 企业导航系统

图一

image.png

图二

image.png

体验地址:http://kaleidoscope.nothing-plat.cn

1.2 功能

  1. 网页导航采用H2作为企业网址的数据存储,导航支持配置网站的多个环境以及用户名、密码。可通过DBeaber、Navicat等管理工具对导航页进行更新。
  2. 规范企业代码生成。连接MySQL通过Mybatis-plus生成代码。采用Velocity引擎通过编写符合公司规范的代码生成模板。
  3. 一体式的服务,包括vue页面、SpringBoot服务和H2内嵌服务。页面采用vue2,打包进SpringBoot服务启动。

2 安装

前置条件

  1. node16
  2. jdk8
cd everything-kaleidoscope
chmod +x install.sh
./install.sh

生成release,如下

release
 ├── everything-kaleido.jar
 ├── templates
 │   ├── serviceImpl.java.vm
 │   ├── example.java.vm
 │   ├── manager.java.vm
 │   ├── mapper.java.vm
 │   ├── service.java.vm
 │   ├── dto.java.vm
 │   ├── entity.java.vm
 │   └── mapper.xml.vm
 └── start.sh

指定start.sh中的MySQL连接,代码生成功能将会通过连接获取数据库元数据。

建议指定为开发环境MySQL

3 部署

3.1 原生部署

cd ./release
chmod +x start.sh
./start.sh

启动后会在目录下生成h2文件夹。

访问地址:localhost:12319

注意:此时打开首页无数据,需要通过数据库连接工具导入,查看【4 导航数据维护】

3.2 docker部署

1.构建镜像

cd everything-kaleidoscope
docker build -t everything-kaleido:1.0 .

2.启动容器

docker run -d \
  -p 12319:123119 \
  -p 11111:11111 \
  -e MYSQL_URL=localhost:3306 \
  -e MYSQL_ACCOUNT=root \
  -e MYSQL_PASSWORD=123456 \
  -v /home/lgl/test/h2:/opt/app/h2 \
  -v /home/lgl/test/templates:/opt/app/templates \
  -v /home/lgl/test/logs:/opt/app/logs \
  --network my-network \
  --name kaleido \
  everything-kaleido:1.0

3.3 docker-compose部署

1.构建镜像

cd everything-kaleidoscope
docker build -t everything-kaleido:1.0 .

2.启动容器

version: '3'
services:
  kaleido:
    image: everything-kaleido:1.0
    container_name: kaleido
    ports:
      - 12319:12319
      - 11111:11111
    environment:
      MYSQL_URL: localhost:3306
      MYSQL_ACCOUNT: root
      MYSQL_PASSWORD: 123456
    volumes:
      - ./h2:/opt/app/h2
      - ./templates:/opt/app/templates
      - ./logs:/opt/app/logs
    tty: true
    stdin_open: true
    privileged: true
    # restart: always

3.4 公开镜像

除了自动编译构建外,镜像已推送至腾讯云容器镜像服务,可直接拉取

docker pull ccr.ccs.tencentyun.com/everything/kaleidoscope

4 导航数据维护

1.通过数据库工具连接内嵌H2

# xxx为everything-kaleido所在目录
url: jdbc:h2:tcp://localhost:11111/file://xxx/release/h2/h2db;AUTO_SERVER=TRUE;AUTO_RECONNECT=TRUE;MODE=MySQL;DATABASE_TO_LOWER=TRUE
username: sa
password: 123456

public模式下,有一个kaleido_scope空表。

2.导入数据

按实际情况调整everything-kaleido/init/dml.sql下的初始化脚本,并导入kaleido_scope。

5 环境变量及默认值

# SpringBoot服务端口
PORT=12319

# SpringBoot内嵌数据库
H2_PATH=./h2/h2db
H2_PORT=11111
H2_PASSWORD=123456

# 代码生成数据库
MYSQL_URL=mysql:3306
MYSQL_ACCOUNT=dev
MYSQL_PASSWORD=123456

# 模板路径
TEMPLATE_PATH=./templates

# docker部署的jvm参数
JAVA_OPTIONS=

everything-kaleidoscope's People

Contributors

liong911 avatar

Stargazers

Entropy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.