Skip to content

Capstone-Bookworm/bookworm-be

Repository files navigation

Bookworm

Say goodbye to cluttered bookshelves and hello to a new way of reading. Bookworm connects you with a community of book lovers who are eager to share their favorite stories with one another. Simply swap books with members of our community and enjoy new stories for free!

Context

  • This project was the Capstone project for the 8-month Software Engineering program at Turing School of Software and Design. It was the first time the Back End and Front End cohorts worked together to create a full-stack project.
  • Our main learning goal as a group was learning GraphQL. In this project, we utilized the CRUD methods with GraphQL and look forward to adding to this project so that our use of GraphQL is more realistic to how it would be used in a long term project.

(Want to hire the devs that worked on this project? Click this link to jump to our project contributors!)

Visit our Front End Site here

Find our Front End documentation here

Built With

Ruby Rails GraphQL PostgreSQL Heroku

Setup

Clone the repository

git clone
cd bookworm-be

Check your Ruby version

ruby -v

The ouput should start with something like ruby 2.7.4

If not, install the correct ruby version using rbenv:

rbenv install 2.7.4

Install dependencies

Using Bundler

bundle install

Set environment variables

Using Figaro

bundle exec figaro install

add your key from Google Books API to application.yml in the config folder

google_books_api_key: 'your_key_goes_here'

Initialize the database

rails db:{drop,create,migrate,seed}

Run the Test Suite

bundle exec rspec

Start the Server

rails s

You should now be able to hit the API endpoints using Postman or a similar tool.

Default host is http://localhost:3000

Database Schema

Database Schema Image

GraphQL Endpoints

To make calls to our server, use this endpoint: https://bookworm-be.herokuapp.com/graphql

Run in Postman

User ID

{
    user(id:1) {
        userName
        location
        emailAddress
    }
}

Books

{
    books {
        id
        isbn
        title
        author
        pageCount
        imageUrl
        summary
    }
}

Book ID

{
    book(id:1){
        id
        isbn
        title
        author
        pageCount
        summary
        imageUrl
    }
}

Book Search

{
    bookSearch(title: "Jurassic Park") {
    id
    isbn
    title
    author
    pageCount
    imageUrl
    summary
    }
}

Google Books

{
    googleBooks(title: "Jurassic Park") {
        isbn
        title
        author
        imageUrl
        summary
        pageCount
    }
}

createUser mutation

mutation{
    createUser(input: {
        userName: "Zuko",
        emailAddress: "fire_nation@example.com",
        location: "Denver"
    }) { user {
            id
            userName
            emailAddress
            location
            }
       }
}

createBook mutation

mutation{
    createBook(input: {
        userId: 8
        isbn: "9780525657743"
        title: "Crying in H Mart"
        author: "Michelle Zauner"
        summary: "NEW YORK TIMES BEST SELLER • From the indie rock sensation known as Japanese Breakfast, an unforgettable memoir about family, food, grief, love, and growing up Korean American—“in losing her mother and cooking to bring her back to life, Zauner became herself” (NPR)"
        pageCount: 257
        imageUrl: "http://books.google.com/books/content?id=30UlEAAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api"
    }) { book {
            id
            isbn
            title
            author
            summary
            pageCount
            imageUrl
            }
       }
}

patchUserBook mutation

mutation{
    patchUserBook(input: {
        userId: 4,
        bookId: 10,
        borrowerId: 1,
        status: 1
    }) { userBook {
            bookId
            status
            }
       }
}

deleteBook mutation

mutation {
    deleteBook(
        input: {
        userId: 8
        bookId: 16
        }
    ) {
        success
      }
}



Contributors

Back End Team

Amanda Ross Naomi Yocum Rich Kaht
GitHub
LinkedIn
GitHub
LinkedIn
GitHub

Front End Team

Adelle Pitsas Joshua Pierce Lauren Frazier Sage Skaff
GitHub
LinkedIn
GitHub
LinkedIn
GitHub
LinkedIn
GitHub
LinkedIn

Instructor/Project Manager

Juliet Eyraud

Mentor

Taylor Pridgen

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published