Human Connection
docs-add_missing_env_instruction
docs-add_missing_env_instruction
  • Introduction
  • Edit this Documentation
  • Installation
  • Backend
    • graphql-with-apollo
      • GraphQL with Apollo
        • Mocking
        • Seeding
    • Import
    • Middleware
  • Webapp
    • COMPONENTS
    • PLUGINS
    • STORE
    • PAGES
    • ASSETS
    • LAYOUTS
    • Styleguide
    • STATIC
    • MIDDLEWARE
  • Testing Guide
    • End-to-end tests
    • Frontend tests
    • Backend tests
  • Contributing
  • Deployment
  • Feature Specification
  • Code of conduct
  • License
Powered by GitBook
On this page
  • Backend
  • Installation with Docker
  • Installation without Docker
  • Configure
  • Seed and Reset the Database
  • Testing

Was this helpful?

Backend

PreviousInstallationNextgraphql-with-apollo

Last updated 6 years ago

Was this helpful?

Backend

Installation with Docker

Make sure you are on a version >= v10.12.0:

  node --version

Run:

docker-compose up

# create indices etc.
docker-compose exec neo4j migrate

# if you want seed data
# open another terminal and run
docker-compose exec backend yarn run db:seed

App is

To wipe out your neo4j database run:

docker-compose down -v

Installation without Docker

Install dependencies:

Start Neo4j

neo4j\bin\neo4j start
yarn install
# -or-
npm install

Copy:

cp .env.template .env

Configure the file .env according to your needs and your local setup.

Start the GraphQL service:

yarn dev
# -or-
npm dev

And on the production machine run following:

yarn start
# -or-
npm start

This will start the GraphQL service (by default on localhost:4000) where you can issue GraphQL requests or access GraphQL Playground in the browser:

Configure

Set your Neo4j connection string and credentials in .env. For example:

.env

NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=letmein

You need to install APOC as a plugin for the graph you create in the neo4j desktop app!

Seed and Reset the Database

Optionally you can seed the GraphQL service by executing mutations that will write sample data to the database:

yarn run db:seed
# -or-
npm run db:seed

For a reset you can use the reset script:

yarn db:reset
# -or-
npm run db:reset

Testing

Beware: We have no multiple database setup at the moment. We clean the database after each test, running the tests will wipe out all your data!

Run the jest tests:

yarn run test
# -or-
npm run test

Run the cucumber features:

yarn run test:cucumber
# -or-
npm run test:cucumber

When some tests fail, try yarn db:reset and after that yarn db:seed. Then run the tests again

Download and unpack the files.

Download and drop the file into the plugins folder of the just extracted Neo4j-Server

and confirm it's running

Note that grand-stack-starter does not currently bundle a distribution of Neo4j. You can download and run locally for development, spin up a , run Neo4j in one of the , or on Debian-based systems install . Just be sure to update the Neo4j connection string and credentials accordingly in .env.

node
running on port 4000
Neo4j Community Edition
Neo4j Apoc
here
Neo4j Desktop
hosted Neo4j Sandbox instance
many cloud options
spin up Neo4j in a Docker container
Neo4j from the Debian Repository
GraphQL Playground