Two-day Homework Practice Assignment during Epicodus Coding School, ASP.NET Core MVC Many-to-Many Relationships, 1.7.2021
This web application is for a Doctor Clinic to keep track of students & courses with the following functions:
- Keeps track of all patients and doctors at a Clinic.
- C# v 7.3
- .NET Core v 2.2
- MySQL, MySQL Workbench
- Entity Framework Core, CRUD, RESTful routing
- dotnet script, REPL
- ASP.NET MVC Core
- Razor
- Visual Code Studio
- Access Terminal in your Finder, and open a new window. Install the package manager, (Homebrew) [https://brew.sh/], on your device by entering this line of code in Terminal:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
. - Ensure Homebrew packages are run with this line of code:
echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile
. - Once homebrew is installed, install Git, a version control system for code writers, with this line of code
brew install git
.
- Open a new Command Prompt window by typing "Cmd" in your computer's search bar.
- Determine whether you have 32-bit or 64-bit Windows by following these (instructions)[https://support.microsoft.com/en-us/help/13443/windows-which-version-am-i-running].
- Go to (Git Bash)[https://gitforwindows.org/], click on the "Download" button, and download the corresponding exe file from the Git for Windows site._
- Follow the instructions in the set up menu.
- Once you have Git installed on your computer, go to this (GitHub repository)[https://github.com/ebezjian/Clinic.Solution], click the "Fork" button in the upper right hand corner of the page, and clone this application with the following command:
git clone https://github.com/ebezjian/Clinic.Solution.git
.
- Install C# and .Net according to your operating system below.
- Download this .NET Core SDK (Software Development Kit)[https://dotnet.microsoft.com/download/thank-you/dotnet-sdk-2.2.106-macos-x64-installer]. Clicking this link will prompt a .pkg file download from Microsoft.
- Open the .pkg file. This will launch an installer which will walk you through installation steps. Use the default settings the installer suggests.
- Confirm the installation is successful by opening your terminal and running the command $ dotnet --version, which should return something like:
2.2.105
.
- Download either the the 64-bit .NET Core SDK (Software Development Kit)[https://dotnet.microsoft.com/download/thank-you/dotnet-sdk-2.2.203-windows-x64-installer]. Clicking these links will prompt a .exe file download from Microsoft.
- Open the file and follow the steps provided by the installer for your OS.
- Confirm the installation is successful by opening a new Windows PowerShell window and running the command dotnet --version. You should see something a response like this:
2.2.105
.
- Install dotnet script with the following terminal command
dotnet tool install -g dotnet-script
.
- Download MySQL Server.
- Download MySQL Workbench.
- (For more detailed instructions if either of the above technologies are unfamiliar to you, visit this site).
- Run
dotnet build
when the project is on your local machine. - Run
dotnet ef migrations add Initial
--> If there is an error stating "Unable to resolve project", this means the command wasn't run in the correct directory. - Entity creates three files in the Migrations directory.
- Run the following command:
dotnet ef database update
.
Once the project has been cloned to your computer and you have all the necessary items on your local computer, open the project in the application of your choice.
Create a file in the root directory of the project called "appsettings.json". Add the following snippet of code to the appsettings.json file:
{
"ConnectionStrings": {
"DefaultConnection": "Server=localhost;Port=3306;database=clinic;uid=root;pwd=YOUR-PASSWORD-HERE;"
}
}
Where you see "YOUR-PASSWORD-HERE" is where you put the password you created for your MySQL server. Your server name and port might vary depending on your local system. Check MySQL Workbench Connections to determine if the local host and port number match and adjust as needed.
-
Navigate to the project folder on your Terminal or CMD.
-
dotnet build
will get bin/ and obj/ folders downloaded. -
dotnet restore
to install packages listed in project's boilerplate. -
dotnet run
will run the application.
No known bugs as of now.
MIT Copyright (c) 2021 Kaila Sprague McRae, Shannon Grantski, Ellie Lambert