Skip to content
Snippets Groups Projects
Commit dfe505c8 authored by Marc Feger's avatar Marc Feger
Browse files

Init commit

parents
No related branches found
No related tags found
No related merge requests found
# dependencies
node_modules
# IDE files
.idea
# build files
dist
# misc
.DS_Store
npm-debug.log
\ No newline at end of file
Source diff could not be displayed: it is too large. Options to address this: view the blob.
{
"name": "neo4j",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"build": "webpack",
"start:dev": "webpack-dev-server"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.4.5",
"@babel/preset-env": "^7.4.5",
"babel-loader": "^8.0.6",
"css-loader": "^2.1.1",
"file-loader": "^3.0.1",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.7.0",
"neo4j-driver": "^1.7.5",
"node-sass": "^4.12.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"webpack": "^4.32.2",
"webpack-cli": "^3.3.2",
"webpack-dev-server": "^3.5.1"
}
}
import './neo'
// TODO: Dockerize and add a Neo4j-Server
// TODO: Why are there so many results? Improve the loops
// TODO: Lift the nodes and relations into a good representation
// TODO: Add a class for the data
// TODO: Lift the data in a graph and visualize them
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Foo</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
import {v1 as neo4j} from 'neo4j-driver'
const authToken = neo4j.auth.basic('neo4j', 'W7uFSy$ywR3M3ck');
console.log(authToken);
const driver = neo4j.driver('bolt://localhost:7687', authToken, {
encrypted: false
});
const session = driver.session();
const personName = 'Marc';
const resultPromise = session.run(
'match (a:Person)-[r:IS_FRIEND]->(b:Person) RETURN a,b,r',
{name: personName}
);
resultPromise.then(result => {
session.close();
result.records.forEach(function (element) {
element.forEach(function (subelement) {
console.log("++++++ " + subelement.constructor.name + " ++++++");
if (subelement instanceof neo4j.types.Node) {
console.log("Properties: " + JSON.stringify(subelement.properties));
console.log("ID: " + subelement.identity.toInt());
console.log("Labels: " + subelement.labels);
} else if (subelement instanceof neo4j.types.Relationship) {
console.log("Type: " + subelement.type);
console.log("Properties: " + JSON.stringify(subelement.properties));
console.log("Start: " + subelement.start.toInt());
console.log("End: " + subelement.end.toInt());
}
});
});
driver.close();
});
const HtmlWebPackPlugin = require("html-webpack-plugin");
const MiniCssExtraPlugin = require("mini-css-extract-plugin");
module.exports = {
entry: {
app: './src/app.js'
},
module: {
rules: [{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
}
, {
test: /\.html$/,
use: [
{
loader: "html-loader",
options: {minimize: true}
}
]
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
"file-loader"
]
},
{
test: /\.scss$/,
use: [
"style-loader",
"css-loader",
"sass-loader"
]
}
]
},
plugins: [
new HtmlWebPackPlugin({
template: "./src/index.html",
filename: "index.html"
}),
new MiniCssExtraPlugin({
filename: "[name].css",
chunkFilename: "[id].css"
})
]
};
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment