(Install Node.Js and NPM - Node Package Manager - if not done yet)
- Install Neo4j with apoc:
docker run \
-p 7474:7474 -p 7687:7687 \
-v $PWD/data:/data -v $PWD/plugins:/plugins \
--name neo4j-apoc \
-e NEO4J_apoc_export_file_enabled=true \
-e NEO4J_apoc_import_file_enabled=true \
-e NEO4J_apoc_import_file_use__neo4j__config=true \
-e NEO4JLABS_PLUGINS=\[\"apoc\"\] \
neo4j:4.0
- Open "localhost:7474" in the browser.
- Sign in with username "neo4j" and password "neo4j".
- Set as new password "test". Confirm the password.
- Navigate into the /Server/Graphql-ApolloServer folder.
- Install the ApolloServer:
npm install
- Start the ApolloServer
node index.js
- Open "localhost:4000" in the browser and click on "Query your server". You will be redirected.
- In the /Server/Neo4j-Database folder copy the content of the feed.gql and paste it into the middle operation box in the browser interface. Click "Run" to execute the mutation.
- Do step 2 for the feed2.gql file.
- Test the feed by paste the following query into the middle operation box in the browser interface. Click "Run" to execute the query:
query {
users(where: { username: "Kilian" }) {
Questionnaire(where: { id: "Project 1" }) {
OpenQuestions
ClosedQuestions {
id
component
scope
answer
answered_at
}
}
}
}
The following command lists all running docker processes:
docker ps
The name of our docker process is neo4j-apoc (see first step: 1. Install Neo4j with apoc):
docker stop neo4j-apoc
docker start neo4j-apoc
- In the root folder of this project paste the following commands:
npm install
- Compile and build project:
npm run serve