The goal of this project is to create a Ruby on Rails application using data collected from one or more data sources. This is a two part project.
The first part involves creating the required database tables and pulling data from various data sources. The second part involves using Ruby on Rails to create reports, allow searching, and/or display visualizations based on this data.
The data you use can be pulled from open datasets or public and private APIs. Fake data generated by the Faker gem can also be used, as can data that you scrape from web pages. You may also need to research how best to import data from JSON, XML and CSV sources.
This project is a registry on restaurants and their chefs. A collection of notary meals prepared at restaurants is also stored. There will be 3 tables: Chefs, Restaurants and Meals.
The names of the chefs will be generated from the faker gem.
The Chefs table will store name, age, and nationality of the chefs. This information is generated by the Faker gem. The Faker generators used is:
- Faker::Name.name
- Faker::Nation.nationality
- Faker::Number.between(from: 21, to: 65)
The Datatype of the fields in the Chef’s table are:
Column Name | Data Type | Description |
---|---|---|
ChefID | integer | Primary Key of the Chef record |
ChefName | string | Chef's Name |
ChefAge | integer | Age of Chef |
Nationality | string | The Chef's nationality |
RestaurantID | integer | Foreign Key referencing restaurant |
The Restaurant’s table will contain the restaurant’s name, cuisine, latitude and longitude data as well as head chef and chefs that work at the restaurant. The data for this table is retrieved from the DineSafe open data as well as Faker generator. According to the Toronto open data, “DineSafe is a Toronto Public Health’s food safety program that inspects all establishments serving and preparing food”. The cuisine field will be generated from the Faker::Food.ethinic_category.
The Datatype of the fields in the Restaurant’s table are:
Column Name | Data Type | Description |
---|---|---|
RestaurantID | integer | Restaurant Primary Key |
RestaurantName | string | Restaurant's Name |
LocationLatitude | string | Restaurant's Latitude |
LocationLongitude | string | Restaurant's Longitude |
Cuisine | string | Restaurant's style |
The Meal’s table will store the meal’s name and image. Additionally, it will stored a foreign key reference to the restaurant and chef tables to integrate the data from the various data sources. The meals information is retrieved from a free open API from “TheMealDB”.
The meal’s table will be structured:
Column Name | Data Type | Description |
---|---|---|
MealID | integer | Meal Primary Key |
MealName | string | Name Of Meal |
Image | string | URL of Meal image |
RestaurantID | integer | Restaurant Primary Key |