Skip to content

Commit

Permalink
Merge branch 'mmore500-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
cvaz committed Feb 17, 2024
2 parents 174be7a + cee3aa9 commit 2d8cf27
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,26 @@ The script [`example.sh`](scripts/example/example.sh) illustrates the API use ca
It is important that a Google account is registered as admin, and that you have a valid token.
Check the initialization step in the [`example.sh`](scripts/example/example.sh) script, and/or the [template for data initialization](scripts/init/init_data.cypher).

To run the example,

export TOKEN="YOUR_TOKEN"
export USER_ID="YOUR_USER_ID"
git clone https://github.com/phyloviz/phyloDB.git phyloDB.git
cd phyloDB.git/
sed 's|#spring.data.neo4j.uri=bolt://phylodb-neo4j:7687|spring.data.neo4j.uri=bolt://phylodb-neo4j:7687|g' -i phylodb/bin/main/application.properties
sed 's|spring.data.neo4j.uri=bolt://localhost:7687|#spring.data.neo4j.uri=bolt://localhost:7687|g' -i phylodb/bin/main/application.properties
./configure.sh
cd docker
./build-docker.sh
./start-docker.sh
cd ../scripts/example
echo y | ./example.sh

To generate `YOUR_TOKEN`, access <https://developers.google.com/oauthplayground/>, sign in, and click 'Authorize
APIs' with the custom scope `https://www.googleapis.com/auth/userinfo.email`.
Click in 'Exchange authorization code for tokens' and use the provided 'Access token'.
Use the account email associated with this token as `YOUR_USER_ID`.

# More documentation
The [Wiki](https://github.com/phyloviz/phyloDB/wiki) of this project documents several topics, namely archictecural views, deployment, authentication and API definition (usage).

Expand Down
8 changes: 7 additions & 1 deletion scripts/init/make_init_data.cypher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,11 @@ CALL apoc.cypher.runMany("MATCH(n) DETACH DELETE n;
CREATE (:User {provider: 'google', id: '${USER_ID}', deprecated: false})-[:CONTAINS_DETAILS {from: datetime(), version: 1}]->(:UserDetails {role: 'admin'});", {});
EOF

#cat init_data.cypher | docker exec --interactive phylodb-neo4j sh -c "cypher-shell -u neo4j -p password"
echo "Initialize phylodb-neo4j container with init_data.cypher?"
echo "WARNING: Performs a potentially destructive full delete operation."
read -p "Continue? (y/n):" user_input

if [[ "$user_input" = y* ]]; then
echo "Initializing container with init_data.cypher..."
cat init_data.cypher | docker exec --interactive phylodb-neo4j sh -c "cypher-shell -u neo4j -p password"
fi

0 comments on commit 2d8cf27

Please sign in to comment.