Company
Date Published
Author
Ely Lucas
Word count
2739
Language
English
Hacker News points
None

Summary

The second part of the Full-stack TypeScript with Ionic and NestJS series delves into enhancing the backend of the GoSpaceRanger app by incorporating a database to store mission data, using TypeORM to manage database interactions. TypeORM, an object-relational mapper written in TypeScript, facilitates the creation and management of database tables and columns based on TypeScript classes. The tutorial demonstrates setting up TypeORM with PostgreSQL, creating a Mission entity with decorators for database schema generation, and employing a repository pattern for data manipulation. Additionally, it introduces the use of class-transformer for data serialization and NestJS features like interceptors and pipes to streamline data handling and maintain clean, reusable code. The updated backend now supports live data retrieval, excluding unnecessary metadata from responses, and allows fetching individual missions by ID with type conversion handled automatically by custom pipes. The series promises to further develop the app by adding functionality for creating, updating, and deleting missions in the upcoming installment.