Giter Club home page Giter Club logo

epeolatry_back_end's Introduction

Contributors Forks Stargazers Issues


Logo

e . p . e . o . l . a . t . r . y | backend

a carefully crafted collection of API endpoints to cater to and be consumed by epeolatry | FRONT END

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Examples
  5. Roadmap
  6. Contribute

An API Integration built to bridge epeolatry | FRONT END to GoogleBooks - allowing users not only to track their literary/vocabulary journey within our app, but also to edit their Google Bookshelves, Reading Lists, etc. through our app.

  • Visit us on Heroku
  • If you'd prefer a more behind-the-scenes tour, run through LocalHost:3000 - starting with the steps below.
  • You may want to browse the Google Books API Docs
  • You will need to request an API Key
  • I'd recommend both | You can do either HERE
  1. Fork and clone this repo
  2. Add Figaro to Gemfile
    #epeolatry_front_end/gemfile
    
    #group :development, :test do
    gem 'figaro'
    #end
  3. Add your API Key
    #config/application.yml
    
    API_KEY = 'ENTER YOUR API'
  4. Install gem packages by running bundle
  5. Setup the database by running rails db:{drop,create,migrate}
  6. Run rails s and navigate to http://localhost:3000

Below are all included endpoints, along with necessary params.

BOOKS

Method URL Detail Params
GET /api/v1/user/books Reader's Books { auth_token: 'the users auth_token from google' }
GET /api/v1/book/search’ Book Search Results { search: 'search words', page: 'which page of returns, defaults to first page if not passed' }
POST /api/v1/user/books Add a Book to Reader's Library { volume_id: book_id, auth_token: auth_token_for_user, shelf_id: ‘2, 3, or 4’ }
DELETE /api/v1/user/books/:volume_id Remove Book From Reader's Library { auth_token: auth_token_for_user, shelf_id: ‘2, 3, or 4’ }

WORDS

Method URL Detail Params
GET /api/v1/word/search Word Search Results params[:q] = <'word you want to search example - caterwaul'>
POST /api/v1/user/words Add Word to Glossary for given Book { word: 'word to look up and create', volume_id: book_id, user_id: user_id }
GET /api/v1/user/words Reader's Glossary of Words { user_id: user_id }

READER'S BOOKS:


[{:id=>"PCcOMbEydAIC",
  :type=>"book_and_shelf",
  :attributes=>
   {:title=>"Lilith's Brood",
    :authors=>["Octavia E. Butler"],
    :genres=>["Fiction"],
    :description=>
     "The complete series about an alien species that could save humanity after nuclear apocalypse—or destroy it—from “one of science fiction’s finest writers” (The New York Times). The newest stage in human evolution begins in outer space. Survivors ...",
    :shelves=>["Reading now"]}},
 {:id=>"ZrNzAwAAQBAJ",
  :type=>"book_and_shelf",
  :attributes=>
   {:title=>"The Three-Body Problem",
    :authors=>["Cixin Liu"],
    :genres=>["Fiction"],
    :description=>
     "Soon to be a Netflix Original Series! “War of the Worlds for the 21st century.” – Wall Street Journal The Three-Body Problem is the first chance for English-speaking readers to experience the Hugo Award-winning phenomenon from China's most ...",
    :shelves=>["Reading now"]}},
 {:id=>"8thMLkahggcC",
  :type=>"book_and_shelf",
  :attributes=>
   {:title=>"Parable of the Sower",
    :authors=>["Octavia E. Butler"],
    :genres=>["Fiction"],
    :description=>
     "A New York Times Notable Book: In 2025, with the world descending into madness and anarchy, one woman begins a fateful journey toward a better future. “A stunner.” —Flea, musician and actor, TheWall Street Journal Lauren Olamina and her family ...",
    :shelves=>["Reading now", "To read"]}},
 {:id=>"yrYUvgAACAAJ",
  :type=>"book_and_shelf",
  :attributes=>
   {:title=>"All You Need Is Kill",
    :authors=>["Hiroshi Sakurazaka"],
    :genres=>["Fiction"],
    :description=>
     "When the alien Mimics invade, Keiji Kiriya is just one of many recruits shoved into a suit of battle armor called a Jacket and sent out to kill. Keiji dies on the battlefield, only to be reborn each morning to fight and die again and again. On ...",
    :shelves=>["Reading now"]}},
 {:id=>"inYs79gV4UQC",
  :type=>"book_and_shelf",
  :attributes=>
   {:title=>"Snow Crash",
    :authors=>["Neal Stephenson"],
    :genres=>["Fiction"],
    :description=>
     "\"This Snow Crash thing--is it a virus, a drug, or a religion?\" Juanita shrugs. \"What's the difference?\" The only relief from the sea of logos is within the well-guarded borders of the Burbclaves. Is it any wonder that most sane folks have ...",
    :shelves=>["To read"]}}]

WORD SEARCH RESULTS:



'https://epeolatry-back-end.herokuapp.com/api/v1/word/search'
  params[:word] = <'word you want to search example - caterwaul'>

{:data=>
  {:id=>"caterwaul",
   :type=>"word_poro",
   :attributes=>
    {:word=>"caterwaul",
     :definition=>"Make a shrill howling or wailing noise like that of a cat.",
     :phonetic=>"/ˈkædərˌwɔl/",
     :phonetic_link=>"https://lex-audio.useremarkable.com/mp3/caterwaul_us_1.mp3",
     :part_of_speech=>"intransitive verb",
     :synonyms=>nil,
     :example=>"he seems to think that singing soulfully is to whine and caterwaul tunelessly"
   }
  }
 }

See the open issues for a list of proposed features (and known issues).

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

epeolatry_back_end's People

Contributors

lawrencewhalen avatar aliyamerali avatar lcpulzone avatar aferencz1987 avatar caleb1991 avatar jbrabson avatar

Watchers

 avatar

Forkers

caleb1991

epeolatry_back_end's Issues

Books Index: Reader can filter books by any attribute

  • Book’s Attributes: Title, author, shelf
  • Title links to book show page
  • Should be paginated

FE will ping: GET (reader’s books with filter applied) / epeolatry API
BE will need to ping: GET (reader’s books) / Google Books API

Dashboard shows word statistics

  • Average words saved per book
  • Most frequently looked up word
  • Longest word looked up

FE will ping endpoint:
GET (reader’s word stats) / epeolatry API

Book Show: Reader can look up a word for a book in their library

If a book is in the reader’s library, the reader can search for a word. On submitting the word search, the search results are shown on the Book Show page (in a “Search Results” section separate from the book’s word list section).

The “Search Results” section shows the first 10 words resulting from the search, and each word links to that word’s show page.

FE will ping:
GET (lookup word in dictionary) / epeolatry API

BE will need:
GET (lookup word in dictionary) / dictionary API

Book Show: If the book is in my library: Shows book info, book’s word list + add word action

If a book is already in the reader’s library, the page renders the book details, any words associated with the book, and a button to lookup a word from that book.

Book’s word list:

  • Word, which links to word show page
  • Words are shown in order of time added to the list, with most recently added words at the top

Book details:

  • Title
  • Author
  • Genre
  • Summary
  • Shelf/status
  • [Date started?]
  • [Date completed?]

FE will ping:
GET (book’s word list) / epeolatry API
GET (get book details and status if in library) / epeolatry API

BE will need:
GET (check if book is in library) / Google Books API
GET (get book details) / Google Books API

Books Index: Reader sees a search bar to search for a new book

  • Search output is shown in a “Search Results” section (separate from the book index)
  • Search result title links to book show page
  • Search results should be paginated

FE will ping: GET (book search results) / epeolatry API
BE will need: GET (book search results) / Google Books API

Word Index: Shows all of the reader’s words as links to the word’s show page

When a reader is on the Word Index page, they see all of their words listed out in order of most recently added.

  • Each word is a link to that word’s Word Show page
  • Word attributes shown: date added, book title as link to book show page
  • Index page is paginated for multiple words with 20 as their default, reader can adjust for how many they want to see

FE will ping:
GET (reader’s words) / epeolatry API

[new word] Word Show Page: Reader can see the definition of a word on the word’s show page

The word show page includes:

  • The book title from which this word was searched
  • The definition of the word
  • A button to “Save this word to ’s words”
  • Additional word details, e.g.:
    • phonetic pronunciation
    • link to pronunciation
    • example
    • part of speech
    • synonyms
    • language

FE will ping:
GET (lookup word in dictionary) / epeolatry API

BE will need:
GET (lookup word in dictionary) / dictionary API

Book Show: Reader can remove a book from their library

If a book is in the reader’s library, the reader will see a button to “Remove from Library.” Clicking this button will remove the book from the reader’s library in the Google Books DB.

  • Removing a book from the reader’s library should destroy words added for that book
  • Upon deleting the book, the user is redirected to the books index page, where they no longer see this book listed

FE will ping:
DELETE (remove a book from library) / epeolatry API

BE will need:
DELETE (remove a book from library) / Google Books API

Word Index: Shows an option to filter reader’s words by an attribute

When a reader is on the Word Index page and they see all of their words, they see on option to filter their list of words by an attribute

  • Book’s word list it’s on as link to book’s show page
  • Date added
  • Alphabetically
  • Order of difficulty?

FE will ping:
GET (reader’s words with filters applied) / epeolatry API

Book Show: If the book is not in my library: Shows book info + add book to library action

If a book is not yet in the reader’s library, the page renders the book details and a button to add the book to a shelf.

Book details:

  • Title
  • Author
  • Genre
  • Summary
  • [Date started?]
  • [Date completed?]

Upon clicking the ‘Add Book’ button and selecting a shelf (or defaulting to a specific shelf, TBD based on BE team research), the reader is returned to a refreshed Book Show page where they see options to add a word to the book, and no longer see the option to ‘Add Book’ to a shelf.

FE will ping: GET (get book details and status if in library) / epeolatry API

BE will need:
GET (check if book is in library) / google books API
GET (get book details) / google books API

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.