mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Merge branch 'master' into dependabot/docker/neo4j-3.5.0
This commit is contained in:
commit
ee911b46f9
18
.eslintrc.js
Normal file
18
.eslintrc.js
Normal file
@ -0,0 +1,18 @@
|
||||
module.exports = {
|
||||
"extends": "standard",
|
||||
"parser": "babel-eslint",
|
||||
"env": {
|
||||
"es6": true,
|
||||
"node": true,
|
||||
},
|
||||
"rules": {
|
||||
"indent": [
|
||||
"error",
|
||||
2
|
||||
],
|
||||
"quotes": [
|
||||
"error",
|
||||
"single"
|
||||
]
|
||||
}
|
||||
};
|
||||
20
.travis.yml
20
.travis.yml
@ -1,24 +1,28 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "10"
|
||||
services:
|
||||
- docker
|
||||
cache:
|
||||
yarn: true
|
||||
directories:
|
||||
- node_modules
|
||||
services:
|
||||
- docker
|
||||
- neo4j
|
||||
|
||||
install:
|
||||
- docker build --build-arg BUILD_COMMIT=$TRAVIS_COMMIT -t humanconnection/nitro-backend .
|
||||
- yarn install
|
||||
- docker build --build-arg BUILD_COMMIT=$TRAVIS_COMMIT -t humanconnection/nitro-backend:latest .
|
||||
- cp .env.template .env
|
||||
|
||||
script:
|
||||
# TODO: re-add when testing is setup properly
|
||||
# - docker run humanconnection/nitro-backend yarn run db:seed
|
||||
- docker run humanconnection/nitro-backend:latest yarn run eslint
|
||||
- yarn run db:reset
|
||||
- yarn run db:seed
|
||||
|
||||
after_success:
|
||||
# - wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
|
||||
# - chmod +x send.sh
|
||||
# - ./send.sh success $WEBHOOK_URL
|
||||
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
|
||||
- chmod +x send.sh
|
||||
- ./send.sh success $WEBHOOK_URL
|
||||
- if [ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_EVENT_TYPE == "push" ]; then
|
||||
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
|
||||
docker tag humanconnection/nitro-backend humanconnection/nitro-backend:latest;
|
||||
|
||||
12
README.md
12
README.md
@ -92,14 +92,14 @@ run Neo4j in one of the [many cloud options](https://neo4j.com/developer/guide-c
|
||||
[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`.
|
||||
|
||||
## Mocking API Results
|
||||
## Mock API Results
|
||||
|
||||
Alternatively you can just mock all responses from the api which let
|
||||
you build a frontend application without running a neo4j instance.
|
||||
|
||||
Just set `MOCK=true` inside `.env` or pass it on application start.
|
||||
|
||||
## Seeding The Database
|
||||
## Seed and Reset the Database
|
||||
|
||||
Optionally you can seed the GraphQL service by executing mutations that
|
||||
will write sample data to the database:
|
||||
@ -110,6 +110,14 @@ yarn db:seed
|
||||
npm run db:seed
|
||||
```
|
||||
|
||||
For a reset you can use the reset script:
|
||||
|
||||
```bash
|
||||
yarn db:reset
|
||||
# -or-
|
||||
npm run db:reset
|
||||
```
|
||||
|
||||
## Todo`s
|
||||
|
||||
- [x] add jwt authentication
|
||||
|
||||
@ -4,8 +4,8 @@ services:
|
||||
backend:
|
||||
container_name: backend.127.0.0.1.xip.io
|
||||
volumes:
|
||||
- .:/backend
|
||||
- /backend/node_modules
|
||||
- .:/nitro-backend
|
||||
- /nitro-backend/node_modules
|
||||
neo4j:
|
||||
ports:
|
||||
- 7687:7687
|
||||
|
||||
@ -6,14 +6,15 @@ First of all start minikube on your machine:
|
||||
```sh
|
||||
minikube start
|
||||
```
|
||||
[troubleshoot] If you get an error message along th lines of 'The vboxdrv kernel module is not loaded.' - then you have the same issue i had. to solve this you need to install the propper linux kernel host modules package. Here an example for Manjaro:
|
||||
**[troubleshoot]** If you get an error message along th lines of 'The vboxdrv kernel module is not loaded.' - then you have the same issue i had. to solve this you need to install the propper linux kernel host modules package. Here an example for Manjaro:
|
||||
https://forum.manjaro.org/t/installing-virtualbox-kernel-modules/6999
|
||||
**[troubleshoot]** When you can not start minikube, try also to remove the cluster with `minikube delete` and start again with `minikube start`. Sometimes this fix startup problems of the cluster.
|
||||
|
||||
You can always get an overview and see what's going on with your minikube:
|
||||
```sh
|
||||
minikube dashboard
|
||||
```
|
||||
[troubleshoot] now again you might run into trouble with an error like 'kubectl could not be found on your path.' In this case run the following command:
|
||||
**[troubleshoot]** now again you might run into trouble with an error like 'kubectl could not be found on your path.' In this case run the following command:
|
||||
```sh
|
||||
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo cp kubectl /usr/local/bin/ && rm kubectl
|
||||
```
|
||||
|
||||
18
package.json
18
package.json
@ -3,11 +3,18 @@
|
||||
"version": "0.0.1",
|
||||
"description": "GraphQL Backend for Human Connection",
|
||||
"main": "src/index.js",
|
||||
"config": {
|
||||
"no_auth": "cross-env GRAPHQL_URI=http://localhost:4001 GRAPHQL_PORT=4001 PERMISSIONS=disabled"
|
||||
},
|
||||
"scripts": {
|
||||
"eslint": "eslint src --config .eslintrc.js",
|
||||
"test": "echo \"Error: no test specified\" && exit 0",
|
||||
"start": "./node_modules/.bin/nodemon --exec babel-node src/index.js",
|
||||
"start:debug": "./node_modules/.bin/nodemon --exec babel-node --inspect=0.0.0.0:9229 src/index.js",
|
||||
"db:seed": "concurrently --kill-others --success first 'cross-env GRAPHQL_URI=http://localhost:4001 PERMISSIONS=disabled GRAPHQL_PORT=4001 yarn run start' 'wait-on tcp:4001 && cross-env GRAPHQL_URI=http://localhost:4001 ./node_modules/.bin/babel-node src/seed/seed-db.js'"
|
||||
"db:script:seed": "wait-on tcp:4001 && $npm_package_config_no_auth ./node_modules/.bin/babel-node src/seed/seed-db.js",
|
||||
"db:script:reset": "wait-on tcp:4001 && $npm_package_config_no_auth ./node_modules/.bin/babel-node src/seed/reset-db.js",
|
||||
"db:seed": "concurrently --kill-others --success first -n no-auth-server,seed '$npm_package_config_no_auth yarn run start' 'yarn run db:script:seed'",
|
||||
"db:reset": "concurrently --kill-others --success first -n no-auth-server,reset '$npm_package_config_no_auth yarn run start' 'yarn run db:script:reset'"
|
||||
},
|
||||
"author": "Human Connection gGmbH",
|
||||
"license": "MIT",
|
||||
@ -40,13 +47,20 @@
|
||||
"node-fetch": "^2.1.2",
|
||||
"passport": "^0.4.0",
|
||||
"passport-jwt": "^4.0.0",
|
||||
"sanitize-html": "^1.19.1",
|
||||
"sanitize-html": "^1.19.2",
|
||||
"slug": "^0.9.1",
|
||||
"trunc-html": "^1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^10.0.1",
|
||||
"concurrently": "^4.1.0",
|
||||
"cross-env": "^5.2.0",
|
||||
"eslint": "^5.9.0",
|
||||
"eslint-config-standard": "^12.0.0",
|
||||
"eslint-plugin-import": "^2.14.0",
|
||||
"eslint-plugin-node": "^8.0.0",
|
||||
"eslint-plugin-promise": "^4.0.1",
|
||||
"eslint-plugin-standard": "^4.0.0",
|
||||
"faker": "^4.1.0",
|
||||
"nodemon": "^1.18.7",
|
||||
"wait-on": "^3.2.0"
|
||||
|
||||
@ -4,7 +4,7 @@ import {
|
||||
GraphQLDefaultToDirective
|
||||
} from 'graphql-custom-directives'
|
||||
|
||||
export default function applyDirectives(augmentedSchema) {
|
||||
export default function applyDirectives (augmentedSchema) {
|
||||
const directives = [
|
||||
GraphQLLowerCaseDirective,
|
||||
GraphQLTrimDirective,
|
||||
|
||||
@ -4,7 +4,7 @@ let driver
|
||||
|
||||
export default function () {
|
||||
return {
|
||||
getDriver() {
|
||||
getDriver () {
|
||||
if (!driver) {
|
||||
driver = neo4j.driver(
|
||||
process.env.NEO4J_URI || 'bolt://localhost:7687',
|
||||
|
||||
@ -4,7 +4,7 @@ import {
|
||||
GraphQLDateTime
|
||||
} from 'graphql-iso-date'
|
||||
|
||||
export default function applyScalars(augmentedSchema) {
|
||||
export default function applyScalars (augmentedSchema) {
|
||||
augmentedSchema._typeMap.Date = GraphQLDate
|
||||
augmentedSchema._typeMap.Time = GraphQLTime
|
||||
augmentedSchema._typeMap.DateTime = GraphQLDateTime
|
||||
|
||||
@ -7,10 +7,10 @@ import generateJwt from './jwt/generateToken'
|
||||
import { fixUrl } from './middleware/fixImageUrlsMiddleware'
|
||||
|
||||
export const typeDefs =
|
||||
fs.readFileSync(process.env.GRAPHQL_SCHEMA || path.join(__dirname, "schema.graphql"))
|
||||
fs.readFileSync(process.env.GRAPHQL_SCHEMA || path.join(__dirname, 'schema.graphql'))
|
||||
.toString('utf-8')
|
||||
|
||||
const query = (cypher, session) => {
|
||||
export const query = (cypher, session) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
let data = []
|
||||
session
|
||||
@ -54,15 +54,15 @@ export const resolvers = {
|
||||
return new Promise(async (resolve) => {
|
||||
const session = driver.session()
|
||||
const queries = {
|
||||
countUsers: `MATCH (r:User) WHERE r.deleted <> true OR NOT exists(r.deleted) RETURN COUNT(r) AS countUsers`,
|
||||
countPosts: `MATCH (r:Post) WHERE r.deleted <> true OR NOT exists(r.deleted) RETURN COUNT(r) AS countPosts`,
|
||||
countComments: `MATCH (r:Comment) WHERE r.deleted <> true OR NOT exists(r.deleted) RETURN COUNT(r) AS countComments`,
|
||||
countNotifications: `MATCH (r:Notification) WHERE r.deleted <> true OR NOT exists(r.deleted) RETURN COUNT(r) AS countNotifications`,
|
||||
countOrganizations: `MATCH (r:Organization) WHERE r.deleted <> true OR NOT exists(r.deleted) RETURN COUNT(r) AS countOrganizations`,
|
||||
countProjects: `MATCH (r:Project) WHERE r.deleted <> true OR NOT exists(r.deleted) RETURN COUNT(r) AS countProjects`,
|
||||
countInvites: `MATCH (r:Invite) WHERE r.wasUsed <> true OR NOT exists(r.wasUsed) RETURN COUNT(r) AS countInvites`,
|
||||
countFollows: `MATCH (:User)-[r:FOLLOWS]->(:User) RETURN COUNT(r) AS countFollows`,
|
||||
countShouts: `MATCH (:User)-[r:SHOUTED]->(:Post) RETURN COUNT(r) AS countShouts`
|
||||
countUsers: 'MATCH (r:User) WHERE r.deleted <> true OR NOT exists(r.deleted) RETURN COUNT(r) AS countUsers',
|
||||
countPosts: 'MATCH (r:Post) WHERE r.deleted <> true OR NOT exists(r.deleted) RETURN COUNT(r) AS countPosts',
|
||||
countComments: 'MATCH (r:Comment) WHERE r.deleted <> true OR NOT exists(r.deleted) RETURN COUNT(r) AS countComments',
|
||||
countNotifications: 'MATCH (r:Notification) WHERE r.deleted <> true OR NOT exists(r.deleted) RETURN COUNT(r) AS countNotifications',
|
||||
countOrganizations: 'MATCH (r:Organization) WHERE r.deleted <> true OR NOT exists(r.deleted) RETURN COUNT(r) AS countOrganizations',
|
||||
countProjects: 'MATCH (r:Project) WHERE r.deleted <> true OR NOT exists(r.deleted) RETURN COUNT(r) AS countProjects',
|
||||
countInvites: 'MATCH (r:Invite) WHERE r.wasUsed <> true OR NOT exists(r.wasUsed) RETURN COUNT(r) AS countInvites',
|
||||
countFollows: 'MATCH (:User)-[r:FOLLOWS]->(:User) RETURN COUNT(r) AS countFollows',
|
||||
countShouts: 'MATCH (:User)-[r:SHOUTED]->(:Post) RETURN COUNT(r) AS countShouts'
|
||||
}
|
||||
let data = {
|
||||
countUsers: (await queryOne(queries.countUsers, session)).countUsers,
|
||||
|
||||
@ -69,5 +69,5 @@ const serverConfig = {
|
||||
}
|
||||
|
||||
server.start(serverConfig, options => {
|
||||
console.log(`Server ready at ${process.env.GRAPHQL_URI} 🚀`);
|
||||
console.log(`Server ready at ${process.env.GRAPHQL_URI} 🚀`)
|
||||
})
|
||||
|
||||
@ -3,7 +3,7 @@ import jwt from 'jsonwebtoken'
|
||||
import ms from 'ms'
|
||||
|
||||
// Generate an Access Token for the given User ID
|
||||
export default function generateJwt(user) {
|
||||
export default function generateJwt (user) {
|
||||
const token = jwt.sign(user, process.env.JWT_SECRET, {
|
||||
expiresIn: ms('1d'),
|
||||
issuer: process.env.GRAPHQL_URI,
|
||||
|
||||
@ -20,7 +20,10 @@ export default () => {
|
||||
(JWTPayload, next) => {
|
||||
// usually this would be a database call:
|
||||
// var user = users[_.findIndex(users, {id: JWTPayload.id})]
|
||||
// TODO: fix https://github.com/Human-Connection/Nitro-Backend/issues/41
|
||||
/* eslint-disable */
|
||||
if (true) {
|
||||
/* eslint-enable */
|
||||
next(null, {})
|
||||
} else {
|
||||
next(null, false)
|
||||
|
||||
@ -3,9 +3,9 @@ import softDeleteMiddleware from './softDeleteMiddleware'
|
||||
import sluggifyMiddleware from './sluggifyMiddleware'
|
||||
import fixImageUrlsMiddleware from './fixImageUrlsMiddleware'
|
||||
import excerptMiddleware from './excerptMiddleware'
|
||||
import dateTimeMiddleware from './dateTimeMiddleware';
|
||||
import xssMiddleware from './xssMiddleware';
|
||||
import permissionsMiddleware from './permissionsMiddleware';
|
||||
import dateTimeMiddleware from './dateTimeMiddleware'
|
||||
import xssMiddleware from './xssMiddleware'
|
||||
import permissionsMiddleware from './permissionsMiddleware'
|
||||
|
||||
export default schema => {
|
||||
let middleware = [
|
||||
|
||||
@ -1,17 +1,22 @@
|
||||
import { rule, shield, and, or, not, allow } from 'graphql-shield'
|
||||
import { rule, shield, allow } from 'graphql-shield'
|
||||
|
||||
/*
|
||||
* TODO: implement
|
||||
* See: https://github.com/Human-Connection/Nitro-Backend/pull/40#pullrequestreview-180898363
|
||||
const isAuthenticated = rule()(async (parent, args, ctx, info) => {
|
||||
return ctx.user !== null
|
||||
})
|
||||
const isOwner = rule()(async (parent, args, ctx, info) => {
|
||||
return ctx.user.id === parent.id
|
||||
})
|
||||
const isAdmin = rule()(async (parent, args, ctx, info) => {
|
||||
return ctx.user.role === 'ADMIN'
|
||||
})
|
||||
const isModerator = rule()(async (parent, args, ctx, info) => {
|
||||
return ctx.user.role === 'MODERATOR'
|
||||
})
|
||||
*/
|
||||
|
||||
const isOwner = rule()(async (parent, args, ctx, info) => {
|
||||
return ctx.user.id === parent.id
|
||||
})
|
||||
|
||||
// Permissions
|
||||
const permissions = shield({
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import walkRecursive from './helpers/walkRecursive'
|
||||
import trunc from 'trunc-html'
|
||||
// import { getByDot, setByDot, getItems, replaceItems } from 'feathers-hooks-common'
|
||||
import sanitizeHtml from 'sanitize-html'
|
||||
// import { isEmpty, intersection } from 'lodash'
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import faker from 'faker'
|
||||
|
||||
export default () => {
|
||||
return `mutation {
|
||||
o1: CreateOrganization(
|
||||
|
||||
@ -6,7 +6,7 @@ export default function (data) {
|
||||
p1: CreatePost(
|
||||
id: "p1",
|
||||
title: "Gedanken eines Polizisten zum Einsatz im Hambacher Forst",
|
||||
content: "<p><strong>Diese Zukunftsstadt ist real und keine Computer-Animation</strong> – sondern sie ist das Lebenswerk des mittlerweile über 100 Jahre alten Futuristen und Architekten Jacque Fresco aus Florida. In 35 Jahren (seit seinem 13. Lebensjahr) hat dieser zusammen mit seiner Frau seinen futuristischen Traum von einer besonderen Zukunftsstadt auf 85.000 Quadratmetern realisiert. In den Gebäuden und Gärten befinden sich u.a. ein Forschungszentrum, Vortragsräume und unzählige seiner Modelle & Architekturentwürfe.</p><br /><p>Sein zentrales Anliegen ist eine resourcenbasierte Wirtschaft und die Abschaffung von Geld und Privatbesitz. Mit Hilfe von Roboterarbeit und dem Bedingungslosen Grundeinkommen (da nach seiner Ansicht in den kommenden Jahren fast alle Jobs automatisiert werden), möchte er eine ökologische Landwirtschaft mit Permakulturen etc. und eine effiziente Energiegewinnung (ausschließlich durch regenerative Energien) schaffen. Wenige kompatible Formen in einer sparsamen Modulbauweise (in die u.a. bereits variable Service- und Reparaturelemente integriert sind) sollen insgesamt eine soziale & ökologische Utopie im Einklang mit der Natur ermöglichen.</p><br /><p>Nachfolgend der Direkt-Link auf den interessanten Artikel von Zoltan Istvan, der den Architekten und seine Frau in Florida besuchen durfte und seinen Artikel Ende 2016 auf „MOTHERBOARD“ veröffentlicht hatte:</p><br /><p>https://motherboard.vice.com/de/article/vv34nb/ich-habe-die-zukunft-besucht-in-der-wir-ohne-geld-steuern-und-besitz-leben </p><br /><p>Da soll noch jemand behaupten, es gäbe keine Utopien mehr bzw. keine Futuristen, die ihre kreativen und zukunftsfähigen Ideen (auch in ganz großem Stil) selbst in die Tat umsetzen. LG @all :) </p><br /><p><strong>Wir sind eine Menschheitsfamilie. • Wir sind eins. • Wir sind HUMAN CONNECTION</strong> ❤️</p>",
|
||||
content: "<p><strong>Diese Zukunftsstadt ist real und keine Computer-Animation</strong> – sondern sie ist das Lebenswerk des mittlerweile über 100 Jahre alten Futuristen und Architekten Jacque Fresco aus Florida. In 35 Jahren (seit seinem 13. Lebensjahr) hat dieser zusammen mit seiner Frau seinen futuristischen Traum von einer besonderen Zukunftsstadt auf 85.000 Quadratmetern realisiert. In den Gebäuden und Gärten befinden sich u.a. ein Forschungszentrum, Vortragsräume und unzählige seiner Modelle & Architekturentwürfe.</p><br /><p>Sein zentrales Anliegen ist eine resourcenbasierte Wirtschaft und die Abschaffung von Geld und Privatbesitz. Mit Hilfe von Roboterarbeit und dem Bedingungslosen Grundeinkommen (da nach seiner Ansicht in den kommenden Jahren fast alle Jobs automatisiert werden), möchte er eine ökologische Landwirtschaft mit Permakulturen etc. und eine effiziente Energiegewinnung (ausschließlich durch regenerative Energien) schaffen. Wenige kompatible Formen in einer sparsamen Modulbauweise (in die u.a. bereits variable Service- und Reparaturelemente integriert sind) sollen insgesamt eine soziale & ökologische Utopie im Einklang mit der Natur ermöglichen.</p><br /><p>Nachfolgend der Direkt-Link auf den interessanten Artikel von Zoltan Istvan, der den Architekten und seine Frau in Florida besuchen durfte und seinen Artikel Ende 2016 auf „MOTHERBOARD“ veröffentlicht hatte:</p><br /><p>https://motherboard.vice.com/de/article/vv34nb/ich-habe-die-zukunft-besucht-in-der-wir-ohne-geld-steuern-und-besitz-leben</p><br /><p>Da soll noch jemand behaupten, es gäbe keine Utopien mehr bzw. keine Futuristen, die ihre kreativen und zukunftsfähigen Ideen (auch in ganz großem Stil) selbst in die Tat umsetzen. LG @all :)</p><br /><p><strong>Wir sind eine Menschheitsfamilie. • Wir sind eins. • Wir sind HUMAN CONNECTION</strong>❤️</p>",
|
||||
image: "https://picsum.photos/1280/1024?image=352",
|
||||
visibility: public,
|
||||
disabled: false,
|
||||
@ -31,7 +31,7 @@ export default function (data) {
|
||||
p2: CreatePost(
|
||||
id: "p2",
|
||||
title: "Julian Assange",
|
||||
content: "<p><strong>Diese Zukunftsstadt ist real und keine Computer-Animation</strong> – sondern sie ist das Lebenswerk des mittlerweile über 100 Jahre alten Futuristen und Architekten Jacque Fresco aus Florida. In 35 Jahren (seit seinem 13. Lebensjahr) hat dieser zusammen mit seiner Frau seinen futuristischen Traum von einer besonderen Zukunftsstadt auf 85.000 Quadratmetern realisiert. In den Gebäuden und Gärten befinden sich u.a. ein Forschungszentrum, Vortragsräume und unzählige seiner Modelle & Architekturentwürfe.</p><br /><p>Sein zentrales Anliegen ist eine resourcenbasierte Wirtschaft und die Abschaffung von Geld und Privatbesitz. Mit Hilfe von Roboterarbeit und dem Bedingungslosen Grundeinkommen (da nach seiner Ansicht in den kommenden Jahren fast alle Jobs automatisiert werden), möchte er eine ökologische Landwirtschaft mit Permakulturen etc. und eine effiziente Energiegewinnung (ausschließlich durch regenerative Energien) schaffen. Wenige kompatible Formen in einer sparsamen Modulbauweise (in die u.a. bereits variable Service- und Reparaturelemente integriert sind) sollen insgesamt eine soziale & ökologische Utopie im Einklang mit der Natur ermöglichen.</p><br /><p>Nachfolgend der Direkt-Link auf den interessanten Artikel von Zoltan Istvan, der den Architekten und seine Frau in Florida besuchen durfte und seinen Artikel Ende 2016 auf „MOTHERBOARD“ veröffentlicht hatte:</p><br /><p>https://motherboard.vice.com/de/article/vv34nb/ich-habe-die-zukunft-besucht-in-der-wir-ohne-geld-steuern-und-besitz-leben </p><br /><p>Da soll noch jemand behaupten, es gäbe keine Utopien mehr bzw. keine Futuristen, die ihre kreativen und zukunftsfähigen Ideen (auch in ganz großem Stil) selbst in die Tat umsetzen. LG @all :) </p><br /><p><strong>Wir sind eine Menschheitsfamilie. • Wir sind eins. • Wir sind HUMAN CONNECTION</strong> ❤️</p>",
|
||||
content: "<p><strong>Diese Zukunftsstadt ist real und keine Computer-Animation</strong> – sondern sie ist das Lebenswerk des mittlerweile über 100 Jahre alten Futuristen und Architekten Jacque Fresco aus Florida. In 35 Jahren (seit seinem 13. Lebensjahr) hat dieser zusammen mit seiner Frau seinen futuristischen Traum von einer besonderen Zukunftsstadt auf 85.000 Quadratmetern realisiert. In den Gebäuden und Gärten befinden sich u.a. ein Forschungszentrum, Vortragsräume und unzählige seiner Modelle & Architekturentwürfe.</p><br /><p>Sein zentrales Anliegen ist eine resourcenbasierte Wirtschaft und die Abschaffung von Geld und Privatbesitz. Mit Hilfe von Roboterarbeit und dem Bedingungslosen Grundeinkommen (da nach seiner Ansicht in den kommenden Jahren fast alle Jobs automatisiert werden), möchte er eine ökologische Landwirtschaft mit Permakulturen etc. und eine effiziente Energiegewinnung (ausschließlich durch regenerative Energien) schaffen. Wenige kompatible Formen in einer sparsamen Modulbauweise (in die u.a. bereits variable Service- und Reparaturelemente integriert sind) sollen insgesamt eine soziale & ökologische Utopie im Einklang mit der Natur ermöglichen.</p><br /><p>Nachfolgend der Direkt-Link auf den interessanten Artikel von Zoltan Istvan, der den Architekten und seine Frau in Florida besuchen durfte und seinen Artikel Ende 2016 auf „MOTHERBOARD“ veröffentlicht hatte:</p><br /><p>https://motherboard.vice.com/de/article/vv34nb/ich-habe-die-zukunft-besucht-in-der-wir-ohne-geld-steuern-und-besitz-leben</p><br /><p>Da soll noch jemand behaupten, es gäbe keine Utopien mehr bzw. keine Futuristen, die ihre kreativen und zukunftsfähigen Ideen (auch in ganz großem Stil) selbst in die Tat umsetzen. LG @all :)</p><br /><p><strong>Wir sind eine Menschheitsfamilie. • Wir sind eins. • Wir sind HUMAN CONNECTION</strong>❤️</p>",
|
||||
image: "https://picsum.photos/1280/1024?image=72",
|
||||
visibility: public,
|
||||
disabled: false,
|
||||
|
||||
23
src/seed/reset-db.js
Normal file
23
src/seed/reset-db.js
Normal file
@ -0,0 +1,23 @@
|
||||
import { query } from '../graphql-schema'
|
||||
import dotenv from 'dotenv'
|
||||
import neo4j from '../bootstrap/neo4j'
|
||||
|
||||
dotenv.config()
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
throw new Error('YOU CAN`T UNSEED IN PRODUCTION MODE')
|
||||
}
|
||||
|
||||
const driver = neo4j().getDriver()
|
||||
const session = driver.session()
|
||||
|
||||
query('MATCH (n) DETACH DELETE n', session).then(() => {
|
||||
console.log('Successfully deleted all nodes and relations!')
|
||||
}).catch((err) => {
|
||||
console.log(`Error occurred deleting the nodes and relations (reset the db)\n\n${err}`)
|
||||
}).finally(() => {
|
||||
if (session) {
|
||||
session.close()
|
||||
}
|
||||
process.exit(0)
|
||||
})
|
||||
@ -1,12 +1,11 @@
|
||||
import ApolloClient from "apollo-client";
|
||||
import dotenv from "dotenv";
|
||||
import gql from 'graphql-tag'
|
||||
import fetch from "node-fetch";
|
||||
import { HttpLink } from "apollo-link-http";
|
||||
import { InMemoryCache } from "apollo-cache-inmemory";
|
||||
import ApolloClient from 'apollo-client'
|
||||
import dotenv from 'dotenv'
|
||||
import fetch from 'node-fetch'
|
||||
import { HttpLink } from 'apollo-link-http'
|
||||
import { InMemoryCache } from 'apollo-cache-inmemory'
|
||||
import Seed from './data/index'
|
||||
|
||||
dotenv.config();
|
||||
dotenv.config()
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
throw new Error('YOU CAN`T SEED IN PRODUCTION MODE')
|
||||
@ -15,6 +14,6 @@ if (process.env.NODE_ENV === 'production') {
|
||||
const client = new ApolloClient({
|
||||
link: new HttpLink({ uri: process.env.GRAPHQL_URI, fetch }),
|
||||
cache: new InMemoryCache()
|
||||
});
|
||||
})
|
||||
|
||||
Seed(client)
|
||||
|
||||
@ -137,7 +137,7 @@ export default {
|
||||
const chars = '23456789abcdefghkmnpqrstuvwxyzABCDEFGHJKLMNPRSTUVWXYZ'
|
||||
let code = ''
|
||||
for (let i = 0; i < 8; i++) {
|
||||
const n = _.random(0, chars.length-1)
|
||||
const n = _.random(0, chars.length - 1)
|
||||
code += chars.substr(n, 1)
|
||||
}
|
||||
return code
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user