Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 956 Bytes

File metadata and controls

15 lines (10 loc) · 956 Bytes

express-graphql-react-authentication Starter

Perfect starter for a any project with NodeJs, express, mongodb, GraphQL in the backend, and React, Apollo JS in the frontend

Authentication is all done. Works with JWT tokens/refreshTokens. SignUp, login, logout, works as a charm. Includes Errors GraphQL side. Also validation in frontend.

Setup: fill the .env file variables. Something like:

  • NODE_ENV=development
  • MONGODB_URI=mongodb://localhost:27017/nameofdb
  • PORT=3000
  • SECRET=mahsdASDHASKDaskdjasdAJSDAs
  • SECRET2=ASDJASDJasDJQURJFIRWGJDgkjdthijdksjfs

Client folder is inside the server with the name of authGraphQLStarter_Client. I did this just for easily upload this project to github. But you have to run both projects separately. Server side is only to handle GraphQL requests. I use Yarn for this, so open the terminal, go to Server folder and run yarn start. Then open a tab, go to Client folder, and also run yarn start.