|
1 |
| -# Graphgist Portal - v3 |
| 1 | +# GraphGist Portal v3 |
2 | 2 |
|
3 |
| -This project was started with [GRANDstack](https://grandstack.io) (GraphQL, React, Apollo, Neo4j Database). There are two components for the portal, the [`UI application`](/ui-react) (in React) and the [`API app`](/api) (GraphQL server). |
| 3 | +This project was started with [GRANDstack](https://grandstack.io) (GraphQL, React, Apollo, Neo4j Database). |
| 4 | +There are two components for the portal: |
4 | 5 |
|
5 |
| -## API |
| 6 | +- `ui-react`: the UI application in React |
| 7 | +- `api`: the API application (GraphQL server) |
| 8 | + |
| 9 | +### API |
6 | 10 |
|
7 | 11 | 
|
8 | 12 |
|
| 13 | +## Local install |
| 14 | + |
| 15 | +### Requirements |
| 16 | + |
| 17 | +- Node.js 12 (`lts/erbium`) |
| 18 | +- Docker and `docker-compose` |
| 19 | + |
| 20 | +### Run GraphGist portal |
| 21 | + |
| 22 | +Create a copy of `ui-react/.env-example` and `api/.env-example` within the same directory using the name `.env`. |
| 23 | + |
| 24 | +``` |
| 25 | +cp ./ui-react/.env-example ./ui-react/.env |
| 26 | +cp ./api/.env-example ./api/.env |
| 27 | +``` |
| 28 | + |
| 29 | +#### Using Docker Compose |
| 30 | + |
| 31 | +Using `docker-compose`: |
| 32 | + |
| 33 | +``` |
| 34 | +docker-compose up -d |
| 35 | +``` |
| 36 | + |
| 37 | +This will take some time on the first run. |
| 38 | +Once the containers have been started, you can check the log to check if the UI is up and running using: |
| 39 | + |
| 40 | +``` |
| 41 | +docker logs -f graphgist-portal-ui |
| 42 | +``` |
| 43 | + |
| 44 | +The `docker-compose up -d` will start 3 services: |
| 45 | + |
| 46 | +- Neo4j database with the Neo4j Browser available via HTTP at http://localhost:7474/browser/ |
| 47 | +- Web interface available at http://localhost:3000/ |
| 48 | +- GraphQL API available at http://localhost:4001/graphql |
| 49 | + |
| 50 | +#### Using npm |
| 51 | + |
| 52 | +``` |
| 53 | +npm i --prefix ui-react |
| 54 | +npm i --prefix api |
| 55 | +``` |
| 56 | + |
| 57 | +It's recommanded to run the database using Docker to use a compatible version with the Neo4j APOC library enabled: |
| 58 | + |
| 59 | +``` |
| 60 | +docker-compose run --service-ports neo4j |
| 61 | +``` |
| 62 | + |
| 63 | +Once the database is up and running, open a new terminal and execute: |
| 64 | + |
| 65 | +``` |
| 66 | +npm run start --prefix api |
| 67 | +``` |
| 68 | + |
| 69 | +Open a third terminal and execute: |
| 70 | + |
| 71 | +``` |
| 72 | +npm run start --prefix ui-react |
| 73 | +``` |
| 74 | + |
| 75 | +### Switch to admin |
| 76 | + |
| 77 | +Once you've created an account, you can manually update the associated user to become an admin using the following Cypher query: |
| 78 | + |
| 79 | +``` |
| 80 | +MATCH (p:User {email: '[email protected]'}) |
| 81 | +SET p.admin = true |
| 82 | +RETURN p |
| 83 | +``` |
| 84 | + |
9 | 85 | ## Deployment
|
10 | 86 |
|
11 | 87 | This is currently deployed to Heroku, since this repository contains both API and UI repository we need to individually push each one, to achieve that we can create a subtree branch with only that specific folder:
|
|
0 commit comments