Setting up the infrastructure

This is a guide on setting up and running the completed project from the course entitled Learn to build an e-commerce app with .Net Core and Angular, which will be a requirement should you wish to participate in any of its related tutorials which enhance the project in some way from the course itself.

There are some things you will need installed on your computer here to follow along:

  1. The .Net SDK.
  2. NodeJS
  3. Angular CLI
  4. Docker
  5. Git
  6. mkcert

If you are missing any of this software please click the links above to download and install to your computer.

First, create a new directory on your computer and then clone the repo fromĀ here.

Run the following command inside an empty user folder on your computer:

1git clone https://github.com/TryCatchLearn/skinet-2024

Change into the new directory and create a new branch for this:

1cd Skinet-2024
2git checkout -b inventory

Restore the packages for the .Net project

1dotnet restore

Also, restore the packages for the client project

1cd client
2npm install

Open up the project in your IDE or Code editor.

To run the project you will need to have docker available and running as this app uses Sql Server and Redis, and we will run these services through docker. Please stop any other running instances of Sql Server running on your machine as this uses the default port 1433 and start the services by running the following command:

1# cd back up into the solution directory
2cd ..
3# start the Sql Server and redis instance
4docker compose up -d

We also run this app over https so we need a trusted certificate to run this app. The easiest way to do this is to use a tool called mkcert. Follow the instructions to install this onto your computer from here and then once it is installed run the following command:

1mkcert -install

Then once this is available you can create the certificate. Change directory into the ssl directory in order to overwrite the existing certificate with one that will be trusted by your computer:

1 cd client/ssl

Then run:

1mkcert localhost

You can then run both the .Net project and the client project (use 2 separate terminal windows for this):

1# CD into the API folder
2dotnet watch
3
4# CD into the client folder
5ng serve

You should now be able to browse to the store home page on https://localhost:4200

This will have some functionality but you will not be able to checkout and create an order yet as we also need to set up Stripe for this which we will look at in the next lesson.