Giter VIP home page Giter VIP logo

drupal-decoupled-app's People

Contributors

fubhy avatar greenkeeperio-bot avatar nikgraf avatar schnitzel avatar signalwerk avatar weitzman avatar xilis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

drupal-decoupled-app's Issues

docker-compose up fails

I think there might be a service definition missing from your docker-compose.yml, when I run docker-compose up -d I get:

15:19 $ docker-compose up -d
ERROR: Service "drupal" mounts volumes from "amazeeio-ssh-agent", which is not the name of a service or container.

Yarn cannot find persistgraphql

I get an unexpected error on yarn install with trace:

Error: https://registry.yarnpkg.com/@amazee/persistgraphql/-/persistgraphql-0.3.2.tgz: invalid tar file

Docker build error

When running "docker-build" out the box I get the following error:

ERROR: Service "cli" mounts volumes from "amazeeio-ssh-agent", which is not the name of a service or container.

Switch to stylelint

Use stylelint instead of CSSLint to avoid errors and enforce consistent conventions in stylesheets.

screen shot 2018-04-30 at 11 25 32 pm

Suggestions:

  • Remove CSSLint
  • Use stylelint
  • Same workflow as for js linting
  • Should work for CSS under frontend/src/** and backend/web/themes/**

:)

Problem Injecting SSH Keys(Windows 10)

Hello,

I have generated the keys but at the moment of run the command: ssh-key-add.cmd C:\Users\[yourname]\.ssh\id_rsa , i get the following message:

Unable to find image 'amazeeio/ssh-agent:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/amazeeio/ssh-agent/manifests/latest: unauthorized: incorrect username or password.
See 'docker run --help'.

What could be the problem?

Thanks

drush si config_installer fails: file_put_contents(sites/default/settings.php): failed to open stream: Permission denied install.inc:337

When I run drush si config_installer inside the container, it fails with a permission error. I followed the "Usage" instructions in the readme. All files (including sites/default/settings.php) are owned by my user id and group id and have -rwxrwxr-x permissions, while the container runs as uid 1000. I cannot work around this by specifying a different --user option to docker-compose exec, as only the drupal user (uid 1000) has access to the Drupal directory /var/www/drupal/.

$ docker-compose exec --user drupal drupal bash
๐Ÿณ [email protected]:~/public_html/backend/web (master *=)$ drush si config_installer -y --account-name=admin --account-pass=admin
You are about to DROP all tables in your 'drupal' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the --notify global option.                                                                                                                                                                          [ok]
file_put_contents(sites/default/settings.php): failed to open stream: Permission denied install.inc:337                                                                                                                                                               [warning]
Exception: Failed to modify <em class="placeholder">sites/default/settings.php</em>. Verify the file permissions. in /var/www/drupal/public_html/backend/web/core/includes/install.inc:338                                                                            [error]
Stack trace:
#0 /var/www/drupal/public_html/backend/web/profiles/contrib/config_installer/src/Form/SiteConfigureForm.php(121): drupal_rewrite_settings(Array)
#1 [internal function]: Drupal\config_installer\Form\SiteConfigureForm->buildForm(Array, Object(Drupal\Core\Form\FormState), Array)
#2 /var/www/drupal/public_html/backend/web/core/lib/Drupal/Core/Form/FormBuilder.php(514): call_user_func_array(Array, Array)
#3 /var/www/drupal/public_html/backend/web/core/lib/Drupal/Core/Form/FormBuilder.php(472): Drupal\Core\Form\FormBuilder->retrieveForm('config_installe...', Object(Drupal\Core\Form\FormState))
#4 /var/www/drupal/public_html/backend/web/core/includes/install.core.inc(909): Drupal\Core\Form\FormBuilder->submitForm('Drupal\\config_i...', Object(Drupal\Core\Form\FormState))
#5 /var/www/drupal/public_html/backend/web/core/includes/install.core.inc(584): install_get_form('Drupal\\config_i...', Array)
#6 /var/www/drupal/public_html/backend/web/core/includes/install.core.inc(540): install_run_task(Array, Array)
#7 /var/www/drupal/public_html/backend/web/core/includes/install.core.inc(117): install_run_tasks(Array)
#8 /var/www/drupal/public_html/backend/vendor/drush/drush/includes/drush.inc(726): install_drupal(Object(Composer\Autoload\ClassLoader), Array)
#9 /var/www/drupal/public_html/backend/vendor/drush/drush/includes/drush.inc(711): drush_call_user_func_array('install_drupal', Array)
#10 /var/www/drupal/public_html/backend/vendor/drush/drush/commands/core/drupal/site_install.inc(82): drush_op('install_drupal', Object(Composer\Autoload\ClassLoader), Array)
#11 /var/www/drupal/public_html/backend/vendor/drush/drush/commands/core/site_install.drush.inc(255): drush_core_site_install_version('config_installe...', Array)
#12 /var/www/drupal/public_html/backend/vendor/drush/drush/includes/command.inc(422): drush_core_site_install('config_installe...')
#13 /var/www/drupal/public_html/backend/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#14 /var/www/drupal/public_html/backend/vendor/drush/drush/includes/command.inc(199): drush_command('config_installe...')
#15 /var/www/drupal/public_html/backend/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#16 /var/www/drupal/public_html/backend/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#17 /var/www/drupal/public_html/backend/vendor/drush/drush/drush.php(12): drush_main()
#18 {main}

Finalize out-of-the-box setup with features for common use-cases

  • Routing (Drupal-backed and custom)
  • Lazy components
  • Service Workers
  • Pre-loading during SSR
  • Route transition / loading indicator
  • Authentication flow
  • Multilingual
  • Persisted queries (without having to build and commit them)
  • Get rid of introspection.json
  • Make it look pretty
  • Add a few more pages that actually make sense
  • Add content editing capabilities (mutations)

static files (svg, woff, ...)

If I see it correct there is in the frontend/server/index.ts no handling for static files. Something like server.use("/_next/static", express.static(path.join(__dirname, '../static'))); could be usefull.

Licence

Maybe it would be good to have clarity about the licence of this repo. Should I PR a MIT-Licence?

TypeError: Cannot read property 'asPath' of undefined

Hi,
yarn build fails with this error...
Any ideas how to fix it?

/src/components/Router/index.tsx
`
const withQuery = graphql<
IRouterQueryProps,
IRouterQueryData,
IRouterQueryVariables,
IRouterQueryChildProps

(query, {
options: props => ({
variables: {
path: props.url.asPath,
},
}),
props: ({ ownProps, data }) => ({
...ownProps,
entity: data.route && data.route.entity,
loading: data.loading,
}),
});
`

docker-compose up -d: Command Not Found

When trying to run docker-compose up -d.

I get command not found. I have tried docker and it gives me the help of the different command. I double checked that the yml file was correctly named but I am still getting the error.

front end installation fails

Here is my first time user experience following the installation guide in README.md

cd backend && composer install --- works as expected

cd frontend && yarn install --- I am seeing warning and errors related to missing dependencies

Initially a bunch of warnings .. which seem easy enough to fix and then a fatal error .. I will list them below.. I am looking into this now .. but I think there is nothing here that cannot be resolved by tightening up some dependencies

A) Warning

warning " > [email protected]" has unmet peer dependency "[email protected] || ^0.12.0".
warning " > [email protected]" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0".
warning " > [email protected]" has unmet peer dependency "graphql@^0.11.3 || ^0.12.3".
warning " > [email protected]" has unmet peer dependency "graphql@^0.11.0 || ^0.12.3".
warning " > [email protected]" has unmet peer dependency "graphql@^0.11.0".
warning " > [email protected]" has unmet peer dependency "redux@^2.0.0 || ^3.0.0".
warning "react-apollo > [email protected]" has unmet peer dependency "enzyme@^3.0.0".
warning " > [email protected]" has unmet peer dependency "history@^4.7.2".
warning "@amazee/react-scripts > @amazee/[email protected]" has unmet peer dependency "babel-runtime@^6.23.0".
warning "@amazee/react-scripts > [email protected]" has unmet peer dependency "graphql@^0.9.0 || ^0.10.0 || ^0.11.0".
warning "@amazee/react-scripts > [email protected]" has unmet peer dependency "caniuse-lite@^1.0.30000697".
warning "@amazee/react-scripts > [email protected]" has unmet peer dependency "postcss@^6.0.0".
warning "@amazee/react-scripts > [email protected]" has incorrect peer dependency "react@^15.6.2".
warning "@amazee/react-scripts > [email protected]" has incorrect peer dependency "webpack@^1.0||^2.1.0-beta||^2.2.0-rc".

B) The error

warning Error running install script for optional dependency: "/Users/martin/sites/drupal-decoupled-app/frontend/node_modules/fsevents: Command failed.\nExit code: 1\nCommand: node-pre-gyp install --fallback-to-build\nArguments: \nDirectory: /Users/martin/sites/drupal-decoupled-app/frontend/node_modules/fsevents\nOutput:\nnode-pre-gyp info it worked if it ends with ok\nnode-pre-gyp info using [email protected]\nnode-pre-gyp info using [email protected] | darwin | x64\nnode-pre-gyp info check checked for "/Users/martin/sites/drupal-decoupled-app/frontend/node_modules/fsevents/lib/binding/Release/node-v59-darwin-x64/fse.node" (not found)\nnode-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.14/fse-v1.0.14-node-v59-darwin-x64.tar.gz\nnode-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.14/fse-v1.0.14-node-v59-darwin-x64.tar.gz\nnode-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.14/fse-v1.0.14-node-v59-darwin-x64.tar.gz \nnode-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v59 ABI, unknown) (falling back to source compile with node-gyp) \nnode-pre-gyp http 404 status code downloading tarball https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.14/fse-v1.0.14-node-v59-darwin-x64.tar.gz \nnode-pre-gyp ERR! build error \nnode-pre-gyp ERR! stack Error: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)\nnode-pre-gyp ERR! stack at ChildProcess. (/Users/martin/sites/drupal-decoupled-app/frontend/node_modules/node-pre-gyp/lib/util/compile.js:77:29)\nnode-pre-gyp ERR! stack at ChildProcess.emit (events.js:159:13)\nnode-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:207:12)\nnode-pre-gyp ERR! stack at onErrorNT (internal/child_process.js:389:16)\nnode-pre-gyp ERR! stack at process._tickCallback (internal/process/next_tick.js:152:19)\nnode-pre-gyp ERR! System Darwin 17.3.0\nnode-pre-gyp ERR! command "/usr/local/Cellar/node/9.3.0_1/bin/node" "/Users/martin/sites/drupal-decoupled-app/frontend/node_modules/fsevents/node_mโœจ Done in 210.45s.

Authentication Example: JWT w/ protected content

Realize this would be a feature request but it would be great to see an example logging in and accessing content that requires authenticated permissions.

The examples and documentation for handling this common situation seem to be pretty sparse, especially in the decoupled drupal world. I'm not sure if there is a viable solution for authenticating and returning an appropriate JWT token that would work for future request.

Great project and thanks for sharing. You guys do some pretty amazing work.

Automate start/stop process

It will be excellent to have a simple bash file with a set commands that would automate the startup and stop process of the environment.

Oversimplified example on a Mac and Linux:
filename: process.sh

#!/usr/bin/env bash

# Validate tools are installed
if [ $(which composer) == '' ]; then
  echo -e "Composer is not installed"
  exit 1;
fi

if [ $(which yarn) == '' ]; then
  echo -e "Yarn is not installed"
  exit 1;
fi

if [ $(which docker-compose) == '' ]; then
  echo -e "Docker Compose is not installed"
  exit 1;
fi

if [ $(which pygmy) == '' ]; then
  echo -e "Pygmy is not installed"
  exit 1;
fi

# Simple wrapper functions
function install_backend() {
  cd backend
  composer install
  cd  ../
}

function install_frontend() {
  cd frontend
  yarn install
  cd ../
}

function start() {
  install_backend
  install_frontend
  pygmy up
  docker-compose up -d

}

function stop() {
  pygmy down
  docker-compose down
}

function nuke() {
  stop
  docker rm $(docker ps -aq)
  docker rmi $(docker images -aq)
  rm -rf frontend/node_modules
  rm -rf backend/vendor
}

$@```

and it gets called with:
- `./process.sh start` // Start Process
- `./process.sh stop` // Stop Process
- `./process.sh nuke` //  Nuke All

Drupal 8.4.2+ composer update issues

Hey hey. So when we try to composer update we get the following error. While this may not be specific to graphql etc, it may be for the setup of the drupal codebase.

Problem 1
- Installation request for symfony/class-loader ~3.2.8 -> satisfiable by symfony/class-loader[3.2.x-dev, v3.2.10, v3.2.11, v3.2.12, v3.2.13, v3.2.14, v3.2.8, v3.2.9].
- drupal/core 8.3.7 requires symfony/class-loader ~2.8 -> satisfiable by symfony/class-loader[2.8.x-dev].
- drupal/core 8.3.7 requires symfony/class-loader ~2.8 -> satisfiable by symfony/class-loader[2.8.x-dev].
- drupal/core 8.3.7 requires symfony/class-loader ~2.8 -> satisfiable by symfony/class-loader[2.8.x-dev].
- Conclusion: don't install symfony/class-loader 2.8.x-dev
- Installation request for drupal/core (locked at 8.3.7, required as ~8.0) -> satisfiable by drupal/core[8.3.7].

Drush command in Docker Can't connect to MySQL server on '127.0.0.1'

I followed the instructions in the README.md and I get the following error. Do I need to setup up mysql on my machine or is it included in one of the docker images?

$ docker-compose run --user drupal drupal bash
Pulling drupal (amazeeio/drupal:php70-solr)...
php70-solr: Pulling from amazeeio/drupal
6ffe5d2d6a97: Pull complete
f4e00f994fd4: Pull complete
e99f3d1fc87b: Pull complete
a3ed95caeb02: Pull complete
ededd75b6753: Pull complete
1ddde157dd31: Pull complete
230191ce0903: Pull complete
b0ffc7d1ccfe: Pull complete
0678524a0f5a: Pull complete
da81a110ed73: Pull complete
d84d2ff0e00d: Pull complete
9158cdd394ce: Pull complete
c8b0af747039: Pull complete
734271ead33d: Pull complete
efb46f90acd6: Pull complete
f8250dcc3017: Pull complete
7ff3f6023ac7: Pull complete
b12d3175d60b: Pull complete
2883bd0d59a1: Pull complete
Digest: sha256:12500e872a7fa25aa10c981af5f9965e0311257fa240d2fad10e4860e5a215fd
Status: Downloaded newer image for amazeeio/drupal:php70-solr
๐Ÿณ [email protected]:~/public_html/backend/web (master)$ drush si config_installer -y --account-name=admin --account-pass=admin
You are about to CREATE the 'drupal' database. Do you want to continue? (y/n): y
Failed to create database: ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1'  [error]
(111 "Connection refused")

Server Side Rendering

If I fetch something from the GraphQL-Server I get from the Server-Side-Rendering <div>loading...</div> instead of my data. Any idea how to make the SSR waiting for the data?

// home.jsx
...
import query from "./query.gql";
import withApollo from "~/shared/withApollo";

export const Home: StatelessComponent<{}> = ({ loading, entities }) => {
  console.log('entities', entities)

  if (loading) {
    return <div>loading...</div>;
  }

  return (
    <div>{entities.map(item => "...")}</div>
  );
};

const withQuery = graphql(query, {
  props: ({ ownProps, data }) => ({
    ...ownProps,
    entities: data.nodeQuery && data.nodeQuery.entities,
    loading: data.loading
  })
});

// export default Home;
export default compose(withApollo, withQuery)(Home);

403 when hitting graphql from frontend

Getting a 403 when clicking on the node overview link or any node that I've created.
I'm able to use the graphql explorer perfectly fine on the Drupal side.

I must be missing a step. Would I have to set up JWT with the frontend myself or does some of that work out-of-the-box?

persistgraphql library not found on yarn install

yarn install fails with:

error An unexpected error occurred: "https://registry.yarnpkg.com/@amazee/persistgraphql/-/persistgraphql-0.3.2.tgz: Request failed \"404 Not Found\"".

Stack trace:

Trace:
  Error: https://registry.yarnpkg.com/@amazee/persistgraphql/-/persistgraphql-0.3.2.tgz: Request failed "404 Not Found"
      at Request.handleRequestError (/usr/local/Cellar/yarn/0.23.2/libexec/lib/fetchers/tarball-fetcher.js:205:20)
      at emitOne (events.js:96:13)
      at Request.emit (events.js:191:7)
      at Request.onRequestResponse (/usr/local/Cellar/yarn/0.23.2/libexec/node_modules/request/request.js:1074:10)
      at emitOne (events.js:96:13)
      at ClientRequest.emit (events.js:191:7)
      at HTTPParser.parserOnIncomingClient (_http_client.js:522:21)
      at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
      at TLSSocket.socketOnData (_http_client.js:411:20)
      at emitOne (events.js:96:13)
      at TLSSocket.emit (events.js:191:7)

Server side rendering Question

Not sure if I'm doing it right but i am under the impression that the only page in this example that is being delivered by the server is /home. At least out of the box, overview, articles and pages are missing in the initial source file after running through the steps provided in the readme.

"docker-compose build" failing: repository does not exist or may require authorization

I've just installed Lagoon and attempted to build this project per the instructions in the readme file. However, the "docker-compose build" step is failing with the following error messages:

=> [drupal-decoupled-app_frontend internal] load .dockerignore                                                                                          0.0s
 => => transferring context: 2B                                                                                                                          0.0s
 => CANCELED [drupal-decoupled-app internal] load metadata for docker.io/amazeeio/php:7.1-cli-drupal                                                     0.7s
 => CANCELED [drupal-decoupled-app_nginx internal] load metadata for docker.io/amazeeio/nginx-drupal:latest                                              0.6s
 => ERROR [drupal-decoupled-app_php internal] load metadata for docker.io/library/drupal-decoupled-app:latest                                            0.6s
 => CANCELED [drupal-decoupled-app_php internal] load metadata for docker.io/amazeeio/php:7.1-fpm                                                        0.6s
 => CANCELED [drupal-decoupled-app_frontend internal] load metadata for docker.io/amazeeio/node:8                                                        0.6s
 => CANCELED [drupal-decoupled-app_frontend internal] load metadata for docker.io/amazeeio/node:8-builder                                                0.6s
------
 > [drupal-decoupled-app_php internal] load metadata for docker.io/library/drupal-decoupled-app:latest:
------
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

Has something changed or am I missing a setup step somewhere?

My setup steps have been (after cloning this git repo):

gem install pygmy
pygmy up
docker-compose build

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.