Giter VIP home page Giter VIP logo

mern_book_search_engine's Introduction

MERN_Book_Search_Engine

This app allows you to search for new books, create a list of searched books to purchase.

License: MIT

Overview

Setting up an Apollo Server to use GraphQL queries and mutations to fetch and modify data, replacing the existing RESTful API.

Modifying the existing authentication middleware so that it works in the context of a GraphQL API.

Creating an Apollo Provider so that requests can communicate with an Apollo Server.

Deploying your application to Heroku with a MongoDB database using MongoDB Atlas.

Deployed App

https://aqueous-taiga-47604.herokuapp.com/

Installations

npm install

Deploy and Run

keep separate terminals for all

mongod

cd client > npm run build//for production

npm run deploy

In case you want to seed the data as well : node seed/seed.js

(refer to scripts in package.json) scripts should look like this :

"start": "node server/server.js",
"develop": "concurrently \"cd server && npm run watch\" \"cd client && npm start\"",
"install": "cd server && npm i && cd ../client && npm i",
"build": "cd client && npm run build"

npx kill-port 3000

Mutation (for logging in)
mutation Login($email: String!, $password:String!) {
  login(email: $email, password:$password){
user {
email
password
}
}
}

query variable

```md
{
"email": "[email protected]",
"password": "password02"
}
```

Result

{
"data": {
"login": {
"user": {
"email": "[email protected]",
"password": "$2b$10$BN48OB/mtfpSJJ8bVkq7BOB.mMybOAj6hyMd.L/p8I8uRfiu1gLda"
}
}
}
}

#Sign-up mutation

mutation AddUser($username: String!, $email: String!, $password: String!) {
  addUser(username:$username,email: $email, password:$password){
user {
username
email
password
}
}
}
query variables
{
"username":"abcd",
"email": "[email protected]",
"password": "12345678"
}
Result
{
"data": {
"addUser": {
"user": {
"username": "abcd",
"email": "[email protected]",
"password": "$2b$10$YhKCqDq66xOudOzjGlUuZu/2yiLv8kcxqfVMOosBYN/PE8adAYmoW"
}
}
}
}

License

License: MIT

© 2021 Rajni Dua

Licensed under MIT

mern_book_search_engine's People

Contributors

rajnidua avatar

Watchers

 avatar

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.