Full-Stack Angular 11 and GraphQL Book
PART 1: Setup Development Environment, GraphQL Server and Database
In this part, we’ll learn about our app’s architecture and requirements and we’ll set up our development environment for full-stack Angular 11 development. We’ll also set up a GraphQL server with Express.js and Apollo and connect a SQL database for storing the application data using TypeORM.
CHAPTER 1: App Architecture and Development Environment
Throughout this book, we’ll build a full-stack web application with an Angular 11 front-end and a Node.js back-end so in this chapter, we'll first learn about the structure and the tools we need to build the app. Next, we'll prepare our machine for Angular, MySQL and Node.js development and initialize a new project based on the latest version of Angular. Finally, we’ll introduce you to debugging with the latest Angular’s Ivy runtime which will help you view and update your application state in DevTools.
Main Chapter Headings
- The Architecture and technologies
- Installing MySQL
- Installing and configuring Node.js in our development machine
- Installing Angular CLI, the official tool for initializing Angular projects
- Initializing our Angular project
- Debugging Angular applications
Skills learned
- Architecture and learn about the technologies to use for building a full-stack app
- Learn how to install MySQL
- Install Node.js in the local development machine
- Install Angular CLI in the local development machine
- Use Angular CLI commands
- Debug Angular app using the Ivy runtime
CHAPTER 2: Setting up GraphQL with Node.js/Express.js and Apollo
After setting up the development environment, installing Node.js, and initializing the Angular front-end project using the CLI, we'll next need to set up a Node.js server with GraphQL support to implement the back-end. In this chapter, we'll explain how to install Express.js and configure it with TypeScript and GraphQL. We’ll add routing, static assets and cors. Finally, we'll learn how to test our GraphQL server and debug it using Postman, GraphiQL and Apollo DevTools..
Main Chapter Headings
- Installing Express.js
- Routing and middlewares in Express.js
- Setting up Apollo server with Node.js and Express
- Serving static assets
- Testing and Debugging the GraphQL server
Skills learned
- Install Express.js
- Build a basic Express.js server with routing
- Add GraphQL support to Node.js server via Apollo
- Setup Express to serve static assets
- Test and debug the GraphQL server
CHAPTER 3: Connecting the Database with TypeORM
Now that we have a back-end ready that can respond to GraphQL queries and a front-end project. We'll need to connect our database to store our data. We'll be using TypeORM for abstracting the database operations which allows you to use any prefered database management system for your app without changing the code. We’ll see how to integrate TypeORM with Apollo and then migrate and seed our database.
Main Chapter Headings
- Using a database with GraphQL
- Using TypeORM with Node.js
- Writing TypeORM models for our database
- Using Apollo together with TypeORM
- Migrating and Seeding Data with TypeORM
Skills learned
- Set up a database
- Integrate TypeORM with Node.js
- Create database models for TypeORM
- Integrate TypeORM with Apollo
- Migrate the database
PART 2: Build the Angular Front-End with Realtime Support
In the previous part we have prepared both the development environment for Angular and created a GraphQL server with Express.js and Apollo. In this part, we’ll implement the front-end of our application using Angular and Apollo. We’ll add routing and navigation between various modules and components then we’ll finally implement real-time support using GraphQL subscriptions.
CHAPTER 4: Angular Application Architecture and Routing
In the previous chapters we created the front-end project using Angular CLI. In this chapter, we'll use Angular CLI to create the modules, services and components that compose the UI of our application. Angular allows us to create the front-end of our backend with a modular and component based architecture.
After creating the various artifacts needed in our app such as modules, services and components, we’ll introduce Angular routing and we’ll proceed to implement routing and navigation in our application to create a single page application.
Main Chapter Headings
- Understanding the Application Architecture with Modules, and Components
- Services and Dependency Injection
- Creating Modules and Components
- Understanding Angular Routing
- Adding Routes
- Adding Navigation
Skills learned
- Understand Angular Architecture
- Understand Services and Dependency Injection
- Use Angular CLI to create modules, services, and components
- Understand Angular routing
- Add routes to different views
- Add navigation in the app
CHAPTER 5: Integrating the Angular Front-End with the GraphQL Back-End
Angular allows us to create the front-end of our backend with a modular and component based architecture. In this chapter, we'll learn how to use the Apollo client to connect the front-end with the GraphQL backend.
Main Chapter Headings
- Installing and configuring Apollo in the frontend
- Sending GraphQL queries with Apollo
- Mutating data with Apollo
Skills learned
- Set up Apollo
- Send GraphQL queries
- Mutate data with GraphQL
CHAPTER 6: Implementing Authentication with Angular and GraphQL
In this chapter, we are going to learn about the necessary concepts for adding authentication with Angular and GraphQL. We’ll learn what’s JWT and how to implement authentication with JWT and Apollo.
Main Chapter Headings
- What’s JWT
- Implementing authentication with Node.js and Apollo
- Signing up and logging Users
- Protecting GraphQL queries and mutations
- Protecting Routes
Skills learned
- Understand JWT
- Implement authentication
- Implement login and signup interface
- Protect GraphQL queries and mutations
- Protect routes from public access
CHAPTER 7: Handling Image Uploads
We want to allow users to upload their images so in this chapter, we’ll learn how to upload images using Amazon Web Services, Angular and Express.js.
Main Chapter Headings
- Setting up AWS
- Setting up a AWS S3 Bucket
- Implementing Image Uploads in the server
- Uploading images with Angular and Apollo
Skills learned
- Set up AWS
- Set up AWS S3
- Implement image uploads in server
- Implement image upload in client
CHAPTER 8: Adding Realtime Support
In this chapter, we’ll learn how to add realtime support to our application to fetch new data from the server without the need to constantly refresh the app. To achieve this we’ll use GraphQL subscriptions with Apollo.
Main Chapter Headings
- GraphQL and WebSockets
- Implementing GraphQL Subscriptions with Apollo
- Implementing JWT Auth with Subscriptions
Skills learned
- Use websockets with GraphQL
- Use GraphQL subscriptions to add realtime support
- Add JWT auth to GraphQL subscriptions
PART 3: Server-side Rendering, Testing and Deployment
After building our app in the previous part, now we’ll add server-side rendering to our app, test our code for any unexpected errors and we’ll deploy it to AWS Lambda using the Serverless framework..
CHAPTER 9: Adding Server-side Rendering
At this point, we have a Single Page App with multiple routes and views thanks to client-side routing. In this chapter, we’ll learn about server-side rendering and its benefits and then we’ll proceed to implement SSR in our app.
Main Chapter Headings
- Introducing Server-Side Rendering
- Implementing SSR with Express and Angular
- Implementing JWT with SSR
- Running GraphQL Queries with SSR
Skills learned
- Learn what’s SSR
- Implement SSR in Angular
- Implement JWT with SSR
- Use GraphQL with SSR
CHAPTER 10: Testing Angular and GraphQL API
We have written a lot of code in the back-end and front-end. In this chapter, we’ll learn how to write tests for our backend and frontend code to make sure everything works as expected. Next, we’ll build our app and deploy it to Heroku.
Main Chapter Headings
- Testing GraphQL APIs
- Testing the Angular Front-End
Skills learned
- Write tests for the GraphQL API
- Write tests for Angular code
CHAPTER 11: Deploying your App with the Serverless Framework and AWS Lambda
Now that we have tested our code back-end and front-end’ code. In this chapter, we’ll learn about serverless and then we’ll build our app and deploy it to AWS Lambda using the Serverless framework.
Main Chapter Headings
- Setting up and Configuring Apollo Cache
- What’s Serverless and its Benefits
- Setting Apollo Server to Work with Lambda
- Deploying the App with the Serverless Framework
Skills learned
- Implement Caching
- Learn what’s serverless
- Set up Apollo server to work with Lambda
- Deploy the app with the serverless framework
Subscribe to our mailing list to be notified when the book is ready for purchase!
-
Date: