diff --git a/.gitignore b/.gitignore index dfdeb2b5c..c656b3b8f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ __pycache__/ # Nodejs node_modules/ +yarn.lock # Distribution / packaging .Python diff --git a/sapl-frontend/.browserslistrc b/sapl-frontend/.browserslistrc new file mode 100644 index 000000000..9dee64646 --- /dev/null +++ b/sapl-frontend/.browserslistrc @@ -0,0 +1,3 @@ +> 1% +last 2 versions +not ie <= 8 diff --git a/sapl-frontend/.eslintrc.js b/sapl-frontend/.eslintrc.js new file mode 100644 index 000000000..3f3df4f72 --- /dev/null +++ b/sapl-frontend/.eslintrc.js @@ -0,0 +1,14 @@ +module.exports = { + root: true, + env: { + node: true + }, + extends: ["plugin:vue/essential", "@vue/prettier"], + rules: { + "no-console": process.env.NODE_ENV === "production" ? "error" : "off", + "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off" + }, + parserOptions: { + parser: "babel-eslint" + } +}; diff --git a/sapl-frontend/.gitignore b/sapl-frontend/.gitignore new file mode 100644 index 000000000..185e66319 --- /dev/null +++ b/sapl-frontend/.gitignore @@ -0,0 +1,21 @@ +.DS_Store +node_modules +/dist + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw* diff --git a/sapl-frontend/README.md b/sapl-frontend/README.md new file mode 100644 index 000000000..6cd515874 --- /dev/null +++ b/sapl-frontend/README.md @@ -0,0 +1,29 @@ +# sapl-frontend + +## Project setup +``` +yarn install +``` + +### Compiles and hot-reloads for development +``` +yarn run serve +``` + +### Compiles and minifies for production +``` +yarn run build +``` + +### Run your tests +``` +yarn run test +``` + +### Lints and fixes files +``` +yarn run lint +``` + +### Customize configuration +See [Configuration Reference](https://cli.vuejs.org/config/). diff --git a/sapl-frontend/babel.config.js b/sapl-frontend/babel.config.js new file mode 100644 index 000000000..3ecebf1a5 --- /dev/null +++ b/sapl-frontend/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + presets: ["@vue/app"] +}; diff --git a/sapl-frontend/package.json b/sapl-frontend/package.json new file mode 100644 index 000000000..11dd00860 --- /dev/null +++ b/sapl-frontend/package.json @@ -0,0 +1,27 @@ +{ + "name": "sapl-frontend", + "version": "0.1.0", + "private": true, + "scripts": { + "serve": "vue-cli-service serve", + "build": "vue-cli-service build", + "lint": "vue-cli-service lint" + }, + "dependencies": { + "vue": "^2.5.21", + "vue-router": "^3.0.1", + "vuex": "^3.0.1" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "^3.3.0", + "@vue/cli-plugin-eslint": "^3.3.0", + "@vue/cli-service": "^3.3.0", + "@vue/eslint-config-prettier": "^4.0.1", + "babel-eslint": "^10.0.1", + "eslint": "^5.8.0", + "eslint-plugin-vue": "^5.0.0", + "node-sass": "^4.9.0", + "sass-loader": "^7.0.1", + "vue-template-compiler": "^2.5.21" + } +} diff --git a/sapl-frontend/postcss.config.js b/sapl-frontend/postcss.config.js new file mode 100644 index 000000000..5bfb8f628 --- /dev/null +++ b/sapl-frontend/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + autoprefixer: {} + } +}; diff --git a/sapl-frontend/public/favicon.ico b/sapl-frontend/public/favicon.ico new file mode 100644 index 000000000..c7b9a43c8 Binary files /dev/null and b/sapl-frontend/public/favicon.ico differ diff --git a/sapl-frontend/public/index.html b/sapl-frontend/public/index.html new file mode 100644 index 000000000..b50b16df5 --- /dev/null +++ b/sapl-frontend/public/index.html @@ -0,0 +1,17 @@ + + + + + + + + sapl-frontend + + + +
+ + + diff --git a/sapl-frontend/src/App.vue b/sapl-frontend/src/App.vue new file mode 100644 index 000000000..440354e77 --- /dev/null +++ b/sapl-frontend/src/App.vue @@ -0,0 +1,29 @@ + + + diff --git a/sapl-frontend/src/assets/logo.png b/sapl-frontend/src/assets/logo.png new file mode 100644 index 000000000..f3d2503fc Binary files /dev/null and b/sapl-frontend/src/assets/logo.png differ diff --git a/sapl-frontend/src/components/HelloWorld.vue b/sapl-frontend/src/components/HelloWorld.vue new file mode 100644 index 000000000..f2a7270cd --- /dev/null +++ b/sapl-frontend/src/components/HelloWorld.vue @@ -0,0 +1,114 @@ + + + + + + diff --git a/sapl-frontend/src/main.js b/sapl-frontend/src/main.js new file mode 100644 index 000000000..3a47006f0 --- /dev/null +++ b/sapl-frontend/src/main.js @@ -0,0 +1,12 @@ +import Vue from "vue"; +import App from "./App.vue"; +import router from "./router"; +import store from "./store"; + +Vue.config.productionTip = false; + +new Vue({ + router, + store, + render: h => h(App) +}).$mount("#app"); diff --git a/sapl-frontend/src/router.js b/sapl-frontend/src/router.js new file mode 100644 index 000000000..7b4bb791e --- /dev/null +++ b/sapl-frontend/src/router.js @@ -0,0 +1,26 @@ +import Vue from "vue"; +import Router from "vue-router"; +import Home from "./views/Home.vue"; + +Vue.use(Router); + +export default new Router({ + mode: "history", + base: process.env.BASE_URL, + routes: [ + { + path: "/", + name: "home", + component: Home + }, + { + path: "/about", + name: "about", + // route level code-splitting + // this generates a separate chunk (about.[hash].js) for this route + // which is lazy-loaded when the route is visited. + component: () => + import(/* webpackChunkName: "about" */ "./views/About.vue") + } + ] +}); diff --git a/sapl-frontend/src/store.js b/sapl-frontend/src/store.js new file mode 100644 index 000000000..bb02ce2d2 --- /dev/null +++ b/sapl-frontend/src/store.js @@ -0,0 +1,10 @@ +import Vue from "vue"; +import Vuex from "vuex"; + +Vue.use(Vuex); + +export default new Vuex.Store({ + state: {}, + mutations: {}, + actions: {} +}); diff --git a/sapl-frontend/src/views/About.vue b/sapl-frontend/src/views/About.vue new file mode 100644 index 000000000..60e58f473 --- /dev/null +++ b/sapl-frontend/src/views/About.vue @@ -0,0 +1,3 @@ + diff --git a/sapl-frontend/src/views/Home.vue b/sapl-frontend/src/views/Home.vue new file mode 100644 index 000000000..05494f654 --- /dev/null +++ b/sapl-frontend/src/views/Home.vue @@ -0,0 +1,18 @@ + + +