Book description
Leverage ASP.NET core 2.0 web API and the power of Vue.js at the client side to create modern applications from scratch
Key Features
- Create fast, rich and reactive client side applications with Vue.js and ASP.NET Core.
- Leverage Vue components efficiently to build state of the art user interfaces.
- Work with Vuex and Nuxt.js to build ASP.NET Core based applications that are powerful, consistent, and maintainable
Book Description
This book will walk you through the process of developing an e-commerce application from start to finish, utilizing an ASP.NET Core web API and Vue.js Single-Page Application (SPA) frontend.
We will build the application using a featureslice approach, whereby in each chapter we will add the required frontend and backend changes to complete an entire feature. In the early chapters, we'll keep things fairly simple to get you started, but by the end of the book, you'll be utilizing some advanced concepts, such as server-side rendering and continuous integration and deployment. You will learn how to set up and configure a modern development environment for building ASP.NET Core web APIs and Vue.js SPA frontends.You will also learn about how ASP.NET Core differs from its predecessors, and how we can utilize those changes to our benefit.
Finally, you will learn the fundamentals of building modern frontend applications using Vue.js, as well as some of the more advanced concepts, which can help make you more productive in your own applications in the future.
What you will learn
- Setup a modern development environment for building both client-side and server-side code
- Use Vue CLI to scaffold front-end applications
- Build and compose a set of Vue.js components
- Setup and configure client-side routing to introduce multiple pages into a SPA
- Integrate popular CSS frameworks with Vue.js to build a product catalogue
- Build a functioning shopping cart that persists its contents across browser sessions
- Build client-side forms with immediate validation feedback using an open-source library dedicated to Vue.js form validation
- Refactor backend application to use the OpenIddict library
Who this book is for
This book is aimed at ASP.NET developers who are looking for an entry point in learning how to build a modern client-side SPA with Vue.js, or those with a basic understanding of Vue.js who are looking to build on their knowledge and apply it to a real-world application. Knowledge of JavaScript is not necessary, but would be an advantage.
Table of contents
- Title Page
- Copyright and Credits
- Dedication
- Packt Upsell
- Contributors
- Preface
- Understanding the Fundamentals
- Setting Up the Development Environment
- Getting Started with the Project
- Building Our First Vue.js Components
-
Building a Product Catalog
-
Improving the existing UX
- Choosing a UX framework
- What is Bootstrap-Vue?
- Installing additional required dependencies
- Modifying the webpack configuration to support SASS
- Updating the webpack vendor configuration
- Rebuilding the vendor bundle
- Adding application-wide layout elements
- Adding application-wide styles
- Styling the product list and product details components
- Fetching data before navigation
- Adding a page loading indicator
- Adding a transition on page change
- Extending the existing data model
- Filtering on the server
-
Filtering on the client
- Installing additional dependencies
- Building an accordion component
-
Building the filters component
- Scaffolding the filters component template
- Adding a brand filter
- Adding a price filter
- Adding a screen size filter
- Adding the remaining color, OS, and feature filters
- Scaffolding the filters component behavior
- Defining the filters component computed properties
- Defining the filters component methods
- Styling the filters component
- Adding the filters component to the catalog page
- Refactoring the filters component
- Client-side sorting
- Creating a search bar component
- Summary
-
Improving the existing UX
-
Building a Shopping Cart
- Evaluating our options
- Finishing the product details page
- Introduction to Vuex
- Installing and configuring Vuex
- Adding products to the cart
- Creating a shopping cart page
- Creating a currency filter
- Removing products from the cart
- Updating cart items
- Adding a getter to display the cart total
- Creating a cart summary component
- Persisting the cart to local storage
- Improving the UX with add to cart feedback
- Summary
-
User Registration and Authentication
- Adding JWT authentication to the API
- Authentication and user registration in the client app
- Protecting pages with navigation guards
- Setting the authentication state on app startup
- Summary
-
Processing Payments
- Why use Stripe?
- Getting started with Stripe and client-side validation
- Building the checkout components
- Building a my account page
- Fixing the register form component
- Server-side payment processing
- Adding an order list API endpoint
- Summary
-
Building an Admin Panel
- Extending the authentication endpoint with user roles
- Client-side role-based authorization
- Server-side role-based authorization
- Hiding UI elements based on role
- Building the admin panel components
- Vue component inheritance
- Building custom input controls
- Persisting new products to the database
- Remote validation with Vee-Validate
- Tidying things up
- Summary
- Deployment
- Authentication and Refresh Token Flow
-
Server-Side Rendering
- Why use SSR in the first place?
- How does SSR work?
- The easy way – Nuxt.js
- Preparing the application for SSR
- Setting up and configuring SSR
- Enabling SSR
- Conditionally rendering elements that rely on the browser
- Testing our server-rendered application
- Summary
- Continuous Integration and Continuous Deployment
- Other Books You May Enjoy
Product information
- Title: ASP.NET Core 2 and Vue.js
- Author(s):
- Release date: July 2018
- Publisher(s): Packt Publishing
- ISBN: 9781788839464
You might also like
book
Hands-On Full-Stack Web Development with ASP.NET Core
Become a full-stack developer by learning popular Microsoft technologies and platforms such as .NET Core, ASP.NET …
book
Modern Web Development with ASP.NET Core 3 - Second Edition
Explore the tools and techniques to build scalable and secured restful web services and web applications …
book
ASP.NET Core MVC 2.0 Cookbook
Learn to implement ASP.NET Core features to build effective software that can be scaled and maintained …
book
ASP.NET Core 5 for Beginners
Learn how to build web applications efficiently using ASP.NET Core 5 with the C# programming language …