pmuens/discuss

Install help

Closed this issue · 5 comments

Hey Phillip -

looks very cool and i'd like to contribute, but having issues deploying. can you help? had to rearrange some of your steps to make progress...

Installed latest Serverless

Git cloned Discuss into new folder

(1) cd into the root of the project. Run npm install to install all necessary NPM dependencies for the Serverless project.

(2) Ran 'serverless project init' to initialize the Serverless project.

at this point, i get this warning: "Serverless: - Serverless: WARNING: This variable is not defined: authTokenSecret" perhaps the step below needs to happen first?

(3) Add the following environment variables to the JSON array of the corresponding file in _meta/variables.

{
...
"authTokenSecret": "STRONGVALUE"
}

what file am i adding this to? i see three: s-variables-common.json, s-variables-projectname.json, and s-variables-projectname-region.json.

(4) Run cd backend/lib && npm install && cd ../../ to install the NPM dependencies for the GraphQL backend.

(5) Run serverless endpoint deploy --all to deploy the CORS enabled endpoints.

When i run this, i get about fifty lines of warnings about these three variables:

Serverless: WARNING: This variable is not defined: stage Serverless: WARNING: This variable is not defined: region Serverless: WARNING: This variable is not defined: authTokenSecret

thanks!
adam

Hey @adamdiy! Thank you for your kind words and the offer to help!

@8mylez installed it today on his machine and had some issues as well. We'll work on the README so that its easier to understand (and hopefully works 😄).

Basically you need to do a project init to setup the Serverless project on your machine.
The warning regarding the variable is ok. You should set the variable after you've initialized the project.

You can put the authTokenSecret anywhere you'd like. You might want to read here what those three files mean. This might also help you to find a place where to enter it.

The endless warnings that those variables are not defined are caused due to a "problem" with the CORS plugin (see here: serverless/serverless-graphql#10 (comment)).

One last thing: You need to remove the /graphql in your API_URL you set in the client.

After that everything should work as expected.

We'll update the README pretty soon so that all those changes are reflected.

Let me know if you need any additional help!

thanks @pmuens ! getting closer...

may want to make it explicit for people that they should be running npm start and npm build from \discuss\client\src since they leave that dir in step 1 of client setup

also - my build failed and howled about missing lodash:

ERROR in ./app/js/reducers/comments.js Module not found: Error: Cannot resolve module 'lodash'

missing dependency? or one of the other deps dropped it? in any case, npm install lodash --save fixed that error

@adamdiy Great! Thanks for the feedback and the instructions. This will help others as well!

Yes, we definitely need to work on the setup instructions as they are a little bit misleading.

Good catch with lodash (/cc @8mylez) (seems like it's not defined in package.json --> https://github.com/JustServerless/discuss/blob/master/client/src/package.json#L33-L45). I'll add that ASAP!

anytime @pmuens ! looks supercool, can't wait til i can get it up and running to play with

Thanks @adamdiy. @8mylez just submitted two PRs (#17 and #18) which should help you and solve the described problems.