A MVC web application with user authentication, authorization, and many-to-many relationship. Authentication lets the a user be able to log in ang log out, authoriztion lets the only logged in user be able to access create, update, and delete functionality. Program have many-to-many relationship between Treat
and Flavor
s, so a treat can have many flavors, and vice versa.
Behavior(Spec) | Input | Output | |
---|---|---|---|
1 | Upon launching the application, user sees homepage | http://localhost:5000 | Splash Page |
2 | All users can read lists all treats and flavors that currently exist |
Click Flavors in the navigation bar |
Display a list of all treats |
3 | All users can click on an individual treat or flavor to see all the treats or flavors that belong to it | Click sweet |
Treats that belong to sweet flavor |
4 | Only logged in users can have create , update and delete functionality |
Click Add New Flavor |
Flavors |
- Download on Mac .NET Core SDK (Software Development Kit)
- Download on Windows 64-bit .NET Core SDK (Software Development Kit)
Follow the installation instructions below to installing MySQL Community Server and MySQL Workbench
- Download from the MySQL Community Server Page (Use the No thanks, just start my download link.)
- Download from the MySQL Workbench Page (Use the No thanks, just start my download link.)
- Configure ternminal by opening terminal and entering the command:
echo 'export PATH="/usr/local/mysql/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
- Verity MySQL installation
$ mysql -uroot -pYOURPASSWORD
- Download the MySQL Web Installer (Use the No thanks, just start my download link.)
- Add the MySQL environment variable to the System PATH.
- Open the Control Panel and visit System > Advanced System Settings > Environment Variables...
- Then select PATH..., click Edit..., then Add.
- Add the exact location of your MySQL installation, and click OK.
- Add the exact location of your MySQL installation, and click OK.
- Verity MySQL installation by opening terminal and entering the command:
$ mysql -uroot -pYOURPASSWORD
$ mysql -uroot -pYOURPASSWORD
mysql> CREATE DATABASE `jieun_kang`;
mysql> USE `jieun_kang`;
mysql> CREATE TABLE `Flavors` (
`FlavorId` int(11) NOT NULL AUTO_INCREMENT,
`FlavorName` longtext,
`UserId` varchar(255) DEFAULT NULL,
PRIMARY KEY (`FlavorId`),
KEY `IX_Flavors_UserId` (`UserId`),
CONSTRAINT `FK_Flavors_AspNetUsers_UserId` FOREIGN KEY (`UserId`) REFERENCES `aspnetusers` (`Id`) ON DELETE RESTRICT);
mysql> CREATE TABLE `Treats` (
`TreatId` int(11) NOT NULL AUTO_INCREMENT,
`TreatName` longtext,
`UserId` varchar(255) DEFAULT NULL,
PRIMARY KEY (`TreatId`),
KEY `IX_Treats_UserId` (`UserId`),
CONSTRAINT `FK_Treats_AspNetUsers_UserId` FOREIGN KEY (`UserId`) REFERENCES `aspnetusers` (`Id`) ON DELETE RESTRICT);
mysql> CREATE TABLE `TreatFlavors` (
`TreatFlavorId` int(11) NOT NULL AUTO_INCREMENT,
`TreatId` int(11) NOT NULL,
`FlavorId` int(11) NOT NULL,
PRIMARY KEY (`TreatFlavorId`),
KEY `IX_TreatFlavors_FlavorId` (`FlavorId`),
KEY `IX_TreatFlavors_TreatId` (`TreatId`),
CONSTRAINT `FK_TreatFlavors_Flavors_FlavorId` FOREIGN KEY (`FlavorId`) REFERENCES `flavors` (`FlavorId`) ON DELETE CASCADE,
CONSTRAINT `FK_TreatFlavors_Treats_TreatId` FOREIGN KEY (`TreatId`) REFERENCES `treats` (`TreatId`) ON DELETE CASCADE);
1. Launch MySQL Workbench and open the [Navigator] window.
2. In the [Navigator > Administration] window, select [Data Import/Restore].
3. In [Import Options] select [Import from Self-Contained File].
4. Under [Default Schema to be Imported To], select the [New] button. Enter the name of database "jieun_kang"
5. Click [Start Import].
- Clone this project
$ cd desktop
$ git clone https://github.com/jieunkang-101/SweetSavory.Solution
$ cd SweetSavory.Solution
- Add Dependencies for Entity Framework Core
$ cd SweetSavory
$ dotnet add package Microsoft.EntityFrameworkCore -v 2.2.0
$ dotnet add package Pomelo.EntityFrameworkCore.MySql -v 2.2.0
- Run this MVC application
$ dotnet restore
$ dotnet build
$ dotnet run
- Launch localhost http://localhost:5000
This webpage is licensed under the MIT license
Copyright (c) 2020 Jieun Kang