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
The Eat Local backend is build on Rails 5.2.8.1 and Ruby 2.7.4
-
Clone the repo
git clone git@github.com:Eat-Local/eat-local-be.git
-
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'
-
Install Gems with
$bundle install
-
Migrate database with
$rails db:{create,migrate}
-
Seed development/test database with
$rails db:seed
-
Enter your API keys
Run
$ bundle exec figaro install
File config/application.yml should be created and ignored.
YELP_API_KEY: 'ENTER_YOUR_API'
-
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 } }
Capybara | factory_bot_rails | faker |
faraday | figaro | graphiql |
graphql | jsonapi-serializer | pry |
rack-cors | rspec-rails | rubocop |
rubocop-faker | shoulda-matchers | simplecov |
vcr | webmock |