Browse Source

[+Elena] - #87 Delete neptune!

Jordi Coscolla 1 year ago
parent
commit
a60dea932a

+ 0 - 2
apps/neptune-id/.gitignore

@@ -1,2 +0,0 @@
1
-/node_modules
2
-/build

+ 0 - 20
apps/neptune-id/README.md

@@ -1,20 +0,0 @@
1
-# Neptune ID
2
-
3
-## Run
4
-
5
-In a terminal window run:
6
-```
7
-npm install
8
-```
9
-
10
-Then
11
-```
12
-npm run webpack
13
-```
14
-
15
-and in the second tab
16
-```
17
-npm start
18
-```
19
-
20
-Go to http://localhost:3020/

+ 0 - 49
apps/neptune-id/atlantis.gopipeline.json

@@ -1,49 +0,0 @@
1
-{
2
-  "name": "Neptune",
3
-  "environment_variables": [],
4
-  "group" : "ScaleModel",
5
-  "materials": [
6
-    {
7
-      "url": "https://gogs.dyne.org/DECODE/decode-prototype.git",
8
-      "type": "git",
9
-      "filter": {
10
-        "whitelist": [
11
-          "apps/neptune-id/**/*"
12
-        ]
13
-      }
14
-    }
15
-  ],
16
-  "stages": [
17
-    {
18
-      "name": "deploy",
19
-      "fetch_materials": true,
20
-      "never_cleanup_artifacts": false,
21
-      "clean_working_directory": true,
22
-      "environment_variables": [],
23
-      "jobs": [
24
-        {
25
-          "name": "deploy",
26
-          "environment_variables": [],
27
-          "tabs": [],
28
-          "resources": ["node"],
29
-          "artifacts": [],
30
-          "properties": [],
31
-          "run_instance_count": null,
32
-          "timeout": 0,
33
-          "tasks": [
34
-            {
35
-              "type": "exec",
36
-              "run_if": "passed",
37
-              "on_cancel" : null,
38
-              "command": "./go.sh",
39
-              "arguments": [
40
-                "deploy"
41
-              ],
42
-              "working_directory": "apps/neptune-id"
43
-            }
44
-          ]
45
-        }
46
-      ]
47
-    }
48
-  ]
49
-}

+ 0 - 8
apps/neptune-id/envConfig.json

@@ -1,8 +0,0 @@
1
-{
2
-  "development": {
3
-    "atlantisUrl": "http://localhost:3010/"
4
-  },
5
-  "production": {
6
-    "atlantisUrl" : "http://atlantis-decode.s3-website-eu-west-1.amazonaws.com/"
7
-  }
8
-}

+ 0 - 19
apps/neptune-id/go.sh

@@ -1,19 +0,0 @@
1
-#!/usr/bin/env bash
2
-
3
-deploy() {
4
-  npm install && npm run build:prod && cd build/ && aws s3 sync . s3://neptune-id
5
-}
6
-
7
-usage() {
8
-  echo "Usage:"
9
-  echo -e "deploy \t\t\t\t : builds and deploys to AWS S3 bucket"
10
-}
11
-
12
-OPTION="$1"
13
-  case $OPTION in
14
-    deploy)
15
-      deploy
16
-      ;;
17
-    *)
18
-      usage
19
-  esac

+ 0 - 10
apps/neptune-id/index.html

@@ -1,10 +0,0 @@
1
-<!DOCTYPE html>
2
-<html>
3
-    <title>Neptune</title>
4
-    <meta charset="UTF-8">
5
-    <meta name="viewport" content="width=device-width, initial-scale=1">
6
-    <body>
7
-        <div id='root'></div>
8
-        <script src="build/bundle.js"></script>
9
-    </body>
10
-</html>

File diff suppressed because it is too large
+ 0 - 9632
apps/neptune-id/package-lock.json


+ 0 - 43
apps/neptune-id/package.json

@@ -1,43 +0,0 @@
1
-{
2
-  "name": "atlantis",
3
-  "version": "1.0.0",
4
-  "description": "",
5
-  "main": "index.jsx",
6
-  "scripts": {
7
-    "start": "nodemon src/server/index.js",
8
-    "webpack": "./node_modules/.bin/webpack -w",
9
-    "build:dev": "NODE_ENV='development' webpack",
10
-    "build:prod": "NODE_ENV='production' webpack",
11
-    "test": "mocha --compilers babel-core/register ./test/*test.js"
12
-  },
13
-  "keywords": [],
14
-  "author": "",
15
-  "license": "ISC",
16
-  "dependencies": {
17
-    "express": "^4.16.2",
18
-    "nodemon": "^1.14.11",
19
-    "prop-types": "^15.6.0",
20
-    "query-string": "^5.0.1",
21
-    "react": "^16.2.0",
22
-    "react-dom": "^16.2.0",
23
-    "react-router-dom": "^4.2.2",
24
-    "styled-components": "^2.4.0"
25
-  },
26
-  "devDependencies": {
27
-    "babel": "^6.23.0",
28
-    "babel-core": "^6.26.0",
29
-    "babel-loader": "^7.1.2",
30
-    "babel-preset-es2015": "^6.24.1",
31
-    "babel-preset-react": "^6.24.1",
32
-    "chai": "^4.1.2",
33
-    "copy-webpack-plugin": "^4.3.1",
34
-    "css-loader": "^0.28.7",
35
-    "enzyme": "^3.2.0",
36
-    "html-webpack-plugin": "^2.30.1",
37
-    "mocha": "^4.0.1",
38
-    "node-sass": "^4.7.2",
39
-    "sass-loader": "^6.0.6",
40
-    "style-loader": "^0.19.1",
41
-    "webpack": "^3.10.0"
42
-  }
43
-}

BIN
apps/neptune-id/src/assets/neptune.jpg


+ 0 - 9
apps/neptune-id/src/client/components/App.jsx

@@ -1,9 +0,0 @@
1
-import React, { Component } from 'react';
2
-import Router from './Router.jsx';
3
-
4
-const App = () => (
5
-  <Router />
6
-);
7
-
8
-export default App;
9
-

+ 0 - 50
apps/neptune-id/src/client/components/Header.jsx

@@ -1,50 +0,0 @@
1
-import styled from 'styled-components';
2
-import React from 'react';
3
-
4
-const smallScreen = 'only screen and (max-width: 400px)';
5
-const mediumScreen = 'only screen and (max-width: 750px)';
6
-
7
-const Header = styled.div`
8
-  background-image: url(./assets/neptune.jpg);
9
-  background-position: center top;
10
-  background-repeat: no-repeat;
11
-  background-size: 100% auto;
12
-  height: 0px;
13
-  overflow: hidden;
14
-  padding-bottom: 24%;
15
-  margin-bottom: 40px;
16
- `;
17
-
18
-const Welcome = styled.div`
19
-  font-size: 25px;
20
-  font-weight: 100;
21
-  text-align: center;
22
-  color: white;
23
-  margin: auto;
24
-  margin-top: 10%;
25
-  background-color: rgba(114,127,142,0.65);
26
-  font-family: Verdana,sans-serif;
27
-  letter-spacing: 9px;
28
-  width: 400px;
29
-  padding: 5px;
30
-   
31
-  @media ${mediumScreen} {
32
-    font-size: 22px;
33
-    letter-spacing: 5px;
34
-    padding: 3px;
35
-    width: 250px;
36
-  }
37
-  
38
-  @media ${smallScreen} {
39
-    font-size: 17px;
40
-    width: 200px;
41
-  }
42
-`;
43
-
44
-const HeaderComponent = () => (
45
-  <Header>
46
-    <Welcome>NEPTUNE ID</Welcome>
47
-  </Header>
48
-);
49
-
50
-export default HeaderComponent;

+ 0 - 69
apps/neptune-id/src/client/components/Login.jsx

@@ -1,69 +0,0 @@
1
-import React from 'react';
2
-import styled from 'styled-components';
3
-import PropTypes from 'prop-types';
4
-import HeaderComponent from './Header';
5
-
6
-const queryString = require('query-string');
7
-
8
-const Form = styled.form`
9
-  text-align: center
10
-  `;
11
-
12
-const Input = styled.input`
13
-  display: block;
14
-  padding: 1em;
15
-  margin: auto;
16
-  margin-bottom: 0.5em;
17
-  color: black;
18
-  background: lightgray;
19
-  border: none;
20
-  border-radius: 3px;
21
-  font-size: 16px;
22
-`;
23
-
24
-const Button = styled.a`
25
-  display: block;
26
-  font-size: 1em;
27
-  margin: auto;
28
-  padding: 0.5em 1em;
29
-  margin-top: 15px;
30
-  border: 1px solid grey;
31
-  border-radius: 3px;
32
-  width: 80px;
33
-  font-family: verdana, sans-serif;
34
-  text-decoration: none;
35
-  color: dimgrey;
36
-`;
37
-
38
-const Login = (props) => {
39
-  const parsed = queryString.parse(props.location.search);
40
-  const linkingUri = encodeURIComponent(parsed.linkingUri);
41
-
42
-  return (
43
-    <div>
44
-      <HeaderComponent />
45
-      <Form>
46
-        <Input
47
-          placeholder="Your Neptune ID"
48
-        />
49
-        <Input
50
-          placeholder="Password"
51
-          type="password"
52
-        />
53
-        <Button href={`${atlantisUrl}#/attribute/?linkingUri=${linkingUri}`}>
54
-          Login
55
-        </Button>
56
-      </Form>
57
-    </div>
58
-  );
59
-};
60
-
61
-Login.propTypes = {
62
-  location: PropTypes.shape({ search: PropTypes.string.isRequired }),
63
-};
64
-
65
-Login.defaultProps = {
66
-  location: { search: () => {} } };
67
-
68
-export default Login;
69
-

+ 0 - 13
apps/neptune-id/src/client/components/Router.jsx

@@ -1,13 +0,0 @@
1
-import React from 'react';
2
-import { HashRouter, Route, Switch } from 'react-router-dom';
3
-import Login from './Login';
4
-
5
-const Routes = () => (
6
-  <HashRouter>
7
-    <Switch>
8
-      <Route exact path="/" component={Login} />
9
-    </Switch>
10
-  </HashRouter>
11
-);
12
-
13
-export default Routes;

+ 0 - 6
apps/neptune-id/src/client/index.jsx

@@ -1,6 +0,0 @@
1
-import React from 'react';
2
-import { render } from 'react-dom';
3
-import App from './components/App.jsx';
4
-
5
-render(
6
-  <App />, document.getElementById('root'));

+ 0 - 30
apps/neptune-id/src/client/scss/application.scss

@@ -1,30 +0,0 @@
1
-body,h1,h2,h3,h4,h5,h6 {font-family: "Lato", sans-serif;}
2
-body, html {
3
-  height: 100%;
4
-  color: #777;
5
-  line-height: 1.8;
6
-}
7
-
8
-/* Create a Parallax Effect */
9
-.bgimg-1, .bgimg-2, .bgimg-3 {
10
-  background-attachment: fixed;
11
-  background-position: center;
12
-  background-repeat: no-repeat;
13
-  background-size: cover;
14
-}
15
-
16
-/* First image (Logo. Full height) */
17
-.bgimg-1 {
18
-  background-image: url("https://images.unsplash.com/photo-1500100586562-f75ff6540087?auto=format&fit=crop&w=2978&q=80");
19
-  min-height: 50%;
20
-}
21
-
22
-.w3-wide {letter-spacing: 10px;}
23
-.w3-hover-opacity {cursor: pointer;}
24
-
25
-/* Turn off parallax scrolling for tablets and phones */
26
-@media only screen and (max-device-width: 1024px) {
27
-  .bgimg-1, .bgimg-2, .bgimg-3 {
28
-    background-attachment: scroll;
29
-  }
30
-}

+ 0 - 9
apps/neptune-id/src/server/index.js

@@ -1,9 +0,0 @@
1
-const express = require('express');
2
-
3
-const app = express();
4
-
5
-console.log(`${__dirname}./../../build`);
6
-
7
-app.use(express.static(`${__dirname}./../../build`)); // serves the index.html
8
-app.listen(3020);
9
-// listens on port 3010 -> http://localhost:3020/

+ 0 - 66
apps/neptune-id/webpack.config.js

@@ -1,66 +0,0 @@
1
-const path = require('path');
2
-const webpack = require('webpack');
3
-const CopyWebpackPlugin = require('copy-webpack-plugin');
4
-const HtmlWebpackPlugin = require('html-webpack-plugin');
5
-const envConfig = require('./envConfig.json');
6
-
7
-const BUILD_DIR = path.resolve(__dirname, './build');
8
-const APP_DIR = path.resolve(__dirname, './src/client');
9
-
10
-const getAtlantisURL = () => {
11
-  switch (process.env.NODE_ENV) {
12
-    case 'production':
13
-      return envConfig.production.atlantisUrl;
14
-    default:
15
-      return envConfig.development.atlantisUrl;
16
-  }
17
-};
18
-
19
-const config = {
20
-  entry: {
21
-    main: `${APP_DIR}/index.jsx`,
22
-  },
23
-  output: {
24
-    filename: 'bundle.js',
25
-    path: BUILD_DIR,
26
-  },
27
-  module: {
28
-    rules: [
29
-      {
30
-        test: /(\.css|.scss)$/,
31
-        use: [{
32
-          loader: 'style-loader', // creates style nodes from JS strings
33
-        }, {
34
-          loader: 'css-loader', // translates CSS into CommonJS
35
-        }, {
36
-          loader: 'sass-loader', // compiles Sass to CSS
37
-        }],
38
-      },
39
-      {
40
-        test: /\.(jsx|js)?$/,
41
-        use: [{
42
-          loader: 'babel-loader',
43
-          options: {
44
-            cacheDirectory: true,
45
-            presets: ['react', 'es2015'], // Transpiles JSX and ES6
46
-          },
47
-        }],
48
-      },
49
-    ],
50
-  },
51
-  plugins: [
52
-    new HtmlWebpackPlugin({
53
-      template: './index.html',
54
-    }),
55
-    new CopyWebpackPlugin([
56
-      // {output}/to/file.txt
57
-      { from: './src/assets', to: './assets' }]),
58
-    new webpack.DefinePlugin({
59
-      atlantisUrl: JSON.stringify(getAtlantisURL()),
60
-    })],
61
-  resolve: {
62
-    extensions: ['.js', '.json', '.jsx'],
63
-  },
64
-};
65
-
66
-module.exports = config;