DB
Our production database is set up on a different server than our production website server. This separation allows for a little bit of added protection from our own error. For example if someone were to accidently run rm -rf /
on the production server all that would be lost is a little bit of our time downloading the latest release back onto the server since our data is on a seperate server that we have no real reason to ever ssh into. The server is accessed by an SSL connection by the production server and is protected with a username and password that we keep secret in our config files. The URL of the database is also kept secret to prevent DDOS attacks or any other misuse of the server.
UML Diagram
Model Details
The database is set up in an intuitive manner where each model has its own relation and a single row represents a single instance of the model. Here is an in-depth description of each relation and attribute:
Food
Attribute | Properties | Description |
---|---|---|
id | integer, primary_key, unique | A unique id that represents each row |
name | string, not null | A human readable name of the food |
img | string | A URL to an image of the food |
servings | string | The number of servings for the food |
calorie | string | The number of calories in the food |
sodium | string | The amount of sodium in the food |
fat | string | The amount of fat in the food |
protein | string | The amount of protein in the food |
aisle | string | The aisle where the food is located |
aisle2 | string | The aisle where the food is located |
aisle3 | string | The aisle where the food is located |
Stores
Attribute | Properties | Description |
---|---|---|
id | integer, primary_key, unique | A unique id that represents each row |
gid | string, unique | The id that Google uses to identify the store |
name | string, not null | The human readable name of the store |
location | string, not null | The latitude and longitude of the store |
price_level | integer | Google's record of the relative price of the items in the store |
ratings | float | An average rating of the store from Google reviews |
phone | string | Phone number of the store |
pic_id | int | ID of the picture of the store |
lat | float | Lattitude of the store |
lng | float | Longitude of the store |
Gyms
Attribute | Properties | Description |
---|---|---|
id | integer, primary_key, unique | A unique id that represents each row |
gid | string, unique | The id that Google uses to identify the gym |
name | string, not null | The human readable name of the gym |
location | string, not null | The latitude and longitude of the store |
price | string | The price to access the gym. Often in different units like per week or per month |
ratings | float | The average rating of the store from Google reviews |
phone | string | Phone number of the gym |
pic_id | int | ID of the picture of the gym |
lat | float | Lattitude of the gym |
lng | float | Longitude of the gym |
Workouts
Attribute | Properties | Description |
---|---|---|
id | integer, primary_key, unique | A unique id that represents each row |
name | string, not null | A human readable name of the workout |
img | string | The URL that represents a picture of the workout |
link | string | A URL that links to an in depth description of the workout |
category | string | A human readable classification of the workout in relation to other workouts |
equipment | string | The equipment necessary to preform the exercise |
description | string | A human readable description of the workout |
muscle | string | The muscles that are targeted by this exercise |
met | float | A way to track the relative intensity of each workout |