Skip to content

A simple store created in my new module of ASP .NET Core Course

Notifications You must be signed in to change notification settings

Eschechola/StorEsc

Repository files navigation

StorEsc


A full e-commerce api built in "Construindo um ecommerce com .NET + Azure 2023" course by Lucas Eschechola!

You can contact me here!
Or send an email to lucas.eschechola@outlook.com


How to run


  1. Clone the repository

    $ git clone https://github.com/Eschechola/StorEsc.git
    $ cd StorEsc
    $ dotnet clean
    $ dotnet restore



  1. Create custom database image OR use compose

    $ cd environment/database
    $ docker build -t sqlserver_storesc .
    $ docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=<YOUR_PASSWORD>" -p 1433:1433 -d sqlserver_storesc

    OR


    $ docker-compose up --build



  1. Add environment variables

    3.1 SQL Server

    $ dotnet user-secrets set "Databases:ConnectionStrings:SqlServer" "Server=127.0.0.1;User Id=sa;Password=<YOUR_PASSWORD>;Database=StorEsc;TrustServerCertificate=True" --project src/StorEsc.Api/StorEsc.Api.csproj


    3.2 JWT (8 characters)

    $ dotnet user-secrets set "Token:SecretKey" "<YOUR_SECRET_KEY>" --project src/StorEsc.Api/StorEsc.Api.csproj


    3.3 Argon2Id Salt (16 characters)

    $ dotnet user-secrets set "Hash:Argon2Id:Salt" "<YOUR_SALT>" --project src/StorEsc.Api/StorEsc.Api.csproj



  1. Run migrations to create database

    $ dotnet ef database update --connection "Server=127.0.0.1;User Id=sa;Password=<YOUR_PASSWORD>;Database=StorEsc;TrustServerCertificate=True" --context StorEscContext --project src/StorEsc.Infrastructure/StorEsc.Infrastructure.csproj



  1. Run the project!

    $ dotnet run



  1. Util Commands - Create Local Migration

    $ dotnet ef migrations add InitialMigration --project src/StorEsc.Infrastructure/StorEsc.Infrastructure.csproj



  1. Util Commands - Apply Local Migration

    $ dotnet ef database update --connection "Server=127.0.0.1;Database=StorEsc;User Id=<YOUR_USER>;Password=<YOUR_PASSWORD>;TrustServerCertificate=True" --context StorEscContext --project src/StorEsc.Infrastructure/StorEsc.Infrastructure.csproj



2023

About

A simple store created in my new module of ASP .NET Core Course

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages