📄️ Introduction
ExpressoTS offers a refined layer over Express.js, enhancing server-side TypeScript application development. It blends the robustness of Express.js with advanced TypeScript features, streamlining the creation of scalable, maintainable, and readable applications.
📄️ First steps
Begin your journey with ExpressoTS, a TypeScript framework for building scalable and maintainable Node.js applications. This section guides you through the foundational concepts, setup, and architecture of ExpressoTS.
📄️ Application
At the heart of an ExpressoTS application lies the App class. It serves as the foundation for creating and configuring the server. Additionally, the App class allows middleware and providers to be configured in the server bootstrapping process. The App class also provides lifecycle hooks that allow developers to execute code before, after, and on server shutdown. This section provides an overview of the ExpressoTS application architecture, its components, and the workflow of an ExpressoTS application.
📄️ App Container
ExpressoTS leverages InversifyJS for its Inversion of Control (IoC) container capabilities, providing a robust system for dependency injection. This type-aware container facilitates object instantiation, resolution, and life cycle management, enabling the creation of complex dependencies with minimal code.
📄️ Modules
Modules, or container modules in ExpressoTS, are aggregations of services—primarily Controllers and their dependencies—that are managed by the framework's container. These modules facilitate the organization, registration, and resolution of various application components within the ExpressoTS ecosystem.
📄️ Middleware
Middleware functions are pivotal in the request-response cycle of an ExpressoTS application, providing the capability to execute code, modify request and response objects, end the request-response cycle, or call the next middleware in the stack. It's essential to call next() to avoid request timeouts unless your middleware concludes the cycle.
📄️ Controllers
Controllers act as the primary interface between the client and server in ExpressoTS applications. They handle incoming requests, validate payloads against an input DTO, and emit responses in the DTO pattern. In essence, controllers bridge the communication between clients and service layers, also known as use-cases.
📄️ Use Cases
From a UML standpoint, use cases provide a way to model the interactions between users, other systems, and a software application. A use case describes a specific scenario or flow of events between the actors and the system, leading to a certain outcome.
📄️ Providers
In ExpressoTS, providers serve as modular enhancements to an application, encapsulating specific functionalities such as email services, authentication mechanisms, or database connections. This encapsulation is essential for preserving a loosely coupled architecture, enabling seamless swapping or updating of these functionalities without affecting the overall system.
📄️ Repositories
The repository pattern in ExpressoTS provides an abstraction layer for data access, encapsulating CRUD (Create, Read, Update, Delete) operations within repository classes. These repositories act as intermediaries between the business logic and data mapping layers, using ORMs like TypeORM, Prisma or Sequelize to interact with the database.
📄️ Entities
Entities are the core components of an ExpressoTS application. They are the objects that are used to represent the data that is going to be manipulated by the application.
📄️ Decorators
Here is a complete list of all decorators available in ExpressoTS as well as a brief description of what they do.
📄️ Dependency Injection
Dependency Injection (DI) is a design pattern used in software development that involves providing an object with the instances of the classes it needs to perform its tasks, rather than having it construct these instances itself. This process of providing instances is called injecting them, hence the term Dependency Injection.
📄️ Dependencies
The purpose of this section is to list all dependencies used by ExpressoTS and our vision about dependency management.
📄️ Status Code
Status code is a way to represent the result of a request. These HTTP responses indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes:
📄️ Error Handling
When it comes to error handling in Node.js TypeScript APIs, there are several best practices and approaches you can follow. ExpressoTS provides a simple and easy way to handle errors.
📄️ Test
Unit testing and integration testing are both important in any application development process because they serve different purposes.
📄️ Render
Express.js offers a render method to render a view and send the rendered HTML string to the client.