mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
parent
63697f5e27
commit
d2130d64f4
@ -3,6 +3,7 @@
|
|||||||
* [Introduction](README.md)
|
* [Introduction](README.md)
|
||||||
* [Edit this Documentation](edit-this-documentation.md)
|
* [Edit this Documentation](edit-this-documentation.md)
|
||||||
* [Installation](installation.md)
|
* [Installation](installation.md)
|
||||||
|
* [Neo4J](neo4j/README.md)
|
||||||
* [Backend](backend/README.md)
|
* [Backend](backend/README.md)
|
||||||
* [GraphQL](backend/graphql.md)
|
* [GraphQL](backend/graphql.md)
|
||||||
* [Webapp](webapp/README.md)
|
* [Webapp](webapp/README.md)
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
# Backend
|
# Backend
|
||||||
|
|
||||||
## Installation
|
## Installation with Docker
|
||||||
{% tabs %}
|
|
||||||
{% tab title="Docker" %}
|
|
||||||
|
|
||||||
Run the following command to install everything through docker.
|
Run the following command to install everything through docker.
|
||||||
|
|
||||||
@ -14,28 +12,15 @@ $ docker-compose up
|
|||||||
# rebuild the containers for a cleanup
|
# rebuild the containers for a cleanup
|
||||||
$ docker-compose up --build
|
$ docker-compose up --build
|
||||||
```
|
```
|
||||||
Open another terminal and create unique indices with:
|
|
||||||
|
|
||||||
```bash
|
Wait a little until your backend is up and running at [http://localhost:4000/](http://localhost:4000/).
|
||||||
$ docker-compose exec neo4j migrate
|
|
||||||
```
|
|
||||||
|
|
||||||
{% endtab %}
|
## Installation without Docker
|
||||||
|
|
||||||
{% tab title="Without Docker" %}
|
|
||||||
|
|
||||||
For the local installation you need a recent version of [node](https://nodejs.org/en/)
|
For the local installation you need a recent version of [node](https://nodejs.org/en/)
|
||||||
(>= `v10.12.0`) and [Neo4J](https://neo4j.com/) along with
|
(>= `v10.12.0`).
|
||||||
[Apoc](https://github.com/neo4j-contrib/neo4j-apoc-procedures) plugin installed
|
|
||||||
on your system.
|
|
||||||
|
|
||||||
Download [Neo4j Community Edition](https://neo4j.com/download-center/#releases) and unpack the files.
|
Install node dependencies with [yarn](https://yarnpkg.com/en/):
|
||||||
|
|
||||||
Download [Neo4j Apoc](https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases) 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](https://neo4j.com/download/) and run locally for development, spin up a [hosted Neo4j Sandbox instance](https://neo4j.com/download/), run Neo4j in one of the [many cloud options](https://neo4j.com/developer/guide-cloud-deployment/), [spin up Neo4j in a Docker container](https://neo4j.com/developer/docker/) or on Debian-based systems install [Neo4j from the Debian Repository](http://debian.neo4j.org/). 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](http://localhost:7474).
|
|
||||||
|
|
||||||
Now install node dependencies with [yarn](https://yarnpkg.com/en/):
|
|
||||||
```bash
|
```bash
|
||||||
$ cd backend
|
$ cd backend
|
||||||
$ yarn install
|
$ yarn install
|
||||||
@ -46,14 +31,8 @@ Copy Environment Variables:
|
|||||||
# in backend/
|
# in backend/
|
||||||
$ cp .env.template .env
|
$ cp .env.template .env
|
||||||
```
|
```
|
||||||
|
Configure the new file according to your needs and your local setup. Make sure
|
||||||
Configure the new files according to your needs and your local setup.
|
a [local Neo4J](http://localhost:7474) instance is up and running.
|
||||||
|
|
||||||
Create unique indices with:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ ./neo4j/migrate.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
Start the backend for development with:
|
Start the backend for development with:
|
||||||
```bash
|
```bash
|
||||||
@ -65,17 +44,12 @@ or start the backend in production environment with:
|
|||||||
yarn run start
|
yarn run start
|
||||||
```
|
```
|
||||||
|
|
||||||
{% endtab %}
|
|
||||||
{% endtabs %}
|
|
||||||
|
|
||||||
Your backend is up and running at [http://localhost:4000/](http://localhost:4000/)
|
Your backend is up and running at [http://localhost:4000/](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.
|
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/](http://localhost:7474/)
|
|
||||||
for an interactive `cypher` shell and a visualization of the graph.
|
|
||||||
|
|
||||||
|
|
||||||
#### Seed Database
|
#### Seed Database
|
||||||
|
|
||||||
@ -114,7 +88,8 @@ $ yarn run db:reset
|
|||||||
|
|
||||||
# Testing
|
# 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!
|
**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!
|
||||||
|
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
|
|||||||
64
neo4j/README.md
Normal file
64
neo4j/README.md
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
# Neo4J
|
||||||
|
|
||||||
|
Human Connection is a social network. Using a graph based database which can
|
||||||
|
model nodes and edges natively - a network - feels like an obvious choice. We
|
||||||
|
decided to use [Neo4j](https://neo4j.com/), the currently most used graph
|
||||||
|
database available. The community edition of Neo4J is Free and Open Source and
|
||||||
|
we try our best to keep our application compatible with the community edition
|
||||||
|
only.
|
||||||
|
|
||||||
|
## Installation with Docker
|
||||||
|
|
||||||
|
Run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose up
|
||||||
|
```
|
||||||
|
|
||||||
|
You can access Neo4J through [http://localhost:7474/](http://localhost:7474/)
|
||||||
|
for an interactive cypher shell and a visualization of the graph.
|
||||||
|
|
||||||
|
## Installation without Docker
|
||||||
|
|
||||||
|
Install community edition of [Neo4J]() along with the plugin
|
||||||
|
[Apoc](https://github.com/neo4j-contrib/neo4j-apoc-procedures) on your system.
|
||||||
|
|
||||||
|
To do so, go to [releases](https://neo4j.com/download-center/#releases), choose
|
||||||
|
"Community Server", download the installation files for you operation system
|
||||||
|
and unpack the files.
|
||||||
|
|
||||||
|
Download [Neo4j Apoc](https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases)
|
||||||
|
and drop the file into the `plugins` folder of the just extracted Neo4j-Server.
|
||||||
|
|
||||||
|
### Alternatives
|
||||||
|
|
||||||
|
You can download [Neo4j Desktop](https://neo4j.com/download/) and run locally
|
||||||
|
for development, spin up a
|
||||||
|
[hosted Neo4j Sandbox instance](https://neo4j.com/download/), run Neo4j in one
|
||||||
|
of the [many cloud options](https://neo4j.com/developer/guide-cloud-deployment/),
|
||||||
|
[spin up Neo4j in a Docker container](https://neo4j.com/developer/docker/),
|
||||||
|
on Archlinux you can install [neo4j-community from AUR](https://aur.archlinux.org/packages/neo4j-community/)
|
||||||
|
or on Debian-based systems install [Neo4j from the Debian Repository](http://debian.neo4j.org/).
|
||||||
|
Just be sure to update the Neo4j connection string and credentials accordingly
|
||||||
|
in `backend/.env`.
|
||||||
|
|
||||||
|
Start Neo4J and confirm the database is running at [http://localhost:7474](http://localhost:7474).
|
||||||
|
|
||||||
|
## Database Indices and Constraints
|
||||||
|
|
||||||
|
If you are not running our dedicated Neo4J [docker image](https://hub.docker.com/r/humanconnection/neo4j),
|
||||||
|
which is the case if you setup Neo4J locally without docker, then you have to
|
||||||
|
setup unique indices and database constraints manually.
|
||||||
|
|
||||||
|
If you have `cypher-shell` available with your local installation of neo4j you
|
||||||
|
can run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# in folder neo4j/
|
||||||
|
$ cp .env.template .env
|
||||||
|
$ ./db_setup.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Otherwise if you don't have `cypher-shell` available, simply copy the cypher
|
||||||
|
statements [from the script](./neo4j/db_setup.sh) and paste the scripts into your
|
||||||
|
database [browser frontend](http://localhost:7474).
|
||||||
Loading…
x
Reference in New Issue
Block a user