Configure the new file according to your needs and your local setup. Make sure a local Neo4J instance is up and running.
Start the backend for development with:
or start the backend in production environment with:
For e-mail delivery, please configure at least SMTP_HOST and SMTP_PORT in your .env configuration file.
Your 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.
GraphQL Playground
Database Indices and Constraints
Database indices and constraints need to be created when the database and the backend is running:
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:
To reset the database run:
Run:
To reset the database run:
Data migrations
Although Neo4J is schema-less,you might find yourself in a situation in which you have to migrate your data e.g. because your data modeling has changed.
Generate a data migration file:
To run the migration:
Generate a data migration file:
To run the migration:
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!
docker-compose exec backend yarn run db:migrate init
# in folder backend/
# make sure your database is running on http://localhost:7474/browser/
yarn run db:migrate init
$ docker-compose exec backend yarn run db:seed
$ docker-compose exec backend yarn run db:reset
# you could also wipe out your neo4j database and delete all volumes with:
$ docker-compose down -v
# if container is not running, run this command to set up your database indeces and contstraints
$ docker-compose run backend yarn run db:migrate init
$ yarn run db:seed
$ yarn run db:reset
$ docker-compose exec backend yarn run db:migrate:create your_data_migration
# Edit the file in ./src/db/migrations/
$ docker-compose exec backend yarn run db:migrate up
$ yarn run db:migrate:create your_data_migration
# Edit the file in ./src/db/migrations/
$ yarn run db:migrate up
$ docker-compose exec backend yarn run test:jest
$ docker-compose exec backend yarn run test:cucumber