This repository is an example of using the fp-ts
functional library for TypeScript. It is a real-world API project that integrates Prisma
for ORM functionality and Redis caching.
The purpose of this project is to demonstrate various features and concepts of fp-ts
, such as pipe
, TE (TaskEither)
, TE.bind
, TE.map
, TE.mapLeft
, TE.tryCatch
, getOrElse
, and omit
. Additionally, it showcases the usage of io-ts
for input and response codec checking.
This repository provides a real-world API project that utilizes the fp-ts
functional library for TypeScript. It is designed to help developers who want to get started with fp-ts
but lack official documentation or guidance on where to begin. While the code and logic in this repository have been cleaned up, they were initially collected from production code.
- Integration of
fp-ts
functional library for TypeScript - Usage of
Prisma
for ORM functionality - Integration of Redis caching for improved performance
- Demonstrations of various
fp-ts
concepts, such as:pipe
TE (TaskEither)
TE.bind
TE.map
TE.mapLeft
TE.chain
TE.tryCatch
getOrElse
omit
- Input and response codec checking using
io-ts
To get started with this project, follow these steps:
- Clone the repository:
git clone [email protected]:panasun/fp-ts-prisma-redis.git
- Install the required dependencies:
yarn install
- Configure the necessary environment variables (if applicable).
- Run the application:
yarn start
- Access the API at
http://localhost:3000
Contributions to this project are welcome. You are encouraged to contribute by submitting examples that help newbies kickstart their journey with fp-ts
. To contribute, please follow these guidelines:
- Fork the repository.
- Create a new branch for your contribution.
- Make the necessary changes and commit them.
- Push your changes to the branch.
- Submit a pull request outlining the changes you have made.
If you have any questions or need further assistance, please feel free to reach out to me via email at [email protected].
I would like to express my gratitude to gcanti for developing the fp-ts
library, which has greatly facilitated the use of real functional programming in TypeScript.