Git Product home page Git Product logo

ecommerce-app's Introduction

.NET Core

Ecommerce App using ASP.NET Core and Angular

Hi Friends,

During this lock-down period; I spent some time writing one full stack project using ASP.NET Core and Angular 9 with other best practices as explained below. I hope you like it. Demo Link:- https://sports-center.azurewebsites.net/ Git Link:- https://github.com/rahulsahay19/eCommerce-App

Introduction

In this section, you will learn how to build full fledged Ecommerce app using asp.net core and angular 9. Below are the key takeaways from this project. Anyone who wants to learn and write professional enterpise projects can refer this project. This project not only illustrates how to implement all layers to the point rather it adheres to best practices as followed by industry.

Here, you will learn variety of technologies like

  • Angular Lazy loading
  • Angular Routing
  • Angular Reactive Forms
  • Angular Creating a MultiStep form wizard
  • Payment gateway integration
  • Angular Re-usable Reactive form components
  • Angular validation
  • Async Validation
  • .Net Core
  • Angular
  • C# Generics
  • Repository Pattern
  • Unit of Work Pattern
  • Specification Pattern
  • Caching

I have shipped two branches in Github. Master branch is meant for development cut and production is for finished product. While going through the code, you will see how to implement best practices using tons of client/server techniques. Here, you will see

  • How to use specification pattern in conjunction with Repository and Unit of Work pattern
  • How to use multiple DbContext to separate business logic with Identities
  • How to use JWTs token using ASP.NET Identity
  • How to load lazy loaded routes.
  • How to use Automapper
  • How to build a cool theme from bootstrap
  • How to make use of Reactive Forms
  • How to create interceptors
  • How to implement Paging, Sorting, Searching and Filtering
  • How to implement caching both at client and server level
  • How to use Azure Redis Cache
  • How to integrate payment gateway using Stripe
  • How to create reusable reactive forms
  • How to make use of Input and Output Binding
  • How to make use various observables
  • How to make use of Generics
  • How to create custom middlewares
  • How to create custom application service extensions
  • How to persist data at service level
  • How to make API error handling more consistent and generic
  • How to seprate multi layer .net project with its responsibility
  • How to create multi step form to complete the order
  • How to make use of angular material component with bootstrap
  • Accepting payments via Stripe using the new EU standards for 3D secure
  • Publishing the app on Azure
  • And many more things

How Project is structured

Below, I have Pasted the high level glimpse project structure.

14th

APIs Structure goes like

16th

Here, you will get Custom middleware implementation, extension methods, DTOs, Custom Error Handling and few Helper methods as well.

Angular Project looks like

17th

Here is the detailed feature-wise detailing of angular project.

18th

Then, we have Core implementation of project. This holds design pattern implementation like show below.

19th

Similarly, I have Infrastructure project which holds all repository, interface implementation. This also holds the seed project and data context as well.

20th

Warning and Disclaimer

Every effort applied to make this project complete and accurate to the topic, but no warranty is implied. Any implementation in this project are MY OWN and also borrowed from best practices segment. ALL content presented AS-IS, for learning purposes only. Author will not be liable for any loss or damages arising from the information presented in this project. This also involves stripe implementation. Just use test card as explained in readme not actual card. Incase, if any amount get deducted from actual card, author won't be responsible for any loss or damage.

Client

This project was generated with Angular CLI version 9.0.1. You can cd into client folder and do npm i to install the packages then ng serve.

Development server

This project is built using asp.net core 3.1. you can cd into API directory and say dotnet restore and then dotnet watch run.

Server Side Technologies

  • .Net Core
  • Generic Repository Patterns
  • Unit of Work Pattern
  • Specification Pattern
  • Azure Redis Cache
  • Sqlite during devlopment
  • Mysql in Production
  • Swagger
  • Stripe Implementation

Client Side Technologies

  • Angular 9
  • Bootstrap 4
  • ngx-bootstrap
  • Font Awesome
  • Lazy Loading
  • Caching
  • RXJS
  • Design Components

About the project

This project is divided into branches. Master branch is development cut and production branch is production cut. In order to understand best practices and differences between them try comparing both.

Mobile UX

Currently this project is not mobile friendly as I didn't get time to make it mobile compatible. In case, anyone interested, do submit PR.

PR and Comments

I am open for extension of this project. Incase, if anyone wants to extend any feature, you can submit PR.

Stripe Test Cards

You can also follow docs here https://stripe.com/docs/testing

13th

Glimpse of the working solution

Demo Link:- https://sports-center.azurewebsites.net/

1st

2nd

3rd

4th

5th

6th

7th

8th

9th

10th

11th

12th

ecommerce-app's People

Contributors

dependabot[bot] avatar rahulsahay19 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ecommerce-app's Issues

basket and sign up and login not working where click on it

Request URL: https://localhost:4200/basket-basket-module.js
Referrer Policy: no-referrer-when-downgrade
Provisional headers are shown
Referer: https://localhost:4200/shop
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36


2882: URL_REQUEST
https://localhost:4200/basket-basket-module.js
Start Time: 2020-06-17 08:22:43.634

t=71712 [st= 0] +REQUEST_ALIVE [dt=305]
--> priority = "LOWEST"
--> traffic_annotation = 101845102
--> url = "https://localhost:4200/basket-basket-module.js"
t=71712 [st= 0] NETWORK_DELEGATE_BEFORE_URL_REQUEST [dt=0]
t=71712 [st= 0] +URL_REQUEST_START_JOB [dt=305]
--> initiator = "https://localhost:4200"
--> load_flags = 65536 (SUPPORT_ASYNC_REVALIDATION)
--> method = "GET"
--> network_isolation_key = "https://localhost:4200 https://localhost:4200"
--> privacy_mode = 0
--> site_for_cookies = "SiteForCookies: {scheme=https; registrable_domain=localhost}"
--> url = "https://localhost:4200/basket-basket-module.js"
t=71712 [st= 0] COOKIE_INCLUSION_STATUS
--> operation = "send"
--> status = "INCLUDE, DO_NOT_WARN"
t=71712 [st= 0] COOKIE_INCLUSION_STATUS
--> operation = "send"
--> status = "INCLUDE, DO_NOT_WARN"
t=71712 [st= 0] COOKIE_INCLUSION_STATUS
--> operation = "send"
--> status = "INCLUDE, DO_NOT_WARN"
t=71712 [st= 0] COOKIE_INCLUSION_STATUS
--> operation = "send"
--> status = "INCLUDE, DO_NOT_WARN"
t=71712 [st= 0] COOKIE_INCLUSION_STATUS
--> operation = "send"
--> status = "INCLUDE, DO_NOT_WARN"
t=71712 [st= 0] COOKIE_INCLUSION_STATUS
--> operation = "send"
--> status = "INCLUDE, DO_NOT_WARN"
t=71712 [st= 0] NETWORK_DELEGATE_BEFORE_START_TRANSACTION [dt=0]
t=71712 [st= 0] HTTP_CACHE_GET_BACKEND [dt=0]
t=71712 [st= 0] HTTP_CACHE_OPEN_OR_CREATE_ENTRY [dt=0]
t=71712 [st= 0] HTTP_CACHE_ADD_TO_ENTRY [dt=0]
t=71713 [st= 1] +HTTP_STREAM_REQUEST [dt=303]
t=71713 [st= 1] HTTP_STREAM_JOB_CONTROLLER_BOUND
--> source_dependency = 2884 (HTTP_STREAM_JOB_CONTROLLER)
t=72016 [st=304] HTTP_STREAM_REQUEST_BOUND_TO_JOB
--> source_dependency = 2885 (HTTP_STREAM_JOB)
t=72016 [st=304] -HTTP_STREAM_REQUEST
t=72017 [st=305] URL_REQUEST_DELEGATE_SSL_CERTIFICATE_ERROR [dt=0]
t=72017 [st=305] CANCELLED
--> net_error = -202 (ERR_CERT_AUTHORITY_INVALID)
t=72017 [st=305] -URL_REQUEST_START_JOB
--> net_error = -202 (ERR_CERT_AUTHORITY_INVALID)
t=72017 [st=305] URL_REQUEST_DELEGATE_RESPONSE_STARTED [dt=0]
t=72017 [st=305] -REQUEST_ALIVE

error when try to fetch store data

Internal Server Error - Refresing the page will make exception disappear
Error: It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 6s ago, v: 2.1.30.38891
Note:- Check server error logs

https://localhost:5001/api/products?sort=priceAsc&pageIndex=1&pageIndex=10

{"statusCode":500,"message":"It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 117s ago, v: 2.1.30.38891"}

I have an issue to include the relative entities.

I have an issue to include the relative entities.
eg. AddInclude(i => i.Stocks.Select(s=>s.StockSku));
This throwing me an error
how can I implements ThenIclude in base repository.
Really stuck and your help will be grateful

Responsible disclosure policy

Hey there!

I belong to an open source security research community, and a member (@lfama) has found an issue, but doesn’t know the best way to disclose it.

If not a hassle, might you kindly add a SECURITY.md file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.

Thank you for your consideration, and I look forward to hearing from you!

(cc @huntr-helper)

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.