Skip to content

dwoodwardgb/repository-pattern-in-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A TS-first approach to the repository pattern in Node, with Zod and Mongo

I was heavily inspired by DevMastery's implementation of clean architecture in Node and I wanted to try and achieve something similar but with a typescript-first approach.

The main idea behind this implementation was to try and deliniate which fields are visible and mutable in each CRUD action.

Todo

  • Generalize the pattern so that a "repository" can be created when given Zod parsers for each of its 3 (CRU) types.
  • Add common sense defaults for pagination and sorting options on the read() method.
  • Add unit tests that formalize assumptions about how Zod's transform() function works

About

A TS-first approach to the repository pattern in Node, with Zod and Mongo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published