Category: TypeScript

JavaScript NestJS TypeScript

API with NestJS #14. Improving performance of our Postgres database with indexes

This entry is part 14 of 187 in the API with NestJS

As our system grows, certain queries on our database might fail us in terms of performance. One of the popular ways of dealing with this issue are indexes. This article explores how we can use them both through TypeORM and writing our own Postgres queries. Introduction to indexes When we store information on a disk, […]

JavaScript React TypeScript

Building forms with React Hook Form and TypeScript

Handling forms manually is not difficult in React. Keeping all of the code consistent in your project might be quite a hassle, though. There are many ways in which we can tackle the state of our forms and validation. We can expect the approach of our teammates to differ slightly. To manage our forms better, […]

JavaScript React TypeScript

React Context API with hooks and TypeScript

With React, we have quite a few options when it comes to state management. One of the most obvious ones is using the local state. Unfortunately, it might lead to prop drilling. It happens when we pass data from one component through many layers. When some of the components along the way do not need the […]

JavaScript NestJS TypeScript

API with NestJS #12. Introduction to Elasticsearch

This entry is part 12 of 187 in the API with NestJS

We can find some searching functionalities in a lot of web applications. While we might be fine when iterating through a small data set, the performance for more extensive databases can become an issue. Relational databases might prove to be relatively slow when searching through a lot of data. A solution to the above problem […]

Express JavaScript NestJS Testing TypeScript

API with NestJS #9. Testing services and controllers with integration tests

This entry is part 9 of 187 in the API with NestJS

In the previous part of this series, we’ve focused on unit tests. This time, we look into integration tests. In this article, we explain their principles and how they differ from unit tests. We write a few of them using Jest to test our services. We also look into the SuperTest library to test our controllers. […]

JavaScript NestJS TypeScript

API with NestJS #8. Writing unit tests

This entry is part 8 of 187 in the API with NestJS

Testing our application can increase our confidence when it comes to creating a fully-functional API. In this article, we look into how we can test our application by writing unit tests. We do so by using some of the utilities built into NestJS, as well as the Jest library. If you would like to get […]