PingPong is a web application that ranks ping pong players and is built with .Net Core, React and PostgreSQL.
-
Install Prerequisites:
a. Download and install the .Net Core SDK
b. Download and install Node.js
c. Download and install PostgreSQL
-
Clone this repo:
cd ping-pong
-
Prepare the database:
a. Ensure the design time service has the correct connection string (We'll need this to run migrations on the DB):
Open up
./PingPong.Data/PingPongDesignTimeContext.cs
and changeline 14
, setting theUsername
andPassword
attributes to authenticate with your PostgreSQL server:optionsBuilder.UseNpgsql("Host=localhost;Database=PingPong;Username=[Username];Password=[Password];");
b. Update the database by running the following 2 commands:
cd ./PingPong.Data
dotnet ef database update
c. Ensure the API has access to your database by updating the
Main
connection string in./PingPong.API/appsettings.Development.json
-
Start the API server by running the following commands:
cd ../PingPong.API
dotnet run
-
Start the web client by running:
cd ../PingPong.Web
npm install
npm start
Test cases can be run with the follwoing commands:
cd ./PingPong.Business.Tests
dotnet test