Hey You Message Board

Hey You Message Board, 01-19-2021

By Agata Kolodziej & Harrison Strand

Description

TODO Client Project Many-to-many, many messages belong to many groups and many groups belong to many messages. Model: Message

  • MessageTitle
  • MessageBody
  • Author
  • MessageDate

Model: Group

  • GroupName
  • GroupDescription

Join Model: GroupMessage Strech goal: Tags, Authentication

User Stories

Expand
ID User Story Accepted
US01 "As a user, I want to be able to GET all messages related to a specific group." True
US02 "As a user, I want to be able to POST messages to a specific group." True
US03 "As a user, I want to be able to see a list of all groups." True
US04 "As a user, I want to input date parameters and retrieve only messages posted during that timeframe." True
US05 "As a user, I want to be able to PUT and DELETE messages, but only if I wrote them." True

Setup/Installation Requirements

Software Requirements
  1. Internet browser
  2. A code editor such as VSCode to view and edit the code
  3. .NET or follow along with the Installing .NET instructions to install .NET
Open Locally
  • Click on the link to my repository: My Repository
  • Click on the green "Code" button and copy the repository URL
  • Open your terminal and use the command git clone into the directory you would like to clone the repository
  • Open in text editor to view code and make changes
Installing .NET

In order to run the application, please install .NET for your computer to recognize the dotnet command.

  1. Download .NET Core SDK (Software Development Kit). Clicking this link will prompt a file download for your particular OS from Microsoft.
  2. Open the file. Follow the installation steps.
  3. Confirm the installation is successful by opening your terminal and running the command dotnet --version. The response should be something similar to this:2.2.105. This means it was successfully installed.
Installing MySQL

MySQL is a type of database software used to create, edit, query, and manage SQL data.

  • For Mac Users please Click Here to download MySQL Installer

  • For Windows Users please Click Here

  • Verify MySQL installation by opening the terminal and entering the command mysql -uroot -p[THEPASSWORDYOUSELECTED]

  • If you gain access you will see see the MYSQL command line!

Installing MySQL Workbench
  • Please Click Here to install the correct version for your machine
  • Open MySQL Workbench and select Local instance 3306 server. You will need to enter the password you selected
Compiling
  • Navigate to the Inventory folder in the command line
  • Use the command dotnet build to compile
Installing Packages
  • Navigate to the Inventory folder in the command line
  • Use the command dotnet restore
Expand for Database Installation Essentials!

Database Connection

Create a connection string to connect the database to the web application

  1. Create a file in the root directory called appsettings.json
  2. Add the code below:
{
    "ConnectionStrings": {
        "DefaultConnection": "Server=localhost;Port=3306;database=hey_you;uid=root;pwd=YourPassword;"
    }
}
  • Put in your MySQL password in pwd=YourPassword. Change the server, port, and uid if necessary.

Import Database Using Entity Framework Core

  1. Navigate to Inventory directory in terminal
  2. Use the command dotnet ef database update to generate the database through Entity Framework Core

Update Database Using Entity Framework Core

  1. Write any new code you wish to add to the database. Use the command dotnet build to check for any compiling errors. If no errors, proceed to step 2.
  2. To update the database with any changes made to the code, use the command dotnet ef migrations add [MigrationsName]
  3. Use the command dotnet ef database update to update the database

Update Database Using MySQL Workbench

  1. Open MySQL Workbench
  2. Click on Server > Data Import in the top navigation bar
  3. Select Import from Self-Contained File
  4. Select the Default Target Schema or create new schema
  5. Select all Schema Objects you would like to import
  6. Select Dump Structure and Data
  7. Click Start Import
View In Browser
  • To view in browser, navigate to Inventory folder in the command line
  • Use the command dotnet run to execute the compiled code and start a localhost
  • In browser navigate to http://localhost:5000

Known Bugs

Fix referencing loop: .AddJsonOptions(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);

Versioning make sure controller name and routes match Swashbuckle: change access modifier in groups controller line 24 from public to protected

Support and Contact Details

If any errors or bugs occur with installation, delete both bin and obj folders and follow the Compiling and Installing Packages instructions again. Get help or report a bug you have found in the .NET platform at .NET Support. Or please email me, agatakolohe@gmail.com.

Technologies Used

  • .NET Core 2.2.0
  • ASP.NET Core MVC
  • ASP.NET Core Razor Pages
  • Bootstrap
  • C# 7.3
  • CSS
  • Entity Framework Core
  • GitHub
  • HTML
  • MySQL
  • MySQL Workbench
  • Postman
  • Swagger/Open API
  • Swashbuckle
  • Unsplash
  • Versioning API
  • VS Code

License

This software is licensed under the MIT License.

Copyright (c) 2021 Agata Kolodziej & Harrison Strand