Skip to content

Latest commit

 

History

History
94 lines (68 loc) · 4.17 KB

DEVELOPMENT.md

File metadata and controls

94 lines (68 loc) · 4.17 KB

Development

This documents how to start the development process.

Chrome Extensions

Here are some chrome extensions that will improve your development experience:

Code Editors

We recommend using Visual Studio Code, with the following extensions:

If you do not have access to a development machine, you can create a new Gitpod workspace by clicking the button below:

Open in Gitpod

Deno

This project uses the Deno JavaScript runtime to run the scripts. You can check the manual at https://deno.land/manual/introduction.

Databases

Our project requires two types of databases, particularly Surreal and Neo4j.

SurrealDB

To learn about the query language used, you can check the SurrealQL specifications.

  • Install SurrealDB.
  • Start your database (e.g. surreal start --log info --user <username> --pass <password> memory).
  • Create a .env file from the .env.template.
  • Fill in the required values.
  • Run the following commands to populate the database:
    • deno task surrealdb-populate-webnovel-chapters
    • deno task surrealdb-populate-webnovel-volumes
    • deno task surrealdb-populate-kindle-ebooks
    • deno task surrealdb-populate-audible-audiobooks

Persisting to disk

Instead of memory, you can pass in file://<filepath>.

If you are running on a Docker container, you can persist the data by creating a volume:

$ docker pull surrealdb/surrealdb:1.0.0-beta.8
$ docker volume create <volume>
$ docker run --rm \
  --publish <newport>:8000 \
  --volume <volume>:/var/inndexdb \
  surrealdb/surrealdb:1.0.0-beta.8 \
    start --log info --user <username> --pass <password> file://var/inndexdb

Neo4j

If you want to understand how to work with graphs, there is a free learning resource at GraphAcademy.

  • Ready your Neo4j database. You can use the free fully-managed solution at Neo4j AuraDB or self-host your own instance.
  • Open the Neo4j Browser and run the commands from schemas/create-constraints.cypher to create the constrants.
  • Create a .env file from the .env.template.
  • Fill in the required values.
  • Run the following commands to populate the database:
    • deno task neo4j-populate-media-nodes
    • deno task neo4j-populate-bracket-contents

Installing the Community Edition (Docker)

Check the docs here: https://neo4j.com/docs/operations-manual/current/docker/

$ docker pull neo4j:5.1.0-community
$ docker volume create <volume-data>
$ docker volume create <volume-logs>
$ docker run \
  --restart no \
  --publish=7474:7474 \
  --publish=7687:7687 \
  --volume=<volume-data>:/data \
  --volume=<volume-logs>:/logs \
    --env NEO4J_AUTH=neo4j/<password> \
  neo4j:5.1.0-community