/RecipeBox

This is a c# application to house recipes

Primary LanguageC#

Recipe Box

Project Initiated: 2021-01-11
Updated: 2021-01-11

Project Description

User Stories: As a user, I want to add a recipe with ingredients and instructions, so I remember how to prepare my favorite dishes. As a user, I want to tag my recipes with different categories, so recipes are easier to find. A recipe can have many tags and a tag can have many recipes. As a user, I want to be able to update and delete tags, so I can have flexibility with how I categorize recipes. As a user, I want to edit my recipes, so I can make improvements or corrections to my recipes. As a user, I want to be able to delete recipes I don't like or use, so I don't have to see them as choices. As a user, I want to rate my recipes, so I know which ones are the best. As a user, I want to list my recipes by highest rated so I can see which ones I like the best. As a user, I want to see all recipes that use a certain ingredient, so I can more easily find recipes for the ingredients I have.

Required for Use

  • C# and .Net Core installed on your local machine. (Developed on .Net Core v2.2.4)
  • Console/Terminal access.
  • Code Editor like Visual Studio Code
  • MySQL Community Server
  • MySQL Workbench

Installation Instructions

Download .Net Core and follow the installation instructions for your computer's operating system.

Installing C#, .NET

Install C# and .Net according to your operating system below:

For Mac

  1. Download this .NET Core SDK Software Development Kit.
  2. Open the .pkg file. This will launch an installer which will walk you through installation steps. Use the default settings the installer suggests.
  3. Confirm the installation is successful by opening your terminal and running the command dotnet --version, which should return the correct version number.

For Windows (10+)

  1. Download either the the 64-bit .NET Core SDK Software Development Kit
  2. Open the file and follow the steps provided by the installer for your OS.
  3. Confirm the installation is successful by opening a new Windows PowerShell window and running the command dotnet --version You should see a response with the correct version number.

My SQL Installation Below

Windows 10 -

Start by downloading the MySQL Web Installer from the MySQL Downloads page. (Use the No thanks, just start my download link.)

Follow along with the installer:

  1. Click "Yes" if prompted to update.
  2. Accept license terms.
  3. Choose Custom setup type.
  4. When prompted to Select Products and Features, choose the following:
  • MySQL Server 8.0.19 (This will be under "MySQL Servers > MySQL Server > MySQL Server 8.0")

  • MySQL Workbench 8.0.19 (This will be under "Applications > MySQL Workbench > MySQL Workbench 8.0")

  1. Select "Next", then "Execute". Wait for download and installation. (This can take a few minutes.)

  2. Advance through Configuration as follows:

  • High Availability set to "Standalone".

  • "Defaults are OK" under Type and Networking.

  • Authentication Method set to Use Legacy Authentication Method.

  • Set password to something you will remember.

  • Defaults are OK under Windows Service. Make sure that checkboxes are checked for the options "Configure MySQL Server as a Windows Service" and "Start the MySQL Server at System Startup". Under Run Windows Service as..., the "Standard System Account" should be selected.

  1. Complete Installation process. Next, add the MySQL environment variable to the System PATH. We must include MySQL in the System Environment Path Variable. This is its own multi-step process:

  2. Open the Control Panel and visit System and "Security > System". Select "Change Settings" and a pop-up window will display. Select the tab "Advanced" and select the "Environment Variables" button.

  3. Within the System Variables navigator window, select PATH..., click Edit..., and then New.

  4. Add the exact location of your MySQL installation, and click OK. (This location is likely C:\Program Files\MySQL\MySQL Server 8.0\bin, but may differ depending on your specific installation.)

MacOS -

Start by downloading the MySQL Community Server .dmg file from the MySQL Community Server page. Click the download icon. Use the No thanks, just start my download link.

Next, follow along with the Installer until you reach the Configuration page. Once you've reached Configuration, select or set the following options (use default if not specified):

  1. Use Legacy Password Encryption.

  2. Set password to something you will remember.

  3. Click Finish.

  4. Open the terminal and enter the command echo 'export PATH="/usr/local/mysql/bin:$PATH"' >> ~/.bash_profile. This will save this path in .bash_profile, which is where our terminal is configured.

  5. Type in source ~/.bash_profile (or restart the terminal) in order to actually verify that MySQL was installed.

Next, verify MySQL installation by opening terminal and entering the command mysql -uroot -pepicodus. You'll know it's working and connected if you gain access and see the MySQL command line. If it's not working, you'll likely get a -bash: mysql: command not found error.

You can exit the mysql program by entering exit.

Next, download the MySQL Workbench .dmg file from the MySQL Workbench page. (Use the No thanks, just start my download link.)

Install MySQL Workbench to Applications folder.

Then open MySQL Workbench and select the Local instance 3306 server. You will need to enter the password you set. (We used epicodus.) If it connects, you're all set.

Install/Setup Project

Option 1 (download zip file)

  1. Copy and paste the following GitHub project link into your web browser's url bar and hit enter/return.
  2. Download a .zip copy the repository by clicking on the large green "Code" button near the upper right corner of the screen.
  3. Right click the .zip file and extract(unzip) it's contents.
  4. Open your computer's terminal/console, and navigate to folder called "Recipe.Solution".

Option 2 (via git console/terminal)

  1. Open your Git enabled terminal/console and navigate to a directory that you wish to download this project to.

  2. Type the following line of code into your terminal/console to automatically download the project to your current direcory and hit return/enter

    git clone

  3. Once the project has finished downloading, use the terminal/console to navigate to the "Template.Solution" folder of the project.

Setup Database Connection

Create a new file in the root directory of the Recipe.Solution/Recipe directory named "appsettings.json". Copy and past the following code inside of the file.

{
  "ConnectionStrings": {
      "DefaultConnection": "Server=localhost;Port=3306;database=recipe;uid=YourId;pwd=YourPassword;"
  }
}

Replace "YourId" and "YourPassword" in the code above with the user id and user password you use for logging into MySQL Workbench. Save the "appsettings.json" file.

Type the following code and hit enter/return to install the necessary dependencies.

dotnet restore

Once the dependencies have installed, type the following commands into your console, hitting enter/return after each.

dotnet ef migrations add Initial

dotnet ef database update

You can now type the follow code to launch the program...

dotnet run

The program should launch using your default web browser at URL: localhost:5000.

SQL Schema

REPLACE WITH YOUR PROJECT DATABASE

1 - In SQL Workbench 2 - On the top nav bar click the server drop down 3 - Select Data export 4 - Select your Scema in the table 5 - Select Dump Structure only from dropdown 6 - Select Export to self contain file radio button 7 - Rename the file First_Last_project.SQL 8 - Select Include Create Scema check box 9 - Start Export 10 - Open the Dump 11 - Remove all "--" "/*" content 12 - Add USE ProjectName; to the top of the file 13 - Then delete these instuctions!


Known Bugs

There are no known bugs

Technology Used

  • C# 7.3
  • .NET Core 2.2
  • Entity
  • Git
  • MySQL
  • CSS
  • HMTL
  • Bootstrap
  • Razor
  • dotnet script, REPL

Authors and Contributors

Authored by: Svea & Garrett

Contact

Svea Wade svealinneawade@gmail.com Garrett Dean Brown gman9mm@live.com"

License

GPLv3

Copyright © 2020 Garrett & Svea