Skip to content

sdaschner/favorite-coffee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Favorite Coffee — Coffee recommendation with Neo4j and Quarkus

How to build a coffee beans recommendation with Neo4j and Quarkus. To get the full story, see this blog post and the explanation videos: https://blog.sebastian-daschner.com/entries/building-recommendations-with-neo4j

Development

Requires JDK 16, Maven, and Docker.

You can start a fresh Neo4j instance with:

./run-graph-db.sh

In another terminal, run the following to create the sample data:

docker exec graph-db /var/lib/neo4j/bin/cypher-shell -u neo4j -p test --file /import/load-coffee-data.cypher

Or alternatively run the Cypher-Queries in your IDE or the Neo4j Browser.

Then run the application in development mode (connecting to the local Neo4j server) with:

mvn quarkus:dev

Then, explore the coffee website at: http://localhost:8080/

Production

You can create your online free cloud instance of Neo4j at https://dev.neo4j.com/aura

After creating your database, load the Cypher data, and update your application.properties with the connection URL and password:

# Your Neo4j URI, use `neo4j` instead of `neo4j+s`, due to a Quarkus issue in 2.1.2
quarkus.neo4j.uri=neo4j://xxxxab01.databases.neo4j.io
quarkus.neo4j.encrypted=true
quarkus.neo4j.authentication.username=[...]
quarkus.neo4j.authentication.password=[...]

Then you can package your application and run it in production mode.

mvn package
java -jar target/quarkus-app/quarkus-run.jar