Ultrix is a meme website for collecting memes and sharing them with friends on the website.
For this project the MoSCoW method was used, this can be found in the Projects tab on this repository.
Use these instructions to get the project up and running.
You will need the following tools:
- Visual Studio 2017 or 2019 (with the ASP.NET Core module)
- .NET Core SDK 2.2
- SQLServer 2017
Follow these steps to get your development environment set up:
- Clone the repository.
- Open PowerShell, connect to your local sqlserver and create a new database:
SQLCMD.EXE -S "(LocalDb)\MSSQLLocalDB" -E CREATE DATABASE UltrixDb GO
- Create an
appsettings.json
file at the root of the Presentation layer with the connectionstring to the new database:{ "Logging": { "LogLevel": { "Default": "Warning" } }, "AllowedHosts": "*", "ConnectionStrings": { "ApplicationDatabase": "Server=(LocalDb)\\MSSQLLocalDB;Database=UltrixDb;", "InMemoryDatabase": "InMemoryDatabase" } }
- Next, go to
Tools > NuGet Package Manager > Package Manager Console
in visual studio, To restore all dependencies:Followed by:dotnet restore
To make sure all dependencies were added succesfully, it should build without dependency warnings else you have probably not installed .NET core 2.2 SDK.dotnet build
- Next, to add the code first database to your new database (make sure the default project is Ultrix.Persistance):
Finally, update the database:
Add-Migration InitialCreate
TheUpdate-Database
Add-Migration
command scaffolds a migration to create the initial set of tables for the entities in the Persistance layer. TheUpdate-Database
command creates the database and applies the new migration to it. - Next, build the solution either by selecting it in the
Build > Build solution
in visual studio or hittingCTRL + SHIFT + B
or if you are still in the package manager console by typingdotnet build
. - Once the build has run succesfully, start the website to confirm that the database connection is succesfull either by hitting
F5
or go toDebug > Start
. - Launch http://localhost:60216/ in your browser to view the website.
- For the time being the you need to manually insert a
CredentialType
for authentication. Run this query (in PowerShell):USE UltrixDb GO INSERT INTO [dbo].[CredentialTypes] ([Code], [Name], [Position]) VALUES ('Email', 'Email', 1) GO
- Now users are able to register and login, have fun!
NOTE: For the tests each method will create its own database with a random GUID and delete itself after completion of the test. This is done so that it can run in parallel and each test does not depend on anything. Because InMemoryDatabase is not yet a relational-database provider some tests will use the repository instead of the service to make the tests work as intended.
Explanation coming soon..
PRs accepted.