GitHub - SheynD/RecipeGenius: A cool project.

This project is the implementation of a knowledge database for a topic that is very near and dear to all our hearts (and stomachs): food. That's right, food; the lifesource of humanity. It is thus envisioned to be a place where people can share their own unique or culturally/regionally different ways of creating their favorite foods with the rest of humanity. We have started it off by scraping from the Food Network website recipe database a wide variety of world foods and their recipes. Thus, we already have a pre-populated database of many foods ready so that users are not stuck with creating endless amounts of recipes or waiting for others to do so in order to get the most from this app.

The main components of this project are Django for the backend/middle-end, a MongoDB database to store the recipes (in JSON format, of course), and some flavor of JavaScript for the frontend (most likely Angular). For now, the codebase and all other materials will be stored on Amazon Web Services (AWS) instances. One instance contains the Django code and one is for the MongoDB database (the frontend will likely be on the same instance as the Django code).

In order to run the project, perform the following steps:

  1. Turn on the AWS instances from the EC2 dashboard.
  2. Open Terminal.
  3. Login into the AWS instance(s) using the following command ssh -i <locationofKeyPairFile>/myKeyPair.pem ubuntu@<publicIPaddress>. The 'locationofKeyPairFile' is the location of the key pair file in your computer and the 'publicIPaddress' field is contained in the information page of the EC2 instance. For instance, if my key pair file is in my Documents directory on a Mac (or any flavor of Linux) and the public IP is 34.24.567.89, then the command I would run is ssh -i ./Documents/myKeyPair.pem ubuntu@34.24.567.89. I would recommend first logging into the MongoDB instance.
  4. Once you have logged into the MongoDB instance, start the database by running sudo service mongodb start. It should then not return a message and if it did not, then we're in good shape. When finished with running/working on the project, I suggest turning off the database by doing sudo service mongodb stop.
  5. Next, log on to the Django instance. Django is a framework that focuses on linking dynamic webpages using urls, views, and template models and then filling those models with specific data. The views then decide how the data should be displayed on the page using what we have given it. The core of Django is a Python server that runs behind the scenes and makes sure that everything is well connected (including the MongoDB that we are using).
  6. In order to run what we have so far, navigate to the same directory in which we have the manage.py file, which in our case is inside the top level foodnetwork directory. Now, run the command python manage.py runserver 0.0.0.0:8000. This will run the Python server for our Django application.
  7. On your browser of choice, navigate to the IP address of the AWS instance with port 8000 open for receiving. Again, if the public IP of our instance is 34.24.567.89, we would type http://34.24.567.89:8000 into the address bar of the browser. This will then make a GET request to our server and we will see the home page of our application open up before our eyes.

TODO

  1. Frontend and better display. Django probably won't be sufficient.
  2. Efficiently parse the JSON items from the database.