Menuo project


Another pet project just for fun.

Everytime then I or my friends decide to visit restaurant, we usually check menu from their websites for our favorite dishes.

Usually we check at least five places to visit and buy a burger for example or fish based dish.

Please welcome - Menuo project. It’s a simple aggregation service for searching in menus of different restaurants in one place.

You can add your favorite dish in settings or add item to favorites, sort, filter and check prices for one dish in different places.

Simple search bar:

1

It’s a Rails5 API project and ReactJS client.

Nothing interesting or special here, just ActiveAdmin for restaurants and searchkik gem for ElasticSearch.

Install ElasticSearch as usual first:

brew install elasticsearch
brew services start elasticsearch

Install gem, and add searchkick text_middle: [:title, :description] fields to search into your model.

# == Schema Information
#
# Table name: products
#
#  id                  :integer          not null, primary key
#  title               :string
#  price               :decimal(, )
#  product_category_id :integer
#  weight              :integer
#  ingredients         :text
#  created_at          :datetime         not null
#  updated_at          :datetime         not null
#

class Product < ApplicationRecord
  belongs_to :product_category
  belongs_to :restaurant
  validates :title, :price, presence: true
  searchkick text_middle: [:title, :description]
  belongs_to :admin_user
  after_commit :reindex_product

  def reindex_product
    Product.reindex
  end
end

You can add after_commit :reindex_product to reindex new products in DB, but right way to do it, move this job into background with Sidekiq for example.

And results of Burger search:

2