Commit 03aebb4b authored by cazenave's avatar cazenave
Browse files

Initial commit

parents
> 1%
last 2 versions
*
!dist
!nginx
!src
!node_modules/bootstrap
!node_modules/bootstrap-vue
!node_modules/prismjs
!node_modules/vue-select
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/recommended',
'@vue/airbnb',
'@vue/typescript',
],
rules: {
'class-methods-use-this': 'off',
'no-alert': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-unused-vars': ['off'],
semi: ['error', 'never'],
'import/extensions': ['error', 'always', {
js: 'never',
mjs: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
vue: 'always',
}],
'import/prefer-default-export': 'off',
'vue/component-name-in-template-casing': ['error', 'kebab-case', {
registeredComponentsOnly: false,
ignores: [],
}],
},
parserOptions: {
parser: '@typescript-eslint/parser',
},
}
.DS_Store
node_modules
/dist
/public/config.js
# 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?
FROM nginx:alpine
RUN apk add --no-cache libsass sassc && rm -f /tmp/* /etc/apk/cache/*
COPY node_modules/bootstrap src/~bootstrap
COPY node_modules/bootstrap-vue src/~bootstrap-vue
COPY node_modules/prismjs src/~prismjs
COPY node_modules/vue-select src/~vue-select
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
COPY nginx/start.sh /start.sh
COPY src src
COPY dist /usr/share/nginx/html
COPY dist /usr/share/nginx/html/app
CMD ["/start.sh"]
MIT License
Copyright (c) 2019 Dutch Techncentre for Life Sciences
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.
# FAIR Data Point Client
> Client application for the [FAIR Data Point](https://github.com/FAIRDataTeam/FAIRDataPoint) providing an HTML-based user interface for browsing the metadata and administration.
[![Build Status](https://travis-ci.org/FAIRDataTeam/FAIRDataPoint-client.svg?branch=master)](https://travis-ci.org/FAIRDataTeam/FAIRDataPoint-client.svg?branch=master)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md)
[Documentation](https://fairdatapoint.readthedocs.io/) explains how to install, configure and use the FAIR Data Point.
## Development
Install dependencies using:
```
$ npm install
```
Create `public/config.js` file. For local development, you need to set the apiURL to where the FDP server is running, usually:
```js
// public/config.js
window.config = {
apiURL: 'http://localhost:8080'
}
```
> **Tip:** If you run both, the server and the client locally, start the server first, because it needs to run on port 8080. The client will then be automatically started on port 8081.
Compile and hot-reload for development:
```
$ npm run serve
```
Compile and minify for production:
```
$ npm run build
```
Run tests or linter:
```
$ npm run test
$ npm run lint
```
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for more details.
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset',
],
}
upstream fdp-api {
server fdp-api.default.svc.cluster.local;
}
server {
listen 80;
server_name localhost;
location / {
set $should_proxy 1;
# Client html
if ($http_accept ~ '(text/html)') {
set $should_proxy 0;
}
# Client assets
if ($request_uri ~ '(\.css)|(\.png)|(\.js)|(\.ico)$') {
set $should_proxy 0;
}
# RDF API
if ($request_uri ~ '(\?format=(.+))$') {
set $should_proxy 1;
}
# Swagger
if ($request_uri ~ '(swagger-ui\.html)') {
set $should_proxy 1;
}
# Swagger assets
if ($request_uri ~ '^(/webjars)') {
set $should_proxy 1;
}
if ($should_proxy) {
proxy_pass http://fdp-api;
break;
}
root /usr/share/nginx/html;
add_header Last-Modified "";
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
error_page 404 =200 /index.html;
}
#!/bin/sh
#sed -i "s#\$FDP_API_SERVICE_HOST#"$FDP_API_SERVICE_HOST"#g" /etc/nginx/conf.d/default.conf
#sed -i "s#\$FDP_API_SERVICE_HOST#"$FDP_API_SERVICE_HOST"#g" /usr/share/nginx/html/config.js
#sed -i "s#\$FDP_API_SERVICE_HOST#"$FDP_API_SERVICE_HOST"#g" /usr/share/nginx/html/app/config.js
nginx -g 'daemon off;'
This diff is collapsed.
{
"name": "fdp-client",
"version": "1.3.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.25",
"@fortawesome/free-regular-svg-icons": "^5.11.2",
"@fortawesome/free-solid-svg-icons": "^5.11.2",
"@fortawesome/vue-fontawesome": "^0.1.7",
"@types/rdflib": "^0.20.1",
"axios": "^0.19.0",
"bootstrap": "^4.3.1",
"bootstrap-vue": "^2.0.4",
"core-js": "^3.1.2",
"lodash": "^4.17.15",
"moment": "^2.24.0",
"prismjs": "^1.20.0",
"rdflib": "^1.0.6",
"vue": "^2.6.10",
"vue-class-component": "^7.1.0",
"vue-prism-editor": "^0.5.1",
"vue-property-decorator": "^8.3.0",
"vue-router": "^3.0.6",
"vue-select": "^3.2.0",
"vuelidate": "^0.7.4",
"vuex": "^3.1.1",
"vuex-persist": "^2.2.0"
},
"devDependencies": {
"@types/lodash": "^4.14.149",
"@types/vue-select": "^2.5.0",
"@types/vuelidate": "^0.7.10",
"@typescript-eslint/eslint-plugin": "^2.14.0",
"@typescript-eslint/parser": "^2.14.0",
"@vue/cli-plugin-babel": "^4.0.0",
"@vue/cli-plugin-eslint": "^4.0.0",
"@vue/cli-plugin-router": "^4.0.0",
"@vue/cli-plugin-typescript": "^4.1.0",
"@vue/cli-plugin-vuex": "^4.1.0",
"@vue/cli-service": "^4.0.0",
"@vue/eslint-config-airbnb": "^4.0.0",
"@vue/eslint-config-typescript": "^5.0.1",
"babel-eslint": "^10.0.1",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"node-sass": "^4.13.1",
"sass-loader": "^8.0.0",
"typescript": "~3.5.3",
"vue-template-compiler": "^2.6.10"
}
}
module.exports = {
plugins: {
autoprefixer: {},
},
}
window.config = { publicPath: '' }
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700&display=swap" rel="stylesheet">
<script src="<%= BASE_URL %>config.js"></script>
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>EOSC-Pillar FAIR Data Point</title>
</head>
<body>
<noscript>
<strong>We're sorry but fdp-client doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
#!/bin/bash
set -e
# File with build info
BUILD_INFO_FILE=$(dirname $0)/../dist/js/app.*.js
# Create version based on git tag or branch
branch=`git rev-parse --abbrev-ref HEAD`
commit=`git rev-parse --short HEAD`
version="$branch~$commit"
gittag=`git tag -l --contains HEAD | head -n 1`
if test -n "$gittag"
then
version="$gittag~$commit"
fi
# Get build timestamp
builtAt=`date -R`
# Replace values
sed -i.bak "s#{version}#$version#" $BUILD_INFO_FILE && rm $BUILD_INFO_FILE".bak"
sed -i.bak "s#{builtAt}#$builtAt#" $BUILD_INFO_FILE && rm $BUILD_INFO_FILE".bak"
<template>
<div id="app">
<fdp-header />
<router-view />
<fdp-footer />
</div>
</template>
<script lang="ts">
import FdpFooter from './components/FdpFooter/index.vue'
import FdpHeader from './components/FdpHeader/index.vue'
export default {
components: {
FdpFooter,
FdpHeader,
},
}
</script>
<style lang="scss">
@import "scss/main";
</style>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment