Backend
Backend
Installation
Run the following command to install everything through docker.
The installation takes a bit longer on the first pass or on rebuild ...
$ docker-compose up
# rebuild the containers for a cleanup
$ docker-compose up --buildOpen another terminal and create unique indices with:
$ docker-compose exec neo4j migrateFor the local installation you need a recent version of node (>= v10.12.0) and Neo4J along with Apoc plugin installed on your system.
Download Neo4j Community Edition and unpack the files.
Download Neo4j Apoc and drop the file into the plugins folder of the just extracted Neo4j-Server Note that grand-stack-starter does not currently bundle a distribution of Neo4j. You can download Neo4j Desktop and run locally for development, spin up a hosted Neo4j Sandbox instance, run Neo4j in one of the many cloud options, spin up Neo4j in a Docker container or on Debian-based systems install Neo4j from the Debian Repository. Just be sure to update the Neo4j connection string and credentials accordingly in .env. Start Neo4J and confirm the database is running at http://localhost:7474.
Now install node dependencies with yarn:
$ cd backend
$ yarn installCopy Environment Variables:
# in backend/
$ cp .env.template .envConfigure the new files according to your needs and your local setup.
Create unique indices with:
$ ./neo4j/migrate.shStart the backend for development with:
$ yarn run devor start the backend in production environment with:
yarn run startYour backend is up and running at http://localhost:4000/ This will start the GraphQL service (by default on localhost:4000) where you can issue GraphQL requests or access GraphQL Playground in the browser.

You can access Neo4J through http://localhost:7474/ for an interactive cypher shell and a visualization of the graph.
Seed Database
If you want your backend to return anything else than an empty response, you need to seed your database:
In another terminal run:
$ docker-compose exec backend yarn run db:seedTo reset the database run:
$ docker-compose exec backend yarn run db:reset
# you could also wipe out your neo4j database and delete all volumes with:
$ docker-compose down -vRun:
$ yarn run db:seedTo reset the database run:
$ yarn run db:resetTesting
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:
$ docker-compose exec backend yarn run test:jestRun the cucumber features:
$ docker-compose exec backend yarn run test:cucumberRun the jest tests:
$ yarn run test:jestRun the cucumber features:
$ yarn run test:cucumberLast updated
Was this helpful?