Table of Contents for
Nest.js: A Progressive Node.js Framework

Version ebook / Retour

Cover image for bash Cookbook, 2nd Edition Nest.js: A Progressive Node.js Framework by David Guijarro Published by Bleeding Edge Press, 2018
  1. nav
  2. Cover
  3. Nest.js: A Progressive Node.js Framework
  4. Nest.js: A Progressive Node.js Framework
  5. Preface
  6. 1. Introduction
  7. 2. Overview
  8. 3. Nest.js authentication
  9. 4. Dependency Injection system of Nest.js
  10. 5. TypeORM
  11. 6. Sequelize
  12. 7. Mongoose
  13. 8. Web sockets
  14. 9. Microservices
  15. 10. Routing and request handling in Nest.js
  16. 11. OpenAPI (Swagger) Specification
  17. 12. Command Query Responsibility Separation (CQRS)
  18. 13. Architecture
  19. 14. Testing
  20. 15. Server-side Rendering with Angular Universal
  1. Preface
    1. What is Nest.js?
  2. 1. Introduction
    1. Topics discussed
    2. Nest CLI
    3. Dependency Injection
    4. Authentication
    5. ORM
    6. REST API
    7. WebSockets
    8. Microservices
    9. GraphQL
    10. Routing
    11. Nest specific tools
    12. OpenAPI (Swagger)
    13. Command Query Responsibility Segregation (CQRS)
    14. Testing
    15. Server-side rendering with Angular Universal
    16. Summary
  3. 2. Overview
    1. Controllers
    2. Providers
    3. Modules
    4. Bootstrapping
    5. Middleware
    6. Guards
    7. Summary
  4. 3. Nest.js authentication
    1. Passport
    2. Manual implementation
      1. Implementation
      2. Authentication middleware
      3. Managing restrictions with guards
    3. Nest.js passport package
    4. Summary
  5. 4. Dependency Injection system of Nest.js
    1. Overview of Dependency Injection
      1. Why use Dependency Injection
      2. How it works without Dependency Injection
      3. How it works with a manual Dependency Injection
      4. Dependency Injection pattern today
    2. Nest.js Dependency Injection
    3. The difference between Nest.js and Angular DI
    4. Summary
  6. 5. TypeORM
    1. What database to use
      1. About MariaDB
    2. Getting started
      1. Start the database
      2. Connect to the database
      3. Initialize TypeORM
    3. Modelling our data
      1. Our first entity
    4. Using our models
      1. The service
      2. The controller
      3. Building a new module
    5. Improving our models
      1. Auto-generated IDs
      2. When was the entry created?
      3. Column types
      4. NoSQL in SQL
    6. Relationships between data models
      1. How to store related entities
      2. Retrieving related entities in bulk
      3. Lazy relationships
    7. Other kinds of relationships
      1. One-to-one
      2. Many-to-many
    8. Advanced TypeORM
      1. Security first
      2. Other listeners
      3. Composing and extending entities
      4. Caching
      5. Building a query
      6. Building our model from a existing database
    9. Summary
  7. 6. Sequelize
    1. Configure Sequelize
    2. Create a model
      1. @Table
      2. @column
      3. Create the User model
      4. LifeCycle hooks
    3. Injecting a model into a service
    4. Usage of Sequelize transaction
    5. Migration
      1. Configuring the migration script
      2. Create a migration
    6. Summary
  8. 7. Mongoose
    1. A word about MongoDB
    2. A word about Mongoose
      1. Mongoose and Nest.js
    3. Getting started
      1. Set up the database
      2. Start the containers
      3. Connect to the database
    4. Modelling our data
      1. Our first schema
    5. Using the schema
      1. The interface
      2. The service
      3. The controller
    6. The first requests
    7. Relationships
      1. Modelling relationships
      2. Saving relationships
      3. Reading relationships
    8. Summary
  9. 8. Web sockets
    1. WebSocketGateway
    2. Gateways
    3. Authentication
    4. Adapter
    5. Client side
    6. Summary
  10. 9. Microservices
    1. Server bootstrap
    2. Configuration
    3. First microservice handler
    4. Sending data
    5. Exception filters
    6. Pipes
    7. Guards
    8. Interceptors
    9. Built-in transports
      1. Redis
      2. MQTT
      3. NATS
      4. gRPC
    10. Custom transport
    11. Hybrid application
    12. Advanced architecture design
    13. Summary
  11. 10. Routing and request handling in Nest.js
    1. Request handlers
    2. Generating responses
      1. Standard approach
      2. Express approach
    3. Route parameters
    4. Request body
    5. Request object
    6. Asynchronous handlers
      1. Async/await
      2. Promise
      3. Observables
    7. Error responses
      1. HttpException
      2. Unrecognized exceptions
    8. Summary
  12. 11. OpenAPI (Swagger) Specification
    1. Document Settings
      1. Documenting authentication
    2. Swagger UI
    3. API input decorators
      1. @Body
      2. @Param
      3. @Query
      4. @Headers
      5. Authentication
    4. API request and response decorators
    5. API metadata decorators
    6. Saving the swagger document
    7. Summary
  13. 12. Command Query Responsibility Separation (CQRS)
    1. Entry module commands
      1. Command handlers
      2. Invoking command handlers
    2. Linking keywords with events
      1. Keyword events
      2. Invoking event handlers
    3. Retrieving keywords APIs
    4. Linking keywords with sagas
      1. Keyword saga commands
      2. Keyword saga
    5. Summary
  14. 13. Architecture
    1. Style guide of naming conventions
      1. Controller
      2. Service
      3. Module
      4. Middleware
      5. Exception filter
      6. Pipe
      7. Guard
      8. Interceptor
      9. Custom decorator
      10. Gateway
      11. Adapter
      12. Unit test
      13. E2E test
    2. Directory structure
      1. Server architecture
      2. Angular Universal architecture
    3. Summary
  15. 14. Testing
    1. Unit testing
      1. Tooling
      2. Preparation
      3. Writing our first test
      4. Testing for equality
      5. Covering our code in tests
    2. E2E testing
      1. Preparation
      2. Writing end-to-end tests
    3. Summary
  16. 15. Server-side Rendering with Angular Universal
    1. Serving the Angular Universal App with Nest.js
    2. Building and running the Universal App
    3. Summary
Back to top