Node.js Application Architecture 🇵🇱 🇬🇧 3 days
About
Microservices, Cloud and Continuos Delivery heavily influenced the way modern teams build their software.
In this new world there's an increasing need for very fast and performant IO bound services that effectively
use server resources and are written in a familiar language. That is where Node.js really shines.
During this training you'll learn to build Node.js apps from A to Z.
What will I learn?
- Create testable APIs and Web Apps talking to NoSQL database
- Evolve application structure based on feedback from code
- Choose appropriate architectural styles to the problem at hand
- Write applications by composing small libraries and functions (the Unix Way)
Agenda
Express.js
- routes
- middleware
- error handling
- template engines
- connecting to MongoDB
REST
- Resources and Representations
- Content Negotiation
- Collection resource
- HATEOAS - hypermedia
- HTML as media type
Layered Architecture
- Dependency Injection without frameworks
- Asynchronous dependencies
- CRUD
- controllers
- services
- repositories
- domain logic
- data validation
Node.js and Typescript
- migrating JS project to TS
- typing domain objects
- typing repositories
- typing services
- typing generic code with generics
- typesafe data parsing
Event Sourcing and CQRS Architecture
- aggregates, commands and events
- modelling invariants
- node-eventstore (MongoDB, in-memory)
- command handlers
- event publishing with HTTP
Pipes and Filters Architecture with Streams
- a case for streams
- stream types (readable, writable, transform)
- core Node.js streams (http, fs, zlib)
- npm stream modules (through2, split2)
- pipes and filters architecture
Domain-Driven Design in Node.js
- modelling domain with aggregates and domain events
- serializing domain objects for persistence
- using repositories with optimistic concurrency control
- orchestrating use cases with application services
- write model vs read model
- publishing events
Testability
- design for testability
- dealing with "difficult" dependencies
- London school of unit testing
- Chicago school of unit testing
- Component testing
- tooling: mocha, tape, supertest
Refactoring Legacy Node.js
- finding "seams" in code
- adding characterization tests
- using code coverage to find dead code
- identifying code smells
- automated IDE based refactoring