Skip to content

Fernando-Medeiros/ECommerce-ASP-NET-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASP.NET - REST API

name version optional
Docker Desktop ^4
Docker Compose ^2
Microsoft.NETCore.App ^7
Microsoft.AspNetCore.App ^7
Dotnet EF ^7
VSCode extensions 1.8^ x

# Bash or Git Bash
find ./.scripts -type f -name "*.sh" -exec chmod +x {} \;
dotnet tool install --global dotnet-ef

Authentication

  • JWT Token [ Bearer ]
  • JWT Token Scope [ Access, Refresh, RecoverPassword, AuthenticateEmail ]
  • CustomerIdentity

Authorization

  • Role [ Customer, Manager, Employee ]
  • EmployeeIdentity

Routes

  • Auth
    • auth/email {POST, token: Authenticate, body: null}
    • auth/token {POST, token: null, body: SignInRequest}
  • Customer
    • customer {GET, token: Access, body: null}
    • customer {DELETE, token: Access, body: null}
    • customer {POST, token: null, body: CustomerRequest}
    • customer {PATCH, token: Access, body: UpdateCustomerName}
    • customer/address {POST, token: Access, body: AddressRequest}
    • customer/address {GET all, token: Access, body: null}
    • customer/address/{id} {GET, DELETE, token: Access, body: null}
    • customer/address/{id} {PATCH, token: Access, body: AddressRequest}
  • Password
    • password {PATCH, token: Access, body: PasswordRequest}
    • password/reset {PATCH, token: Recover, body: PasswordRequest}
    • password/recover {POST, token: null, body: EmailRequest}

appsettings.development.Example

  # copy appsettings.development.Example to appsettings.development.json
  cp App/ECommerceAPI/appsettings.development.Example App/ECommerceAPI/appsettings.development.json
  PRIVATE_KEY="needs to contain 80 ~ 120"
  URL_AUTH_EMAIL=< Frontend To Receive Token > # url/ <-token AuthenticateEmail
  URL_RESET_PASS=< Frontend To Receive Token > # url/ <-token RecoverPassword
  TOKEN_ACCESS_EXP=12
  TOKEN_REFRESH_EXP=6
  TOKEN_RECOVER_PASS_EXP=0.10 # UtcNow.AddHours(0.10) += 5 minutes
  TOKEN_AUTH_EMAIL_EXP=6
  MAIL_HOST=smtp.gmail.com
  MAIL_PORT=587
  MAIL_ENCRYPTION=true
  MAIL_FROM_NAME=ECommerce
  [email protected]
  MAIL_USER=< !! E-MAIL !! >
  MAIL_PASS=< !! PASSWORD !! >
  DB_DEFAULT_CONNECTION="Server=localhost;Database=ECommerce;UserId=root;Password=12345;"

  • Docker .docker-compose

      .scripts/up-docker-compose.sh
  • Migration :: Create

      .scripts/migration/add.sh < Name > < Context >
  • Migration :: Remove Last

      .scripts/migration/remove.sh < Context >
  • Migration :: List

      .scripts/migration/list.sh  < Context >
  • Database :: Update

    .scripts/database/update.sh < Context >
  • Database :: Drop

    .scripts/database/drop.sh < Context >
  • Database :: Select all

    .scripts/cmd/select-table.sh < Name >
  • Database :: Count

    .scripts/cmd/count-table.sh < Name >
  • Database :: Truncate

    .scripts/cmd/truncate-table.sh < Name >
  • Test :: Register Customers

    .scripts/tests/load-RegisterCustomer.sh
  • Create and Publish :: Release Preview

    .scripts/mk-release-and-publish-preview.sh
  • ROOT USER

    .scripts/add-database-root-user.sh

ERD print 04/09/23

ERD