After watching the talk "Domain Modeling Made Functional" from Scott Wlaschin, I got inspired to write a series of articles about Domain Driven Design (DDD for short) in TypeScript. Since this talk is about DDD using Functional Programming (FP), I chose to use the fp-ts ecosystem because, as far as I know, it's the most mature FP stack in TypeScript.
The articles are available on dev.to:
- Introduction
- The domain and some concepts
- Using fp-ts and newtype-ts: types
- Using fp-ts and newtype-ts: implementation
- Using fp-ts and io-ts: types and implementation
This project was built using Node v15.2 and npm v7. If you have nvm, you can use the nvm use
command at the root of the project.
npm ci
To run the code that uses the first method (fp-ts + newtype-ts), you can use the following command:
npm run run-method-1
To run the code of the second method (fp-ts + io-ts), you can run:
npm run run-method-2