Giter Club home page Giter Club logo

factory.solution's Introduction

Dr. Sillystringz's Factory ๐Ÿญ

Friday Project for Week 4 of C# || Many-to-Many relationships 1/8/2020

by Taylor Delph

Description

You've been contracted by the factory of the famous Dr. Sillystringz to build an application to keep track of their machine repairs. You are to build an MVC web application to manage their engineers, and the machines they are licensed to fix. The factory manager should be able to add a list of engineers, a list of machines, and specify which engineers are licensed to repair which machines. There should be a many-to-many relationship between Engineers and Machines. An engineer can be licensed to repair (belong to) many machines (such as the Dreamweaver, the Bubblewrappinator, and the Laughbox) and a machine can have many engineers licensed to repair it.

Splash Page

๐Ÿ’ป Software Requirements

  • A code editor like VSCode

  • With .NET Core 2.2 installed

  • MySQL

    • Click the 'No thanks, just start my download' link.
    • Follow along with the installer until you reach the Configuration page. Then select the following options:
    • Use Legacy Password Encryption.
    • Set password to epicodus and then click Finish.
    • Open the terminal and enter the command echo 'export PATH="/usr/local/mysql//bin:$PATH"'>>~/.bash_profile
    • Type source ~/.bash_profile in the terminal to verify that MySQL was installed.
    • Enter mysql -uroot -pepicodus or mysql -uroot -p{your_password} in the terminal to verify the installation. You will know it's installed when you gain access to the mysql> command line.
  • MySQL Workbench

    • Select the 'No thanks, just start my download' link.
    • Install MySQL Workbench in the Applications folder.
    • Open MySQL Workbench and select the Local instance 3306 server. You will need to enter the password epicodus (or the password you set).

๐Ÿ—๏ธ Setup and Use via cloning

  • Open your terminal and ensure you are within the directory you'd like the file to be created in.
  • Enter the following command $ git clone https://github.com/taylulz/Factory.git
  • Once cloned, use the $ cd Factory.Solution/Factory command to navigate to the root directory.
  • Enter $ dotnet restore

AppSettings.Json

  • Create a file in Factory/Factory folder named appsettings.json
  • Copy and paste the following snippet to the file (if you used your own password, replace 'epicodus' with the one you've set)
{
  "ConnectionStrings": {
      "DefaultConnection": "Server=localhost;Port=3306;database=taylor_delph;uid=root;pwd=epicodus;"
  }
}

Import Database with Entity Framework Core

  • Now enter $ dotnet ef database update to create database in MySQL.
  • To run the application, enter $ dotnet run
  • Your command line will open a server (likely http://localhost:5000/). Navigate to this URL in your browser to view the project.

Import Database with SQL Schema

  • Copy and paste the following Schema Create Statement in MySQL Workbench to create this database with it's respective tables.
CREATE DATABASE `taylor_delph` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */;
USE taylor_delph;

DROP TABLE IF EXISTS `__EFMigrationsHistory`;
CREATE TABLE `__EFMigrationsHistory` (
  `MigrationId` varchar(95) NOT NULL,
  `ProductVersion` varchar(32) NOT NULL,
  PRIMARY KEY (`MigrationId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

DROP TABLE IF EXISTS `Engineers`;
CREATE TABLE `Engineers` (
  `EngineerId` int(11) NOT NULL AUTO_INCREMENT,
  `EngineerName` longtext,
  PRIMARY KEY (`EngineerId`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

DROP TABLE IF EXISTS `Licenses`;
CREATE TABLE `Licenses` (
  `LicensesId` int(11) NOT NULL AUTO_INCREMENT,
  `EngineerId` int(11) NOT NULL,
  `MachineId` int(11) NOT NULL,
  PRIMARY KEY (`LicensesId`),
  KEY `IX_Licenses_EngineerId` (`EngineerId`),
  KEY `IX_Licenses_MachineId` (`MachineId`),
  CONSTRAINT `FK_Licenses_Engineers_EngineerId` FOREIGN KEY (`EngineerId`) REFERENCES `engineers` (`EngineerId`) ON DELETE CASCADE,
  CONSTRAINT `FK_Licenses_Machines_MachineId` FOREIGN KEY (`MachineId`) REFERENCES `machines` (`MachineId`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

DROP TABLE IF EXISTS `Machines`;
CREATE TABLE `Machines` (
  `MachineId` int(11) NOT NULL AUTO_INCREMENT,
  `MachineName` longtext,
  PRIMARY KEY (`MachineId`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

Licenses Table joining EngineerId with MachineId

๐Ÿ› ๏ธ Technologies Used

  • GitBash
  • Visual Studio Code
  • GitHub
  • C# v 7.3
  • .NET Core v 2.2
  • MSTest
  • ASP.NET Core MVC
  • Bootstrap
  • CSS
  • cshtml
  • MySQL Workbench
  • Entity Framework Core
  • SQL Designer

๐Ÿž Known Bugs

No known bugs at this time

๐Ÿ“ซ Contact details

If you run into any problems with the site, or need to get in touch with Dr. Sillystringz, please email her here

๐Ÿ“— License

MIT License.

factory.solution's People

Contributors

jd-fj avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.