Graph database-driven API for site of theatrical productions, materials, and associated data.
- Clone this repo
- Set Node.js to version specified in
.nvmrc
, which can be achieved by running$ nvm use
(if using Volta then it will be set automatically) - Install Node.js modules:
$ npm install
- Copy development environment variables from
.env-dev
into.env
by running command$ npm run transfer-env-dev
; N.B. values may need to be amended to match your specific local database configuration (see: Database setup)
- Download the Neo4j Desktop app (the version of the Neo4j image in
docker/docker-compose.yml
will be a compatible version) - Create a local Neo4j graph database, configuring as to:
- Neo4j user name matches
.env
DATABASE_USERNAME
value - Neo4j local graph database password matches
.env
DATABASE_PASSWORD
value .env
DATABASE_URL
value is endpoint on which Neo4j local graph database is running- N.B. Neo4j user name and Neo4j local graph database endpoint can be viewed via the Desktop app by running the local Neo4j graph database, then launching the Neo4j Browser and viewing its connection status, which is displayed upon opening the browser and can be returned via browser command
:server status
)
- Neo4j user name matches
- Open Neo4j Desktop app
- On the requisite database, click
…
, thenSettings…
, then edit the settings as below to avoid encounteringNeo4jError: There is not enough memory to perform the current task
when seeding the database: - Uncomment and increase the value:
#server.memory.heap.initial_size=512m
->server.memory.heap.initial_size=5000m
- Uncomment and increase the value:
#server.memory.heap.max_size=512m
->server.memory.heap.max_size=5000m
- Press
Apply
- On the requisite database, click
- Open Neo4j Desktop app
- Press
► Start
for requisite database
- Run local Neo4j graph database
- Run server using
$ npm start
- Visit routes via
http://localhost:3000
(e.g.http://localhost:3000/productions
)
- Ensure that a local instance of Neo4j graph database and app are running
- Run
$ npm run seed-db
- Run a local instance of
dramatis-cms
onhttp://localhost:3001
, which will point at this API on port 3000
- Run a local instance of
dramatis-spa
(single-page application) onhttp://localhost:3002
, which will point at this API on port 3000
or
- Run a local instance of
dramatis-ssr
(server-side rendered) onhttp://localhost:3003
, which will point at this API on port 3000
$ npm run lint-check
$ npm run unit-test
$ npm run int-test
- Download and run the Docker Desktop app
- Stop any Neo4j databases running on the Neo4j Desktop app if they share the same port number as that used by the Docker-served Neo4j instance
- Start the Docker-served resources by running
$ npm run e2e-test-resources
and wait until they are ready - In a separate CLI tab run
$ npm run e2e-test
- The Docker-served Neo4j database can be queried via the Neo4j browser by visiting
http://localhost:7474
For the purposes of providing focused and sufficient test coverage, the data used for tests is a mixture of:
- real data, e.g. entirely from a real-life production
- real data with contrived elements, e.g. a real-life play whose credits include made-up entities
- wholly contrived data, e.g. a made-up awards ceremony that nominates made-up entities
Using venue model as an example.
- Get data required to prepare new venue
- Create venue
- Requires body, e.g.
{ "name": "National Theatre" }
- Get data required to edit specific venue
- Update specific venue
- Requires body, e.g.
{ "name": "Almeida Theatre" }
- Delete specific venue
- Show specific venue
- List venues