Application made for Epicodus to demonstrate understanding of many-to-many relationships in MySQL using ASP.net core and mvc with entity framework
ABOUT
This Machine repair app is designed to help Dr. Sneuss keep track of his engineers and machine repairs. This app utilizes razor, c#, asp.net core, mvc with entity framework using the CRUD naming convention.
- Install Git v2.62.2+
- Install .NET version 3.1 SDK v2.2+
- Install Visual Studio Code
- Install MySql Workbench
copy this url to clone this project to your local system:
https://github.com/jhenager/DrSneuss.Solution.git
Once copied, select "Clone Repository" from within VSCode & paste the copied link.
With the project open to the root directory, navigate to the production directory with the following command in your terminal.
cd DrSneuss
Then, install the necessary packages with the following command
dotnet restore
Finally, you can start the program with this command.
dotnet run
Next we will need to setup our MySql database for the application to work.
One method is to directly import the 'james_henager.sql' file included in the repo to MySQL workbench.
The other option is to open MySql Workbench and select "Create a new Sql Tab for Executing Queries" at the very top left of the page. Then paste this information onto the page:
CREATE DATABASE `james_henager` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */;
USE DATABASE `james_henager`
CREATE TABLE `Engineers` (
`EngineerId` int(11) NOT NULL AUTO_INCREMENT,
`EngineerName` longtext,
PRIMARY KEY (`EngineerId`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `MachineEngineer` (
`MachineEngineerId` int(11) NOT NULL AUTO_INCREMENT,
`MachineId` int(11) NOT NULL,
`EngineerId` int(11) NOT NULL,
PRIMARY KEY (`MachineEngineerId`),
KEY `IX_MachineEngineer_EngineerId` (`EngineerId`),
KEY `IX_MachineEngineer_MachineId` (`MachineId`),
CONSTRAINT `FK_MachineEngineer_Engineers_EngineerId` FOREIGN KEY (`EngineerId`) REFERENCES `engineers` (`EngineerId`) ON DELETE CASCADE,
CONSTRAINT `FK_MachineEngineer_Machines_MachineId` FOREIGN KEY (`MachineId`) REFERENCES `machines` (`MachineId`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `Machines` (
`MachineId` int(11) NOT NULL AUTO_INCREMENT,
`MachineName` longtext,
`Date` datetime(6) NOT NULL DEFAULT '0001-01-01 00:00:00.000000',
`MachineError` longtext,
PRIMARY KEY (`MachineId`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
by default these are set to user:root and an empty password. if you are unsure, refer to the settings for your MySqlWorkbench.
touch .gitignore
ni .gitignore
DO NOT PROCEED UNTIL YOU DO!
node_modules/
.DS_store
dist/
appsettings.json
bin/
obj/
git add .gitignore
git commit -m "protect data"
Questions, comments and concerns can be directed to James Henager (jameschenager@gmail.com)
Written in: Visual Studio Code
Database Mgmt: MySql Workbench