Nataliya Zhuravleva
Ryland Adams
Harrison Strand
Kevin Kirkley
Initiated January 25th, 2021
Released January 28th, 2021
Have you ever entered a game store only to be stopped in your tracks by the immense collection, having no idea where to start? Bord is for you. In this program, the client side UI calls upon the Bord API to return review information about games that other Bord users have played and subsequently reviewed. The goal of this program is to provide its users with relative information that will help them find the board game that meets their needs.
- C#/.NET
- API
- MySQL
- JavaScript
- Html/Css
- MySQL Workbench
- Postman
- VisualStudio Code
- Git
- GitHub
Sometimes random
gives an empty record (when query with at least two parameters). Works appropriately with ?random=true
only parameter.
- C# .NET Core Ver 2.2.0
- MySQL Ver 8.0.15 & MySQL Workbench
- Modern Web Broswer
- Postman (optional)
- Text Editor (e.g.VisualStudio Code)
- Download this .NET Core SDK (Software Development Kit) . Clicking this link will prompt a
.pkg file
download fromMicrosoft
. - Open the 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
. You should see something like this in response:2.2.105. This means both .NET and C# are successfully installed
.
Note on Windows Versions These Windows instructions assume you're using Windows 10. If you currently run Windows 7 or Windows 8, you may have a free upgrade available. If you are not running Windows 10 (and cannot or do not plan to upgrade), specific installation steps may differ.
- Download either the the 64-bit .NET Core SDK (Software Development Kit). 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:version numbers do not need to be the same: 2.2.105
This means .NET and C# are installed and your computer recognizes the dotnet command.
- Download the MySQL Community Server
.dmg file
from the MySQL Community Server page. Click thedownload
icon. Use theNo thanks, just start my download link.
- Follow along with the Installer until you reach the
Configuration
page. Once you've reachedConfiguration
, select or set the following options (use default if not specified):- Use
Legacy Password Encryption
. - Set password to
epicodus
. - Click
Finish
. - 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. - Type in source
~/.bash_profile
(or restart the terminal) in order to actually verify that MySQL was installed.
- Use
- 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
. - Download the MySQL Workbench
.dmg file
from the MySQL Workbench page. Use theNo thanks, just start my download link
. - Install
MySQL Workbench
to Applications folder. - Open
MySQL Workbench
and select theLocal instance 3306 server
. You will need to enter the passwordepicodus
. If it connects, you're all set.
- Download the
MySQL Web Installer
from the MySQL Downloads page. Use theNo thanks, just start my download link
. - _Follow along with the installer:
- Click
Yes
if prompted to update. - Accept license terms.
- Choose
Custom setup
type. - 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
)
- MySQL Server 8.0.19 (This will be under
- Select
Next
, thenExecute
. Wait for download and installation. (This can take a few minutes.) - 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
epicodus
. - Defaults are OK under Windows Service. Make sure that checkboxes are checked for the options
Configure MySQL Server as a Windows Service
andStart the MySQL Server at System Startup
. Under Run Windows Service as..., theStandard System Account
should be selected.
- High Availability set to
- Complete Installation process.
- Click
- Add the MySQL environment variable to the System PATH. You must include MySQL in the System Environment Path Variable. This is its own multi-step process:
- Open the Control Panel and visit System and
Security > System
. SelectChange Settings
and a pop-up window will display. Select the tabAdvanced
and select theEnvironment Variables
button. - Within the System Variables navigator window, select PATH..., click
Edit...
, and thenNew
. - 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.)
- Open the Control Panel and visit System and
- Verify installation by opening Windows PowerShell and entering the command
mysql -uroot -pepicodus
. You'll know it's working and connected if you gain access and see MySQL's command line. You can exit the mysql program by entering exit. - Open MySQL Workbench and select the
Local instance 3306 server
(it may have a different name). You will need to enter the passwordepicodus
. If it connects, you're all set.
Download and install Postman
from the Postman page.
- Navigate to the Bord.Solution repo at https://github.com/kevinkirkl3y/Bord.Solution to view the project files and commits.
- Click on the green button labeled
Code
to copy repository URL. - Clone the repository to your local machine by opening your machine terminal and using the command
git clone https://github.com/kevinkirkl3y/Bord.Solution
. - Navigate to the folder
/Bord.Solution/BordAPI
for Web API aspect of program. - Navigate to the folder
/Bord.Solution/BordClient
for the Client side UI aspect of the program.
- Navigate to my Bord.Solution repo at https://github.com/kevinkirkl3y/Bord.Solution to view the project files and commits.
- Click on the green button labeled
Code
to copy repository URL. - Clone the repository to your local machine by opening your machine terminal and using the command
git clone https://github.com/kevinkirkl3y/Bord.Solution
.
- Open in the
Bord.Solution/BordAPI/
directory the file namedappsettings.json
- Change the server, port, and user id as necessary. Replace
YourPassword
with relevant MySQL password (set at installation of MySQL).
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "Server=localhost;Port=3306;database=bord_api;uid=root;pwd=YourPassword;"
}
}
- Open in the
Bord.Solution/BordAPI/Properties
directory the file namedlaunchSettings.json
- Change the the localhosts as necessary. (Current Settings Below)
{
...
"BordAPI": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "api/values",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
...
}
- Open in the
Bord.Solution/BordClient/Properties
directory the file namedlaunchSettings.json
- Change the the localhosts as necessary. (Current Settings Below)
{
...
"BordAPI": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "api/values",
"applicationUrl": "https://localhost:5003;http://localhost:5004",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
...
}
- Navigate to the
/BordAPI
directory in your terminal. - Run the command
dotnet ef database update
which will use the mirgrations folder to create the MySQL Database using Entity Framework Core. - (OPTIONAL) If you need to make adjustments to the database, use the command
dotnet ef migrations add <NameOfNewMigration>
and then rundotnet ef database update
again to apply the changes.
- Navigate to the
Bord.Solution/BordClient/
folder in the command line. - Run the following command: $
dotnet restore
- Run the following command: $
dotnet build
- Run the following command to execute this compiled code: $
dotnet run
- Open browser to
http://localhost:5003/
to access the UI.
- Navigate to
Bord.Solution/BordAPI
directory using the Terminal (e.g. cd Desktop/Bord.Solution/BordAPI). - Run the following command: $
dotnet restore
- Run the following command: $
dotnet build
- Run the following command to execute this compiled code: $
dotnet run
Explore the API endpoints on in Postman. Base URL: https://localhost:5000
- GET /api/games
- POST /api/games
- GET /api/games/{id}
- PUT /api/games/{id}
- DELETE /api/games/{id}
http://localhost:5000/api/Games/2
You could query Games by these parameters:
- GameName
- MinPlayers
- MaxPlayer
To query Game by name: http://localhost:5000/api/games?gamename=scrabble
To query Game by minPlayers: http://localhost:5000/api/games?minplayers=2
To query Games by two parameters:http://localhost:5000/api/games?minplayers=2&&maxplayers=8
Games can also be queried at random or by a general search containing a fragment of the game name.
To get random Game: http://localhost:5000/api/games/?random=true
To search with fragment: http://localhost:5000/api/games?search=scr
The following is the result for a query of http://localhost:5000/api/games/11
[
{
"gameId": 11,
"gameName": "Chess",
"gamePrice": 14.99,
"minPlayers": 1,
"maxPlayers": 2,
"creators": "Unknown",
"minAge": 4,
"playTimeMin": 30,
"genres": [
{
"gameGenreId": 11,
"gameId": 11,
"genreId": 2,
"genre": {
"genreId": 2,
"genreName": "Strategy",
"games": []
}
}
],
"reviews": [
{
"reviewId": 2,
"title": "Oldie but goodie",
"experience": "Shouldn't have watched queens gambit",
"learningCurve": 8,
"suggestion": "Study the greats",
"gameId": 11
}
]
}
]
This software is licensed under the MIT license
Copyright (c) 2020 Nataliya Zhuravleva, Ryland Adams, Harrison Strand, Kevin Kirkley