Node.js Application Architecture

Code: modern-Node
Category: Node.js
Format: 20% lecture / 80% workshop
Duration: 2-3 days
Target audience: developers
architects
Enrollment: Groups, companies
Venue: Client's office.

Node.js provides more freedom compared to traditional enterprise ecosystems.

Although some individuals are attempting to transform Node.js into a framework-heavy enterprise platform, there is an alternative approach.

In this course we will learn how to build highly composable, type-safe and testable systems without a typical enterprise framework magic. If you have an aversion to magic or wish to unlearn years of practices such as using:

  • Dependency Injection containers
  • Class-based programming
  • ORMs
  • Technology-driven architectures
  • Magical conventions
  • @Transactional dandruff
  • new Date() spread all over the place
  • Handwritten DTOs
  • Import mocking frameworks
  • Reflection and metaprogramming magic

This course is for you. The alternative to heavy enterprise frameworks is not Wild Wild West or building a custom framework. The real alternative is to embrace the true nature of JS/TS , make full use of the good parts and never get prisoned in another heavy framework again.

What will I learn?

  • Compose your building blocks with multiple composition roots and manual dependency injection
  • Make full use of extremly composable functions instead of less composable classes
  • Write type-safe DB access code that stays in sync with DB schemas and prevents you from mistakes
  • Parse don’t validate your input and output data to be liberal in what you accept and strict in what you produce
  • Organise your code around features, not technology layers
  • Handle DB transactions without magic
  • Program in a language, not in a framework
  • Test with high ROI with smart testing strategies
  • Make code testable and don’t let more than one invocation of new Date() sneak into your code
  • Start your app in full in-memory mode by default
  • Separate write model and read model
  • Master transferrable skills that will outlive your enterprise framework du jour

Training Program

The content of our program can be customised during pre-training analysis.

  1. Engineering techniques and principles
    1. Minimal dependencies
    2. Curried functions over classes
    3. Parse don’t validate
    4. Robustness principle
    5. Full in-memory mode by default
    6. Feature-driven architecture
    7. Composition over convention
    8. End-to-end type safety
    9. Programming in a language, not in a framework
    10. Feature-flag driven development
  2. Architectural building blocks and concepts
    1. Pipes and filters (express.js middleware and handlers)
    2. Ports and adapters
    3. Routers/controllers (express.js)
    4. Application services
    5. Repositories
    6. Error handlers
    7. Domain types and tiny types
    8. Input and output parsers
    9. DTOs for free
    10. Composition roots
    11. Write model vs read model
    12. External read model (view model) vs internal read model
    13. Application scope and request scope
  3. Testing strategies
    1. Unit of behavior tests (mocha)
    2. Integration tests (mocha)
    3. Component tests (supertest)
    4. Testing without mocks
    5. Testing difficult dependencies (time, id generation)
    6. Data cleanup strategy
  4. Integration with a SQL database
    1. DB migrations
    2. Type generation from DB schema
    3. Verifying repository contract
    4. SQL query builder
    5. Handling DB transactions
  5. Type-safety
    1. Type-safe config (zod)
    2. Type-safe DB queries (kysely)
    3. Type-safe input and output (zod)
    4. Type-safe dependency injection
    5. Type-safe API paths (static-path)


Download PDF

Trainers

Meet the experts who will conduct your training.

Contact us for a free consultation.

Firstname and lastname:
Company:
E-mail:
Phone:
Subject:
Message:

If you prefer direct contact then you can always call.

Iwona Sobótka

Training coordinator


I agree to the processing of my personal data in accordance with the Law on the Protection of Personal Data in connection with sending a request via the contact form.

Providing the data is voluntary but necessary to process the query. I have been informed that I have the right to access my data, the possibility of correcting them, demanding stopping their processing.

The administrator of personal data is Bottega IT Minds, ul. Jana Sawy 2, 20-632 Lublin, Poland.


The information clausule