Cougar Craves is a simple Node.js program targeted at BYU students that will generate either a place to eat or a random meal recipe, based on their preference of eating out or in. The program can also store the student's dining preferences, along with the time stamps, that they can retrieve again later or even delete.
This program utilizes three APIs:
- PersonsAPI (requires an access token)
- MobileDiningServices API (requires an access token)
- TheMealDB API (does not require an access token)
Before you start, you will need to subscribe to these two APIs in the WSO2 store and get a valid access token.
This program requires connection to the AWS TRN, Oracle DB as well as VPN. Make sure that you are in AWS us-west-2 (Oregon) then copy and paste the PowerShell code to your terminal. Also, turn on the GlobalProtect VPN in order to be able to perform database functions within this program.
On your terminal, run these lines of code separately. It will clone this repository, switch your current directory to the program's, and install NPM packages.
git clone https://github.com/byu-oit/tania-technical-challenge.git
cd tania-technical-challenge
npm install
Still on your terminal, type node index
.
Congratulations, you have successfully run the program! Now, let's see how to navigate around and what functionalities it has.
When you first run node index
, you will be prompted to type in an API token. Copy and paste it directly from the WSO2 API Manager. After that, you will be asked to type in your BYU ID.
Once the program validates both your API token, VPN connection, and BYU ID, it will greet you and display the main menu.
Now, you can either choose whether to log a dining idea, view your old records, or exit the program.
If you choose get dining ideas, you will be asked if you want to eat in or eat out today.
If you choose to eat in, you will be given a random recipe from TheMealDB API.
If you choose to eat out, you will be given a random place to eat around campus from Mobile Dining Services API.
You can also save these ideas to the database for future references. But if you do not wish to save them, you can just say No and you will be asked either to go back to main menu or exit the program.
If you choose to view your old records, the program will display a table with all the records we have of you in the database. On the other hand, if you have never saved any records before, it will simply tell you that we can't find any records in the database.
You can view/delete a specific record, delete all records, or go back to main menu. If you choose to view/delete a specific record, the program will give you a list of choice IDs to choose from.
If you choose to delete all records, you will be given a warning.
Once you are satisfied with playing around the program, you can go back to main menu and exit.