Skip to content

Ali-Ahmadii/Wild-Deer-Shop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wild Deer Shop

Backend:ASP.NET Core,MSS,Docker,Redis,ASP.NET Core WebAPIs,Swagger

dotnetcore Docker Redis MSS Swagger

Fron End:HTML,CSS,JS,Bootstrap

HTML CSS CSS BootStrap

Data Base And Models Of Projects Have Been Designed By DB First Approach

Packages In The Project

  • dotnet add package BCrypt.Net-Next
    dot net add packages Microsoft.EntityFrameworkCore
    dot net add packages Microsoft.EntityFrameworkCore.Design
    dot net add packages Microsoft.EntityFrameworkCore.Realtional
    dot net add packages Microsoft.EntityFrameworkCore.SqlServer
    dot net add packages Microsoft.EntityFrameworkCore.Tools
    dotnet add package Microsoft.Extensions.Caching.StackExchangeRedis
    dotnet add package Swashbuckle.AspNetCore
    

Connection To Database

For Connecting To Your Own SQL Server You Must Change appsetting.json file Connection String For Example

"ConnectionString": "Data Source=.;Initial Catalog=WildDeer;Integrated Security=True;Trust Server Certificate=True"
//Data Source = . if we are in localhost

And Also Add SQL Server Service To Program.cs file

builder.Services.AddEntityFrameworkSqlServer().AddDbContext<WildDeerContext>(config =>
{
    config.UseSqlServer("ConnectionString");
});

Caching With Redis

I Have Used Redis For Caching Approaches

After Installing StackExchangeRedis Package We Should Do Several Things In Program.cs File:

builder.Services.AddStackExchangeRedisCache(action => {
    var connection = "localhost:6379"; //remember this port number it will be needed later
    action.Configuration = connection;
});

Then We Will Use Docker For Our Approach
In CMD Or Package Manager Console If You Use Visual Studio Write This Command:

docker pull redis

Then

docker run -p 6379:6379 --name some-redis -d redis

6379 Is What We Determined In Program.cs File And some-redis Is Name Of Our Image, You Can Choose Whatever You Want

API Documentation With Swagger

For Using API You Must Login As Admin Or HR : Username = Ali & Password = Ali
BootStrap

Data Base

In WildDeerDB Foler Database Tables Are Represented In Scripts You Can Use This For Creating You Own Tables In MSS

Dockerize

In DockerFile I've Writed Needed Commands For Building Image
For Building Image You Should Write This Command In Application Directory

docker build -t <tagname> .

Now You Have Your Image On Docker And For Seeing This Write This Command

docker image ls

Now For Running Write This Command In Your Windows Or VPS That You've Got

docker run <tagname that you determinded before>