Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,57 @@
:language: JavaScript
:disable-cache: true

include::{shared}/courses/gitpod/introduction.adoc[leveloffset=+1]
include::../../../../../../shared/courses/codespace/get-started.adoc[]

== Explore the Repository
[%collapsible]
.Develop on your local machine
====
You will need link:https://nodejs.org/en/download[NodeJS] installed and the ability to install packages using `npm`.

Clone the link:{repository-link}[github.com/neo4j-graphacademy/app-nodejs] repository:

[source,bash]
----
git clone https://github.com/neo4j-graphacademy/app-nodejs
----

Install the required packages using `npm`:

[source,bash]
----
npm install
----

You do not need to create a Neo4j database as you will use the provided sandbox instance.
====

== Setup the environment

You can open the repository by clicking the link below:
Create a copy of the `.env.example` file and name it `.env`.
Fill in the required values.

lab::Explore Repository in GitPod[]
[source]
.Create a .env file
----
include::{repository-raw}/main/.env.example[]
----

Update the Neo4j sandbox connection details:

NEO4J_URI:: [copy]#bolt://{sandbox-ip}:{sandbox-boltPort}#
NEO4J_USERNAME:: [copy]#{sandbox-username}#
NEO4J_PASSWORD:: [copy]#{sandbox-password}#

To run the application, open a terminal and run the following command:

[source,bash]
npm run dev

== Explore the Repository

Here are some of the important directories in the project:

// * `.env` - This file holds environment variables for the server and is parsed by the link:https://www.npmjs.com/package/dotenv[`dotenv`^] library.
* `.env` - This file holds environment variables for the server and is parsed by the link:https://www.npmjs.com/package/dotenv[`dotenv`^] library.
* `example/` - Example code for driver instantiation.
* `src/` - The application code:
** `middleware/` - Some custom middleware functions that are used by Express including generic error handling.
Expand All @@ -27,12 +67,6 @@ Here are some of the important directories in the project:
* `public/` - Minified build files for the SPA. *Do not edit these files*.


== Course Challenges

For each challenge, you will be provided with a link to re-open the correct file within the repository.
Clicking these links will also set the credentials
load environment variables for your link:https://sandbox.neo4j.com[Neo4j Sandbox^] instance.

== Your Sandbox Instance

include::{shared}/courses/apps/sandbox.adoc[tag="info"]
Expand All @@ -51,8 +85,6 @@ const {
} = process.env
----

include::{shared}/courses/apps/run-locally.adoc[]

== Done!

Once you are ready, click the button below to complete this lesson.
Expand Down
2 changes: 1 addition & 1 deletion asciidoc/courses/app-nodejs/modules/0-setup/module.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ For readability, the course will also use `async`/`await` syntax.

== Get Started

In the next lesson, we will explore the project in Gitpod and and introduce you to Neo4j Sandbox.
In the next lesson, you will setup your development environment and explore the project.


link:./1-setup/[Setup the Repository →, role=btn]
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,19 @@ You should create a **single instance** of the Driver in your application per Ne

The Neo4j JavaScript Driver is available through the npm registry and can be installed with either `npm` or `yarn`.

[.tab]
.NPM
====
To install using link:https://www.npmjs.com/[NPM^], run the following command.

.NPM
[source,shell]
npm install --save neo4j-driver

// include::{repository-raw}/main/README.adoc[tag=npm]

The `--save` option saves a reference to the `neo4j-driver` package in your `package.json` file.

====

[.tab]
.Yarn
====

To install using link:https://yarnpkg.com/[Yarn^], run the following command.

.Yarn
[source,shell]
yarn add --save neo4j-driver

// include::{repository-raw}/main/README.adoc[tag=yarn]

The `--save` option will save a reference to the `neo4j-driver` package in your `package.json` file.
====

== Creating a Driver Instance

Expand Down