Skip to content

Eat-Local/eat-local-be

Repository files navigation


Logo

Eat Local

Eat local was designed to exclusively support local businesses. Small businesses do not have the resources or the capital to survive without sales and support, like larger companies do. Approximately 1 out of 5 small businesses close their doors permanently within their first year of business. The odds of a small business failing increases more each year they are open with a failure rate of 66% after 10 years of business. Running a small business is very difficult, but is near impossible without support. To continue to have diverse options to eat, drink, and shop there needs to be an effort made to support these businesses or your favorite neighborhood spots may not be around much longer. Please eat local!


Explore the docs »

· Report Bug · Request Feature


About The Project

Table of Contents

  1. About The Project
  2. Built With
  3. Getting Started
  4. Prerequisites
  5. Installation
  6. Contributing
  7. APIs
  8. Contacts
  9. Acknowledgments

Built With

Contributors Forks Issues

Ruby Ruby on Rails CircleCI GraphQL PostgreSQL Git Miro Postman

Getting Started


Prerequistites

The Eat Local backend is build on Rails 5.2.8.1 and Ruby 2.7.4

Installation and setup

  1. Clone the repo

    git clone git@github.com:Eat-Local/eat-local-be.git
  2. Add gems In the main body:

    gem 'faraday'
    gem 'figaro'
    gem 'graphiql-rails'
    gem 'graphql'
    gem 'jsonapi-serializer'
    gem 'rack-cors'

    In group :development, :test do

    gem 'capybara'
    gem 'factory_bot_rails'
    gem 'faker'
    gem 'pry'
    gem 'rspec-rails'
    gem 'rubocop'
    gem 'rubocop-faker'
    gem 'rubocop-rails'
    gem 'shoulda-matchers'
    gem 'simplecov'
    gem 'vcr'
    gem 'webmock'
  3. Install Gems with $bundle install

  4. Migrate database with $rails db:{create,migrate}

  5. Seed development/test database with $rails db:seed

  6. Enter your API keys

    Run

    $ bundle exec figaro install

    File config/application.yml should be created and ignored.

    YELP_API_KEY: 'ENTER_YOUR_API'

(back to top)


Database Schema

Screen Shot 2022-12-13 at 2 05 34 PM

(back to top)


Endpoints

  • GET a user by email

    query getUsers {
      user(email: "email"){
          fname
          lname
          email
          favorites {
              title
          }
      }
    }
    
  • CREATE a user

    mutation {
      createUser(input: {
      email: "freddyf@fakeemail.com",
      fname: "Fred",
      lname: "Fredson"
      }) {
      user {
        id,
        email,
        fname,
        lname
        }
      errors
      }
    }
    
  • CREATE a favorite for a user

    mutation {
            createFavorite(input: {
              title: "place",
              venueType: "brewery",
              address: "123 Fake street, Denver, CO, 80205"
              rating: "2.2",
              url: "www.fake.com",
              image: "www.fakepic.com",
              price: "a kings ransom",
              phone: "(303) 123-4567",
              latitude: "39.7392",
              longitude: "-104.9903",
              userId: "1"
            }) {
              user {
                id,
                email,
                fname,
                lname
                favorites {
                  id,
                  title,
                  venueType,
                  address,
                  rating,
                  url,
                  image,
                  price,
                  phone,
                  latitude,
                  longitude,
                  userId
                }
              }
             errors
            }
          }
    
  • DESTROY a user favorite

       mutation {
            destroyFavorite(input: {
              id: 1
              userId: 1
            }) {
              user {
                id
                email
                fname
                lname
                favorites {
                  id
                  title
                  venueType
                  address
                  rating
                  url
                  image
                  price
                  phone
                  latitude
                  longitude
                  userId
                }
              }
             errors
            }
          }
    


Contacts

Individual contributors:

Erik Riggs: GitHub || LinkedIn Benjamin Randolph: GitHub || LinkedIn Kaelin Sleevi: GitHub || LinkedIn Dominic O'Donnell: GitHub || LinkedIn
Erik Riggs GitHub Benjamin Randolph GitHub Kaelin Sleevi GitHub Dominic O'Donnell GitHub

Front-End Project Link: Eat Local FE Production Site: Eat Local

(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages