diff --git a/README.md b/README.md
index 5466ea4..a0dc71f 100644
--- a/README.md
+++ b/README.md
@@ -21,43 +21,46 @@
Next light-weight,responsive project
With Docker,Vue2,Vue CLI 3,webpack4,Java8 and Spring Boot5
-# Important Changes in JVue 4
+## Important Changes in JVue 4
Using [Docker](https://docs.docker.com/develop/dev-best-practices/) for deploy
-# Install
+## Install
The instructions assume that you have already installed [Docker](https://docs.docker.com/installation/) and [Docker Compose](https://docs.docker.com/compose/install/).
-# Run
+## Run
-## install docker
+### install docker
```
yum install docker
```
-## install docker-compose
+### install docker-compose
```
curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
```
See [https://docs.docker.com/compose/reference/up/](https://docs.docker.com/compose/reference/up/)
-## run jvue
+## Run jvue
-### via docker(for production)
+### docker(for dev)
```bash
-docker compose up -d --build
+docker compose up --build
```
-### custom(for dev)
-~~1. mysql~~
+### docker(for production)
```bash
-docker compose -f docker-compose-mysql.yml
+docker compose up -d --build
```
-2. Jvue-server
+### dev
+
+1. jvue-mysql
+
+2. jvue-server
```bash
cd ./jvue-server/src/main/java/com/terwergreen/jvueserver
@@ -65,38 +68,17 @@ cd ./jvue-server/src/main/java/com/terwergreen/jvueserver
# that's all
```
-~~3. Jvue-front~~
+3. jvue-front
```bash
cd ./jvue-front
yarn
yarn dev
```
-
-### Test docker(for dev)
+or somplely
```bash
-docker compose -f docker-compose.yml up --build
-```
-
-### vercel
-
-1. config
-
-```
-vercel pull
-```
-
-2. build
-
-```
-vercel build
-```
-
-3. start(not work)
-
-```
-vercel dev
+./dev.sh
```
# Structure
@@ -108,4 +90,4 @@ Have fun and enjoy!
You can contribute simplely by create a pull request for me
-For detailed explanation on how things work, please visit [author's blog](https://terwergreen.com).
\ No newline at end of file
+For detailed explanation on how things work, please visit [author's blog](https://blog.terwergreen.com).
\ No newline at end of file
diff --git a/dev.sh b/dev.sh
new file mode 100755
index 0000000..6fb08b0
--- /dev/null
+++ b/dev.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# sudo n 14
+
+cd jvue-server
+./mvnw clean spring-boot:run -Dspring-boot.run.profiles=dev -DskipTests &
+
+cd ../jvue-front
+yarn dev
\ No newline at end of file
diff --git a/docker-compose-mysql.yml b/docker-compose-mysql.yml
deleted file mode 100644
index 39cb0d5..0000000
--- a/docker-compose-mysql.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-# 构建docker-compose项目
-# docker compose --log-level INFO up -- build
-# docker compose --log-level INFO up -d --build
-
-version: '3'
-services:
- jvue-mysql:
- image: jvue/mysql:5.7.24
- container_name: jvue-mysql
- build:
- context: ./
- dockerfile: ./jvue-mysql/Dockerfile
- ports:
- - "3306:3306"
- environment:
- # 最好使用此设定时区,其它静像也可以使用,也可以用"TZ=Asia/Shanghai"
- - "TZ=CST-8"
- - "MYSQL_ROOT_PASSWORD=123456"
- - "MYSQL_ROOT_HOST=%"
- - "MYSQL_DATABASE=bugucms4"
- - "MYSQL_USER=terwer"
- - "MYSQL_PASSWORD=123456"
- volumes:
- - ./data/mysql/db:/var/db
- - ./data/mysql/log:/var/log
- - ./jvue-mysql/my.cnf:/etc/my.cnf
- - ./jvue-mysql/init:/docker-entrypoint-initdb.d/
- restart: "no"
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
index 37f30da..ff8ca0d 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -2,42 +2,43 @@
# docker compose --log-level INFO up -- build
# docker compose --log-level INFO up -d --build
-version: '3'
+version: "3.8"
+
services:
-# jvue-nginx:
-# image: jvue/nginx:1.15.9
-# container_name: jvue-nginx
-# build:
-# context: ./
-# dockerfile: ./jvue-nginx/Dockerfile
-# ports:
-# - "80:80"
-# volumes:
-# - ./jvue-nginx/nginx.conf:/etc/nginx/conf.d/default.conf
-# - ./data/nginx/log:/var/log/nginx
-# restart: "no"
-# jvue-mysql:
-# image: jvue/mysql:5.7.24
-# container_name: jvue-mysql
-# build:
-# context: ./
-# dockerfile: ./jvue-mysql/Dockerfile
-# ports:
-# - "3306:3306"
-# environment:
-# # 最好使用此设定时区,其它静像也可以使用,也可以用"TZ=Asia/Shanghai"
-# - "TZ=CST-8"
-# - "MYSQL_ROOT_PASSWORD=123456"
-# - "MYSQL_ROOT_HOST=%"
-# - "MYSQL_DATABASE=bugucms4"
-# - "MYSQL_USER=terwer"
-# - "MYSQL_PASSWORD=123456"
-# volumes:
-# - ./data/mysql/db:/var/db
-# - ./data/mysql/log:/var/log
-# - ./jvue-mysql/my.cnf:/etc/my.cnf
-# - ./jvue-mysql/init:/docker-entrypoint-initdb.d/
-# restart: always
+ jvue-nginx:
+ image: jvue/nginx:1.15.9
+ container_name: jvue-nginx
+ build:
+ context: ./
+ dockerfile: ./jvue-nginx/Dockerfile
+ ports:
+ - "80:80"
+ volumes:
+ - ./jvue-nginx/nginx.conf:/etc/nginx/conf.d/default.conf
+ - ./data/nginx/log:/var/log/nginx
+ restart: "no"
+ jvue-mysql:
+ image: jvue/mysql:5.7.24
+ container_name: jvue-mysql
+ build:
+ context: ./
+ dockerfile: ./jvue-mysql/Dockerfile
+ ports:
+ - "3308:3306"
+ environment:
+ # 最好使用此设定时区,其它静像也可以使用,也可以用"TZ=Asia/Shanghai"
+ - "TZ=CST-8"
+ - "MYSQL_ROOT_PASSWORD=123456"
+ - "MYSQL_ROOT_HOST=%"
+ - "MYSQL_DATABASE=bugucms4"
+ - "MYSQL_USER=terwer"
+ - "MYSQL_PASSWORD=123456"
+ volumes:
+ - ./data/mysql/db:/var/db
+ - ./data/mysql/log:/var/log
+ - ./jvue-mysql/my.cnf:/etc/my.cnf
+ - ./jvue-mysql/init:/docker-entrypoint-initdb.d/
+ restart: "no"
jvue-server:
image: jvue/server:4.0.1
container_name: jvue-server
@@ -47,20 +48,18 @@ services:
ports:
- "8002:8002"
working_dir: /app
- command: mvn clean spring-boot:run -Dspring-boot.run.profiles=dev -DskipTests
+ command: mvn clean spring-boot:run -Dspring-boot.run.profiles=docker -DskipTests
volumes:
- ./jvue-server:/app
- ./data/maven/.m2:/root/.m2
- ./data/server/logs:/logs
restart: "no"
-# jvue-front:
-# container_name: jvue-front
-# image: jvue/front:4.0.1
-# build:
-# context: .
-# dockerfile: ./jvue-front/Dockerfile
-# ports:
-# - "3000:3000"
-# environment:
-# - npm_config_unsafe_perm=true
-# restart: "no"
\ No newline at end of file
+ jvue-front:
+ container_name: jvue-front
+ image: jvue/front:4.0.1
+ build:
+ context: .
+ dockerfile: ./jvue-front/Dockerfile
+ ports:
+ - "3000:3000"
+ restart: "no"
\ No newline at end of file
diff --git a/jvue-front/.editorconfig b/jvue-front/.editorconfig
new file mode 100644
index 0000000..5d12634
--- /dev/null
+++ b/jvue-front/.editorconfig
@@ -0,0 +1,13 @@
+# editorconfig.org
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+trim_trailing_whitespace = false
diff --git a/jvue-front/.eslintrc.js b/jvue-front/.eslintrc.js
new file mode 100644
index 0000000..ee741f8
--- /dev/null
+++ b/jvue-front/.eslintrc.js
@@ -0,0 +1,31 @@
+module.exports = {
+ root: true,
+ env: {
+ browser: true,
+ node: true
+ },
+ parserOptions: {
+ parser: "babel-eslint"
+ },
+ extends: [
+ "@nuxtjs",
+ "plugin:nuxt/recommended",
+ "plugin:prettier/recommended",
+ "prettier",
+ "prettier/vue"
+ ],
+ plugins: ["prettier"],
+ // add your custom rules here
+ rules: {
+ "nuxt/no-cjs-in-config": "off",
+ "no-console": "off",
+ "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
+ "no-unused-vars": [
+ 2,
+ {
+ vars: "local",
+ args: "none"
+ }
+ ]
+ }
+};
diff --git a/jvue-front/.gitignore b/jvue-front/.gitignore
new file mode 100644
index 0000000..706ae60
--- /dev/null
+++ b/jvue-front/.gitignore
@@ -0,0 +1,91 @@
+# Created by .ignore support plugin (hsz.mobi)
+### Node template
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# Runtime data
+pids
+*.pid
+*.seed
+*.pid.lock
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+
+# nyc test coverage
+.nyc_output
+
+# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Bower dependency directory (https://bower.io/)
+bower_components
+
+# node-waf configuration
+.lock-wscript
+
+# Compiled binary addons (https://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directories
+node_modules/
+jspm_packages/
+
+# TypeScript v1 declaration files
+typings/
+
+# Optional npm cache directory
+.npm
+
+# Optional eslint cache
+.eslintcache
+
+# Optional REPL history
+.node_repl_history
+
+# Output of 'npm pack'
+*.tgz
+
+# Yarn Integrity file
+.yarn-integrity
+
+# dotenv environment variables file
+.env
+
+# parcel-bundler cache (https://parceljs.org/)
+.cache
+
+# next.js build output
+.next
+
+# nuxt.js build output
+.nuxt
+
+# Nuxt generate
+dist
+
+# vuepress build output
+.vuepress/dist
+
+# Serverless directories
+.serverless
+
+# IDE
+.idea
+
+# Service worker
+sw.*
+yarn.lock
+.yarnclean
+.nuxtrc
+node_modules
+node_modules_dev/
+node_modules_prod/
+node_modules/.yargit n-integrity
diff --git a/jvue-front/.prettierrc b/jvue-front/.prettierrc
new file mode 100644
index 0000000..032e7bb
--- /dev/null
+++ b/jvue-front/.prettierrc
@@ -0,0 +1,5 @@
+{
+ "no-console": false,
+ "semi": true,
+ "singleQuote": false
+}
diff --git a/jvue-front/Dockerfile b/jvue-front/Dockerfile
new file mode 100644
index 0000000..97274d0
--- /dev/null
+++ b/jvue-front/Dockerfile
@@ -0,0 +1,31 @@
+# 依赖的镜像
+FROM node:14-alpine
+
+# 工作目录
+WORKDIR /app
+
+# 安装依赖
+COPY ./jvue-front/package.json ./
+
+# yarn 已经有了,没必要重复安装
+RUN yarn config set registry https://registry.npmmirror.com/ --global && \
+ yarn config set disturl https://npmmirror.com/package/dist --global && \
+ yarn config set sass_binary_site https://cdn.npmmirror.com/binaries/node-sass --global && \
+ yarn config set electron_mirror https://registry.npmmirror.com/binary.html?path=electron/ --global && \
+ yarn config set puppeteer_download_host https://registry.npmmirror.com/binary.html --global && \
+ yarn config set chromedriver_cdnurl https://cdn.npmmirror.com/binaries/chromedriver --global && \
+ yarn config set operadriver_cdnurl https://cdn.npmmirror.com/binaries/operadriver --global && \
+ yarn config set phantomjs_cdnurl https://cdn.npmmirror.com/binaries/phantomjs --global && \
+ yarn config set selenium_cdnurl https://cdn.npmmirror.com/binaries/selenium --global && \
+ yarn config set node_inspector_cdnurl https://cdn.npmmirror.com/binaries/node-inspector --global
+
+RUN yarn
+
+RUN yarn build
+
+COPY ./jvue-front .
+
+# 注意这个一定要要在yarn后面,否则devDependencies的包无法安装
+# ENV HOST 0.0.0.0
+
+CMD ["yarn", "start"]
diff --git a/jvue-front/README.md b/jvue-front/README.md
index d492803..7696140 100644
--- a/jvue-front/README.md
+++ b/jvue-front/README.md
@@ -1,3 +1,36 @@
-# Notice
+# jvue-front
-This moudule is moved to [https://github.com/terwer/jvue-front](https://github.com/terwer/jvue-front)
\ No newline at end of file
+> Front module for jvue
+
+## Build Setup
+
+注意:已经兼容node16
+
+```
+npm i -g yarn
+```
+
+```bash
+# install dependencies
+$ yarn
+
+# serve with hot reload at localhost:3000
+$ yarn dev
+
+# build for production and launch server
+$ yarn build
+$ yarn start
+
+# generate static project
+$ yarn generate
+```
+
+## notice
+
+node-sass version policy
+
+[https://github.com/sass/node-sass#node-version-support-policy](https://github.com/sass/node-sass#node-version-support-policy)
+
+this project support **node 16**
+
+For detailed explanation on how things work, checkout [Nuxt.js docs](https://nuxtjs.org).
diff --git a/jvue-front/assets/README.md b/jvue-front/assets/README.md
new file mode 100644
index 0000000..34766f9
--- /dev/null
+++ b/jvue-front/assets/README.md
@@ -0,0 +1,7 @@
+# ASSETS
+
+**This directory is not required, you can delete it if you don't want to use it.**
+
+This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.
+
+More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked).
diff --git a/jvue-front/assets/logo-dark.png b/jvue-front/assets/logo-dark.png
new file mode 100644
index 0000000..0c4bf3d
Binary files /dev/null and b/jvue-front/assets/logo-dark.png differ
diff --git a/jvue-front/assets/logo.png b/jvue-front/assets/logo.png
new file mode 100644
index 0000000..8e3f2eb
Binary files /dev/null and b/jvue-front/assets/logo.png differ
diff --git a/jvue-front/assets/mp-qrcode.png b/jvue-front/assets/mp-qrcode.png
new file mode 100644
index 0000000..0616cae
Binary files /dev/null and b/jvue-front/assets/mp-qrcode.png differ
diff --git a/jvue-front/components/Logo.vue b/jvue-front/components/Logo.vue
new file mode 100644
index 0000000..6c72854
--- /dev/null
+++ b/jvue-front/components/Logo.vue
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/jvue-front/components/README.md b/jvue-front/components/README.md
new file mode 100644
index 0000000..a079f10
--- /dev/null
+++ b/jvue-front/components/README.md
@@ -0,0 +1,7 @@
+# COMPONENTS
+
+**This directory is not required, you can delete it if you don't want to use it.**
+
+The components directory contains your Vue.js Components.
+
+_Nuxt.js doesn't supercharge these components._
diff --git a/jvue-front/components/themes/default/Artalk.vue b/jvue-front/components/themes/default/Artalk.vue
new file mode 100644
index 0000000..665ce21
--- /dev/null
+++ b/jvue-front/components/themes/default/Artalk.vue
@@ -0,0 +1,57 @@
+
+
+ 发布于 {{ new Date(post.created).toLocaleString() }}
+
+
+ 查看全文
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jvue-front/layouts/README.md b/jvue-front/layouts/README.md
new file mode 100644
index 0000000..cad1ad5
--- /dev/null
+++ b/jvue-front/layouts/README.md
@@ -0,0 +1,7 @@
+# LAYOUTS
+
+**This directory is not required, you can delete it if you don't want to use it.**
+
+This directory contains your Application Layouts.
+
+More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts).
diff --git a/jvue-front/layouts/default.vue b/jvue-front/layouts/default.vue
new file mode 100644
index 0000000..9ba9597
--- /dev/null
+++ b/jvue-front/layouts/default.vue
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
diff --git a/jvue-front/middleware/README.md b/jvue-front/middleware/README.md
new file mode 100644
index 0000000..01595de
--- /dev/null
+++ b/jvue-front/middleware/README.md
@@ -0,0 +1,8 @@
+# MIDDLEWARE
+
+**This directory is not required, you can delete it if you don't want to use it.**
+
+This directory contains your application middleware.
+Middleware let you define custom functions that can be run before rendering either a page or a group of pages.
+
+More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware).
diff --git a/jvue-front/nuxt.config.js b/jvue-front/nuxt.config.js
new file mode 100644
index 0000000..b4ed3e2
--- /dev/null
+++ b/jvue-front/nuxt.config.js
@@ -0,0 +1,89 @@
+const pkg = require("./package");
+
+const development = process.env.NODE_ENV !== "production";
+
+module.exports = {
+ debug: true,
+ mode: "universal",
+ telemetry: false,
+
+ /*
+ ** Headers of the page
+ */
+ head: {
+ title: pkg.name,
+ meta: [
+ { charset: "utf-8" },
+ { name: "viewport", content: "width=device-width, initial-scale=1" },
+ { hid: "description", name: "description", content: pkg.description }
+ ],
+ link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }]
+ },
+
+ /*
+ ** Customize the progress-bar color
+ */
+ loading: { color: "#fff" },
+
+ /*
+ ** Global CSS
+ */
+ css: [],
+
+ /*
+ ** Plugins to load before mounting the App
+ */
+ plugins: [
+ "~/plugins/axios",
+ "~plugins/element-ui",
+ {
+ src: "@/plugins/font-awesome",
+ ssr: false // 只在客户端打包
+ },
+ {
+ src: "~/plugins/vue-hljs",
+ ssr: false // 只在客户端打包
+ },
+ {
+ src: "~/plugins/baidu-tongji",
+ ssr: false // 只在客户端打包
+ }
+ ],
+
+ /*
+ ** Nuxt.js modules
+ */
+ modules: [
+ // Doc: https://axios.nuxtjs.org/usage
+ "@nuxtjs/axios"
+ ],
+ /*
+ ** Axios module configuration
+ */
+ axios: {
+ // See https://github.com/nuxt-community/axios-module#options
+ baseURL: development ? "http://localhost:8002/api" : "http://localhost/api"
+ },
+
+ /*
+ ** Build configuration
+ */
+ build: {
+ transpile: [/^element-ui/],
+
+ /*
+ ** You can extend webpack config here
+ */
+ extend(config, ctx) {
+ // Run ESLint on save
+ if (ctx.isDev && ctx.isClient) {
+ config.module.rules.push({
+ enforce: "pre",
+ test: /\.(js|vue)$/,
+ loader: "eslint-loader",
+ exclude: /(node_modules)/
+ });
+ }
+ }
+ }
+};
diff --git a/jvue-front/package.json b/jvue-front/package.json
new file mode 100644
index 0000000..a588dc0
--- /dev/null
+++ b/jvue-front/package.json
@@ -0,0 +1,54 @@
+{
+ "name": "bugucms-front",
+ "version": "4.2.0",
+ "description": "Front module for jvue",
+ "author": "terwer",
+ "private": true,
+ "scripts": {
+ "dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server",
+ "build": "nuxt build",
+ "start": "nuxt build && cross-env NODE_ENV=production node server/index.js",
+ "generate": "nuxt generate",
+ "lint": "eslint --ext .js,.vue --ignore-path .gitignore --ignore-pattern !.eslintrc.js --fix ."
+ },
+ "dependencies": {
+ "@nuxtjs/axios": "^5.3.6",
+ "artalk": "^2.3.4",
+ "cross-env": "^5.2.0",
+ "element-ui": "2.4.11",
+ "express": "^4.16.4",
+ "font-awesome": "^4.7.0",
+ "highlight.js": "^11.6.0",
+ "nuxt": "^2.15.8"
+ },
+ "devDependencies": {
+ "@nuxt/types": "^2.15.8",
+ "@nuxtjs/eslint-config": "^0.0.1",
+ "@vue/eslint-config-prettier": "^4.0.1",
+ "babel-eslint": "^10.0.1",
+ "eslint": "^7.8.1",
+ "eslint-config-prettier": "^4.1.0",
+ "eslint-config-standard": ">=12.0.0",
+ "eslint-loader": "^2.1.2",
+ "eslint-plugin-import": ">=2.16.0",
+ "eslint-plugin-jest": ">=22.3.0",
+ "eslint-plugin-n": "^15.2.3",
+ "eslint-plugin-node": ">=8.0.1",
+ "eslint-plugin-nuxt": ">=0.4.2",
+ "eslint-plugin-prettier": "^3.0.1",
+ "eslint-plugin-promise": ">=4.0.1",
+ "eslint-plugin-standard": ">=4.0.0",
+ "eslint-plugin-vue": "^7.0.0",
+ "node-sass": "^6.0.1",
+ "nodemon": "^1.18.9",
+ "prettier": "^1.16.4",
+ "qs": "^6.6.0",
+ "sass-loader": "^10.3.1"
+ },
+ "config": {
+ "nuxt": {
+ "host": "0.0.0.0",
+ "port": "3000"
+ }
+ }
+}
diff --git a/jvue-front/pages/README.md b/jvue-front/pages/README.md
new file mode 100644
index 0000000..1d5d48b
--- /dev/null
+++ b/jvue-front/pages/README.md
@@ -0,0 +1,6 @@
+# PAGES
+
+This directory contains your Application Views and Routes.
+The framework reads all the `*.vue` files inside this directory and creates the router of your application.
+
+More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing).
diff --git a/jvue-front/pages/about.vue b/jvue-front/pages/about.vue
new file mode 100644
index 0000000..66db441
--- /dev/null
+++ b/jvue-front/pages/about.vue
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+