Skip to content

menu-ify/menu-ify-rails-be

Repository files navigation

Menuify API


Table of Contents

Project Overview

Menuify is a full-stack application created by Backend and Frontend students of Turing School of Software and Design. The Menuify app allows restaurant owners the ability to easily create mobile-friendly menus to increase user experience. Instead of scrolling through a difficult to navigate pdf of a menu, a restaurant diner can view menu items in our user friendly app. Frontend and backend teams collaborated on the design, development, and deployment processes throughout the software development lifecycle. This repo is one of two REST API microservices created for the Frontend to implement. This API was built using Ruby on Rails and has CRUD functionality for Restaurants and MenuItems.

Restaurant owners can easily add, edit, and delete menus as well as create a new restaurant. Images on menus can be added by url, or incorporating our Menuify Photo API microservice.

Learning Goals

Project Specs

  • Utilize Agile methodologies, Service Oriented Architecture, and Microservices to ensure deployment of a RESTful API with MVP

  • Develop quality communication between Frontend and Backend teams, including daily stand-ups, project retros, a project board, and a JSON contract

  • Gain experience using Continuous Integration tools to build and automate the deployment of features

  • Create API microservices to support application features for our end users

  • Learn new technologies and tools (Python with FastApi Framework)

Developer Setup

  1. Clone the respository
  2. cd into the root directory
  3. Install gem packages: bundle install
  4. Setup the database: rails db:{drop,create,migrate}
  5. Seed the database using the rake task: rake csv_load:all
  6. Run rails c and then Restaurant.count and MenuItem.count. You should have 3 and 30 respectively
  7. You may run the RSpec test suite locally with bundle exec rspec
  8. Run rails s to use the localhost:3001 server

Tech and Tools

Built With

  • Ruby 3.2.2
  • Rails 7.0.8.4
  • RSpec 3.12.2
  • PostgreSQL
  • Postman
  • Heroku
  • Circle Ci

Gems Used

Other Tools

  • Google Calender
  • Github Projects
  • Miro

Database Schema

db schema


Endpoints

Run in Postman

Restaurant Endpoints

Get all restaurants

Request:

GET /api/v1/restaurants

Example:

JSON Response Example:

{
    "data": [
        {
            "id": "100",
            "type": "restaurant",
            "attributes": {
                "name": "Pho Kyah",
                "description": "Experimental Asian fusion gastropub",
                "logo": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/16/Ph%E1%BB%9F_v%E1%BB%8Bt_quay.jpg/640px-Ph%E1%BB%9F_v%E1%BB%8Bt_quay.jpg"
            }
        },
        {
            "id": "200",
            "type": "restaurant",
            "attributes": {
                "name": "Tim's Tiki Bar",
                "description": "All the aloha you can eat",
                "logo": "https://publicdomainvectors.org/photos/SteveLambert_Tiki_Bar.png"
            }
        },
        {...}
    ]
}
Create a new restaurant

Request:

POST /api/v1/restaurants

Example:

Request Body:

{ 
    "name": "West Colorado Burgers",
    "description": "Best burgers west of the Rockies!",
    "logo": "WestCOBurgers.calm"
}

JSON Response Example:

{
    "data": {
        "id": "123",
        "type": "restaurant",
        "attributes": {
            "name": "West Colorado Burgers",
            "description": "Best burgers west of the Rockies!",
            "logo": "WestCOBurgers.calm"
        }
    }
}
Update existing restaurant

Request:

PATCH /api/v1/restaurants/:restaurant_id

Example:

Request Body:

{
    "name": "Western Colorado Burgers", 
    "description": "We're better than the other place", 
    "logo": "westerncoburgers.net"
}

JSON Response Example:

{
    "data": {
        "id": "123",
        "type": "restaurant",
        "attributes": {
            "name": "Western Colorado Burgers",
            "description": "We're better than the other place",
            "logo": "westerncoburgers.net"
        }
    }
}

Menu Items Endpoints

Get all menu items from a restaurant

Request:

GET /api/v1/restaurants/:restaurant_id/menu_items

JSON Response Example:

{
    "data": [
        {
            "id": "4",
            "type": "menu_item",
            "attributes": {
                "restaurant_id": 100,
                "name": "Pho with Shrimp",
                "description": "Vietnamese soup with shrimp and veggies",
                "tags": "gluten free",
                "category": "entree",
                "image": "https://thelemonbowl.com/wp-content/uploads/2021/02/Vietnamese-Shrimp-Pho_25_WEB.jpg",
                "price": 16.0
            }
        },
        {
            "id": "7",
            "type": "menu_item",
            "attributes": {
                "restaurant_id": 100,
                "name": "Asahi",
                "description": "Fresh clean beer from Japan",
                "tags": "gluten",
                "category": "draft beer",
                "image": "https://oakbeveragesinc.com/wp-content/uploads/2015/10/Asahi-Super-Dry-Bottle-500.jpg",
                "price": 5.5
            }
        },
        {
            "id": "5",
            "type": "menu_item",
            "attributes": {
                "restaurant_id": 100,
                "name": "Pho with Chicken",
                "description": "Vietnamese soup with chicken and veggies",
                "tags": "gluten free",
                "category": "entree",
                "image": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/49/Vietnamese_Pho.jpg/640px-Vietnamese_Pho.jpg",
                "price": 13.5
            }
        },
        {
            "id": "6",
            "type": "menu_item",
            "attributes": {
                "restaurant_id": 100,
                "name": "Pho with Veggies",
                "description": "Vietnamese soup with veggies",
                "tags": "gluten free, vegetarian",
                "category": "entree",
                "image": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Vegetarian_Pho_%285541416031%29.jpg/640px-Vegetarian_Pho_%285541416031%29.jpg",
                "price": 11.0
            }
        },
        {
            "id": "8",
            "type": "menu_item",
            "attributes": {
                "restaurant_id": 100,
                "name": "Tiger Asian Lager",
                "description": "Easy-drinking Asian pilsner",
                "tags": "gluten",
                "category": "draft beer",
                "image": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/Tiger_Beer_Bottles.png/640px-Tiger_Beer_Bottles.png",
                "price": 5.5
            }
        },
        {
            "id": "9",
            "type": "menu_item",
            "attributes": {
                "restaurant_id": 100,
                "name": "Purple dragon",
                "description": "Warm saki with a special blend of fruit juices and whole blueberries",
                "tags": "gluten free",
                "category": "cocktail",
                "image": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Purple_Rain_08.jpg/640px-Purple_Rain_08.jpg",
                "price": 8.5
            }
        },
        {
            "id": "62",
            "type": "menu_item",
            "attributes": {
                "restaurant_id": 100,
                "name": "Spring Roll",
                "description": "Fresh vegetarian spring rolls",
                "tags": "No tags added",
                "category": "appetizer",
                "image": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Vietnamese_spring_roll.jpg/640px-Vietnamese_spring_roll.jpg",
                "price": 8.0
            }
        }
    ]
}
Create a Menu Item

Request:

POST /api/v1/restaurants/:restaurant_id/menu_items

Request Body:

{
    "name": "Spice Curls",
    "description": "The curly fry with a southwestern kick!",
    "tags": "vegetarian, vegan",
    "category": "Sides",
    "image": "https://www.lospolloshermanos.com/spice_curls.jpeg",
    "price": 4.95
}

JSON Response Example:

{
    "data": {
        "id": "92",
        "type": "menu_item",
        "attributes": {
            "restaurant_id": 100,
            "name": "Spice Curls",
            "description": "The curly fry with a southwestern kick!",
            "tags": "vegetarian, vegan",
            "category": "Sides",
            "image": "https://www.lospolloshermanos.com/spice_curls.jpeg",
            "price": 4.95
        }
    }
}
Edit a Menu Item

Request:

PATCH /api/v1/restaurants/:restaurant_id/menu_items

Request Body:

{
    "name": "Spice Curls!!!",
    "description": "The curly fry with a southwestern kick!",
    "tags": "vegetarian, vegan",
    "category": "Sides",
    "image": "https://www.lospolloshermanos.com/spice_curls.jpeg",
    "price": 4.50
}

JSON Response Example:

{
    "data": {
        "id": "92",
        "type": "menu_item",
        "attributes": {
            "restaurant_id": 100,
            "name": "Spice Curls!!!",
            "description": "The curly fry with a southwestern kick!",
            "tags": "vegetarian, vegan",
            "category": "Sides",
            "image": "https://www.lospolloshermanos.com/spice_curls.jpeg",
            "price": 4.50
        }
    }
}
Delete a Menu Item

Request:

DELETE /api/v1/restaurants/:restaurant_id/menu_items/:menu_item_id

JSON Response Example:

{
    "message": "Menu item has successfully been deleted at this restaurant"
}

Project Team

Contributors

Emily Port
Gabe Nunez
Yuji Kosakowski

Project Manager

Heather Faerber

Advisor

Dara Rockwell

(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors