As part of this course, a Neo4j Sandbox instance has been created for you with the recommendations dataset. This dataset contains all of the details required to populate the Neoflix website.
What is Neo4j Sandbox?
Neo4j Sandbox is a free service that allows you to create pre-populated Neo4j instances completely free of charge. Neo4j Sandbox is the perfect environment for experimenting with Neo4j.
You can log into Neo4j Sandbox and create a database with a number of pre-populated datasets by visiting sandbox.neo4j.com.
Extending Your Sandbox Instance
By default, a Neo4j sandbox instance exists for 3 days. You can extend it for another 7 days by going to the sandbox site and extending it in the details (right-most down arrow) for the recommendations sandbox.
Updating App Settings
You should add these properties to the Neoflix/appsettings.json
file so they can be used within the API.
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"Jwt": {
"secret": "SuperSecureSecret"
},
"Neo4j": {
"uri": "neo4j://{sandbox-ip}:{sandbox-boltPort}",
"username": "{sandbox-username}",
"password": "{sandbox-password}"
},
"Password": {
"rounds": "10"
}
}
Once saved, these values are accessed through the Config class and loaded into the application.
var config = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.Build();
var neo4j = config.GetSection("Neo4j");
Neo4jUri = neo4j["uri"];
Neo4jUsername = neo4j["username"];
Neo4jPassword = neo4j["password"];
Applying Application Properties
Remember to restart the process after updatingappsettings.json
to apply the updated configuration.Mark as Completed
Once you have added the settings above to your configuration file, click the button below to continue.
Lesson Summary
You now have a project setup and running with dummy data, and you have added your sandbox configuration details to the environment variables. You should now be ready to go.
In the next module, you will learn about the Neo4j en Driver.