Giter VIP home page Giter VIP logo

blazorshop's Introduction

Blazor Shop Store

  • This repository contains the code of an online shop, both the front-end and the back-end, the database was built using the Code-First approach (the migrations are also present, just migrate them to your local SQL Server Database). The interface is built using pages but using the razor component functionalities. The server is based on Net 6 with C# 10 capabilities. The server is a Web API implemented using the guidelines of CQRS and Mediator architectural pattern.

  • Video Demo Link: (In the Future)

  • Unit of Work Project to demonstrate the Unit of Work with Repository Pattern design pattern

Setup Project

  • Run 'update-database' command to setup migrations.
  • Uncomment and update the seed fields in appsettings.json.
  • Run application to apply seeding.
  • Empty the seed fields from appsettings.json and comment again.

Web API functionalities

* Worker Service Project - to deactivate a user subscription
* Unit Test Project (Under Development)

* Create global _Imports file for C# using statements
* Creating logger for errors

* Domain Layer - creating the database entities and identity entities (to manage users and their authorization claims)

* Application Layer
	* Creating commands, queries and handlers for entities
	* Creating validators for commands and queries
	* Creating mapping from database model to view model
	* Creating custom exception flow and mapping helpers
	* Creating generic response model
	* Configure AutoMapper, FluentValidation and Mediator

* Infrastructure Layer
	* Implement Identity Core Services (Account, User and Role)
	* Configure Entity Framework Core Database (Identity DbContext)
	* Configure configurations for entities
	* Creating and Adding Migrations to SQL Server Database
	* Create Seed Data
	* Configure SqlServer Database
	* Configure Authorization policies and specifically implement IdentityUser with IdentityRole Managers
	* Inject Services

* Web API Layer
	* Configure Application and Infrastructure layers
	* Configure Authentication using Jwt Bearer tokens (with validation parameters)
	* Configure Stripe Gateway Payments
	* Configure Stripe WebHook for the local testing environment (Ngrok provider)
	* Setting CORS policy
	* Adding Filters and Middleware
	* Using StringResources for Roles
	* Creating controllers for API endpoints

Blazor Web Assembly

* The application design was built mainly using Bootstrap 5.
  The client interfaces have been built with the latest version of Blazor Web Assembly.
  Some of the functionalities of the Blazor Web application are:

* Creating Authorization Policies based on Role
* Making requests through HTTP to the Web API using HttpClient library
* Using Local Storage to save the JWT Token - setting the token to HTTP Authorization Header
* Using Blazor ToastService to show messages
* Using MatBlazor and Radzen Blazor libraries for design and bootstrap
* Using Authentication State Provider to authorize user access to application
* Using razor components to create pages

Application Features

* Stripe Checkout
* Stripe Subscription Manager

* Account Feature
	* Login, Register, Logout, Reset Password
* Admin
	* Managing Clothes, Musics, Subscriptions
	* Managing Roles and Users
	* Managing Subscribers
* Shopping Cart Feature
* Clothes Feature
* Musics Feature
* Orders Feature
* Receipts Feature
* Subscriptions Feature
* User Profile

blazorshop's People

Contributors

jbeni avatar jitca avatar paulofdo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

blazorshop's Issues

Just an idea

It would be cool, and more appealing if there is a few screenshots from the important parts of the store:
Frontend, Group view, Articles view, Article selection, Search, Admin panel, Checkout, Delivery method, completion of the checkout.. etc.

IDX10503: Signature validation failed

I found an error in jwt authentication.

'IDX10503: Signature validation failed. Token does not have a kid. Keys tried: 'System.Text.StringBuilder'.\nExceptions caught:\n 'System.Text.StringBuilder'.\ntoken: 'System.IdentityModel.Tokens.Jwt.JwtSecurityToken'.'

`private bool IsCurrentTokenValid(string token)
{
var tokenHandler = new JwtSecurityTokenHandler();
var isTokenValid = true;

        try
        {
            tokenHandler.ValidateToken(token, new TokenValidationParameters
            {
                ClockSkew = TimeSpan.FromSeconds(1),
                IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_configuration["JwtToken:SecretKey"])),
                RequireSignedTokens = true,
                RequireExpirationTime = true,
                ValidateLifetime = true,
                ValidateAudience = false,
                ValidateIssuer = false,
                ValidAudience = _configuration["JwtToken:Audience"],
                ValidIssuer = _configuration["JwtToken:Issuer"]
            }, out SecurityToken validatedToken);
        }
        catch
        {
            isTokenValid = false;
        }

        return isTokenValid;
    }`

Demo of BLazorShop

Hi Jitca.

It looks like you did a great job. Is there a place where we can see the BlazorShop in action ? Do you have printscreens ?

Thanks for your contribution. Kani.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.