Exploring the repository pattern with TypeScript and Node

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • nestjs-objection

    NestJS module for Objection

  • Next, let’s set up the database for our newly created Nest application. I’ll be using PostgreSQL, but you can use any of the databases Knex supports. To interact with our database, we’ll be using Objection.js, which is an ORM for Node.js built on top Knex. For this tutorial, we’ll be using Nest Objection, a Nest module for Objection.

  • nest-repository-pattern

  • You can get the complete source code for our demo from this GitHub repository.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • Prisma

    Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB

  • That’s how to use the repository. If down the line in the course of the project we decide to switch data access layer to something like Prisma, we’ll just need to create a PrismaPostRepository class that implements the PostRepositoryInterface:

  • Objection.js

    An SQL-friendly ORM for Node.js

  • Next, let’s set up the database for our newly created Nest application. I’ll be using PostgreSQL, but you can use any of the databases Knex supports. To interact with our database, we’ll be using Objection.js, which is an ORM for Node.js built on top Knex. For this tutorial, we’ll be using Nest Objection, a Nest module for Objection.

  • Nest

    A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀

  • Like most design patterns, the repository pattern is language agnostic. With that in mind, I’ll be showing how to implement the repository with TypeScript and Node.js. For the purpose of demonstration, I’ll be using Nest, a Node.js framework.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts