Setting up the Project

We have put together a project with all the boilerplate in place. As you move through this course, you will learn some theory and then how to apply it to the example project.

In order to run the project, you must make sure that .NET SDK 6.0 is installed.

Setup .NET SDK

We are assuming that in taking this course, you already have at least a basic understanding of C# and the .NET ecosystem.

The project has been written to work with .NET SDK version 6.0.

If you haven’t already installed the .NET SDK, you can download the relevant installer here.

You can verify that the installation is successful by running the following command in the command line:

sh
Verify .NET SDK Version
dotnet --version

Clone the Repository

You can obtain a copy of the project source code by cloning the neo4j-graphacademy/app-dotnet repository from Github. Or, if you prefer, you can also download a zip file with the source.

Learn how to interact with Neo4j from .NET using the Neo4j .NET DriverHTTPS

To clone the repository without logging in via HTTPS, you can run the following command to clone the repository:

shell
Clone Repository Using HTTPS
git clone https://github.com/neo4j-graphacademy/app-dotnet.git
Learn how to interact with Neo4j from .NET using the Neo4j .NET DriverSSH

If you have a GitHub account configured with SSH access, you can run the following command to clone the repository:

shell
Clone Repository using SSH
git clone git@github.com:neo4j-graphacademy/app-dotnet.git
Learn how to interact with Neo4j from .NET using the Neo4j .NET DriverGitHub CLI

If you have the GitHub CLI installed, you can run the following command to clone the repository:

sh
Clone Repository using the GitHub CLI
gh repo clone neo4j-graphacademy/app-dotnet
Learn how to interact with Neo4j from .NET using the Neo4j .NET DriverDownload Zip File

Click the following link to download the source as a .zip file.

https://github.com/neo4j-graphacademy/app-dotnet/archive/refs/heads/main.zip.

Building the Project

Once you have cloned the repository, navigate to the folder in your terminal and run the dotnet build command to install all dependencies.

sh
Build the Project
dotnet build

You can view a full list of dependencies by opening Neoflix.csproj.

Application Configuration

This project will configuration from the appsettings.json file in the project root.

In the next lesson you will add your Neo4j Sandbox credentials to this file.

Start the Project

To start the project in watch mode, run the following command:

sh
Start the Neoflix project in watch mode
dotnet watch --project Neoflix

Running this command will listen for changes and automatically hotload any changes.

You should see an output similar to the following confirming that the server has successfully started:

console
Console Output
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:3000
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.

A Brief Tour of the Project

If you open up the listening address in your browser, you will see a Single Page Application (SPA) that communicates with the API served at http://localhost:3000/api. Currently, the responses are hardcoded, but as you progress through the course, you will learn how to query Neo4j to find this information.

Here are some of the important directories in the project:

  • Examples - Example code for driver instantiation.

  • Neoflix - The project code:

    • Neoflix/Controllers - Route handlers that are registered on the server. You shouldn’t need to edit these files.

    • Neoflix/Example - JSON files with the hardcoded responses sent by the server.

    • Neoflix/Exceptions - Domain specific exceptions thrown by the project.

    • Neoflix/Properties - Application configuration files.

    • Neoflix/Services - Services that you will need to update to interact with Neo4j.

    • Neoflix/wwwroot - Minified build files for the Web application. Do not edit these files.

    • Neoflix/appsettings.json - Your project configuration. You will edit this file in the next lesson.

    • Neoflix/Config.cs - This file reads the config settings from appsettings.json

    • Neoflix/HttpRequestUtils.cs - Helper functions for pagination

    • Neoflix/Neo4j.cs - Here is where you will create your Neo4j .NET Driver Instance.

  • Neoflix.Challenges - Test files that will you will need to run in order to pass the text. You will run these using the dotnet test command.

Done!

Once you have the project up and running, click the button below to complete this lesson.

Next Steps

Now that we have the project up and running, let’s take a look at the Neo4j Sandbox instance that has been created as part of your enrollment in this course.