@@ -6,87 +6,35 @@ Bible translation project management API.
6
6
7
7
## Requirements
8
8
9
- 1 . Docker
10
- 1 . Node 16+
11
- 1 . yarn
9
+ 1 . Docker from their website (complications with homebrew)
10
+ 1 . NodeJS ( ` brew install node corepack && corepack enable ` )
11
+ 1 . EdgeDB ( ` brew install edgedb/tap/edgedb-cli ` )
12
12
13
13
## Setup
14
14
15
- ### Docker
16
-
17
- API can be started directly with:
18
-
19
- ```
20
- docker-compose up
21
- ```
22
-
23
- ### Local
24
-
25
- 1 . Ensure you are using at least node v12.17+. Node 14 is recommended.
26
- 1 . Use docker to run a database locally: ` docker-compose up -d db ` . To update your db image: ` docker-compose pull db ` .
27
- 1 . Create a ` .env.local ` file in the root of the project and specify your username and password used at database creation:
28
- ``` ini
29
- NEO4J_USERNAME =neo4j
30
- NEO4J_PASSWORD =admin
31
- ```
15
+ 1 . Ensure you meet the NodeJS version requirement found in [ package.json] ( ./package.json ) .
16
+ 1 . Ensure corepack is enabled ` corepack enable `
32
17
1 . Run ` yarn ` to install dependencies
18
+ 1 . Use docker to run the current database (neo4j) locally: ` docker-compose up -d db ` .
19
+ 1 . Setup an EdgeDB instance (the next gen database replacing neo4j)
20
+ ``` bash
21
+ edgedb project init
22
+ yarn edgedb:gen
23
+ ```
33
24
34
25
# # Usage
35
26
36
27
Develop: ` yarn start:dev`
37
28
Test: ` yarn test:e2e`
38
29
39
- See scripts in package.json for other commands to run
40
-
41
- ## Cypher
42
-
43
- ### Useful commands
44
-
45
- Delete all data, for small data sizes (n < 100k-ish)
46
-
47
- ```
48
- match (n) detach delete n
49
- ```
50
-
51
- Delete all data in a large DB (must have the APOC plugin installed)
52
-
53
- ```
54
- call apoc.periodic.iterate("MATCH (n) return n", "DETACH DELETE n", {batchSize:1000})
55
- yield batches, total return batches, total
56
- ```
57
-
58
- Delete all constraints and indexes (must have the APOC plugin installed)
59
-
60
- ```
61
- call apoc.schema.assert({}, {})
62
- ```
63
-
64
- Return number of nodes in DB
65
-
66
- ```
67
- match (n) return count(n)
68
- ```
69
-
70
- Return all data (don't use for large DBs)
71
-
72
- ```
73
- match (n) return n
74
- ```
30
+ See scripts in [package.json](./package.json) for other commands to run
75
31
76
32
# # Documentation
77
33
78
- [ Cord Database Schema] ( https://www.lucidchart.com/documents/view/d9131673-4ad4-4e9c-ae60-5c18029cd606 )
79
- [ Cord Property Table] ( https://docs.google.com/spreadsheets/d/e/2PACX-1vTe065oOA5S8QXqfBZQGqK193kIi4La2ex9ig-lDjeYmwekjMxyx-w-Mol8YRkI5YNp4o8PjI6bmaoM/pubhtml )
80
- [ Nest.js] ( https://docs.nestjs.com/ )
81
- [ Cypher Query Builder] ( https://jamesfer.me/cypher-query-builder/index.html#querying )
82
- [ Cypher Syntax] ( https://neo4j.com/developer/cypher-basics-i/ )
34
+ [NestJS](https://docs.nestjs.com/)
35
+ [EdgeDB](https://www.edgedb.com/docs/)
83
36
[GraphQL](https://graphql.org/learn/)
84
37
85
- # Notes
86
-
87
- 1 . When an API server bootstraps, it will create a root
` :User ` and a
` :RootSecurityGroup ` using the
` ROOT_ADMIN_EMAIL ` and
` ROOT_ADMIN_PASSWORD ` environment variables. It is not necessary to define those variables as defaults are used (
` [email protected] ` and
` admin ` );
88
- 1 . User permissions are granted by their role. Roles are defined in the ` authorization ` service. Currently roles are only updated via the graphql API (http://localhost:3000/graphql ), there is no front end UI for changing roles.
89
-
90
38
# # License
91
39
92
40
CORD is [MIT licensed](LICENSE).
0 commit comments