▶Book Description
Become fluent in both frontend and backend web development by combining the impressive capabilities of ASP.NET Core 2 and Angular 5 from project setup right through the deployment phase.
Full-stack web development means being able to work on both the frontend and backend portions of an application. The frontend is the part that users will see or interact with, while the backend is the underlying engine, that handles the logical flow: server configuration, data storage and retrieval, database interactions, user authentication, and more.
Use the ASP.NET Core MVC framework to implement the backend with API calls and server-side routing. Learn how to put the frontend together using top-notch Angular 5 features such as two-way binding, Observables, and Dependency Injection, build the Data Model with Entity Framework Core, style the frontend with CSS/LESS for a responsive and mobile-friendly UI, handle user input with Forms and Validators, explore different authentication techniques, including the support for third-party OAuth2 providers such as Facebook, and deploy the application using Windows Server, SQL Server, and the IIS/Kestrel reverse proxy.
▶What You Will Learn
- Use ASP.NET Core to its full extent to create a versatile backend layer based on RESTful APIs
- Consume backend APIs with the brand new Angular 5 HttpClient and use RxJS Observers to feed the frontend UI asynchronously
- Implement an authentication and authorization layer using ASP.NET Identity to support user login with integrated and third-party OAuth 2 providers
- Configure a web application in order to accept user-defined data and persist it into the database using server-side APIs
- Secure your application against threats and vulnerabilities in a time efficient way
- Connect different aspects of the ASP. NET Core framework ecosystem and make them interact with each other for a Full-Stack web development experience
▶About This Book
- Based on the best-selling book ASP.NET Core and Angular 2
- Easily build a complete single page application with two of the most impressive frameworks in modern development, ASP.NET Core and Angular
- Bring together the capabilities and features of both Angular 5 and ASP.NET Core 2 for full stack development
- Discover a comprehensive approach to building your next web project - from managing data, to application design, through to SEO optimization and security
▶Who This Book Is For
This book is for seasoned ASP.NET developers who already know about ASP.NET Core and Angular in general, but want to know more about them and/or understand how to blend them together to craft a production-ready SPA.
▶Style and approach
More than just a technical manual, this guide takes you through the most important technical facets of developing with these two hugely popular frameworks and then demonstrates how to put those skills into practice. It's a book that recognizes that what's really important is the end product.
▶What this book covers
- Chapter 1, Getting Ready, introduces the ASP.NET Core and Angular frameworks, explaining how they can effectively be used to build a feature-rich, modern web application. It then enumerates the core aspects of a common SPA project, which will be addressed throughout the following chapters. The last part covers the required steps for setting up a .NET Core web application project, along with its required packages and components, up to a buildable and running app skeleton.
- Chapter 2, Backend with .NET Core, explains how we can build our very own set of APIs to exchange JSON data between a server-side ASP.NET Core Controller and a client-side Angular Component. The reader will learn how to handle the HTTP request-response cycle and also how to configure the improved routing logic built upon the .NET Core pipeline.
- Chapter 3, Frontend with Angular, focuses on the client-side aspects; the reader will learn how to fetch JSON objects with Angular and show the retrieved data onscreen using the Angular Template Syntax. They will also understand how to deal with client-side routing in Angular and how to implement a viable routing pattern using the PathLocationStrategy approach.
- Chapter 4, Data Model with Entity Framework Core, guides the reader through implementing a proper, DBMS-based Data Model using Entity Framework (EF) Core. They will learn how to install and properly configure the required EF Core packages, then use them to build a lightweight set of entities and persist them into a database structure using the Code-First approach.
- Chapter 5, Client-Server Interactions, shows how the existing code can be upgraded to make full use of the EF Core Entities defined in the last chapter. The reader will learn how to fetch and persist the application data using the database instead of the sample objects mocked by the previous data-retrieval methods.
- Chapter 6, Style Sheets and UI Layout, introduces LESS, a powerful dynamic style sheet language that can be compiled into CSS. After a brief overview of the LESS language syntax, the reader will learn how to add, implement, and compile LESS scripts within the application project to greatly improve the frontend UI.
- Chapter 7, Forms and Data Validation, is mostly dedicated to passing data from the client to the server, from account-related features -such as user registration- to more complex interactions with the whole range of existing Entities. The reader will learn how to send PUT- and POST-based requests using the versatile Angular Model-Driven approach, and how to properly respond to them by extending the existing .NET Core Controllers accordingly.
- Chapter 8, Authentication and Authorization, starts as a recap of the most relevant authrelated concepts for building a web application and then shows how to turn these concepts into practice. The reader will learn how to implement a sample token-based auth provider and also how to properly add and configure it throughout the existing Entity Framework entities, .NET core services, and HTTP middleware list.
- Chapter 9, Advanced Topics, shows how to implement a specific set of features required to finalize a production-ready web application, such as token expiration, refresh tokens, new user registration, and third-party authentication.
- Chapter 10, Finalization and Deployment, describes the most common tasks to publish a potentially shippable web application onto a production server. The reader will learn how to replace the localDb instance with an external SQL Server, create FTP and FileSystem publishing profiles, upload their compiled application to an external server, and configure it to run under IIS using the .NET Core Windows Server Hosting bundle; they will also learn how to deal with the most common issues with the help of some .NET Core-specific troubleshooting techniques.