Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inaiat/fastify-sample
Fastify example with funcional and typesafe approach
https://github.com/inaiat/fastify-sample
ava awilix dependency-injection esm esmodules fastify fastify-plugin functional-programming mongodb mongodb-driver mongodb-native-driver neverthrow papr plugins test
Last synced: about 2 months ago
JSON representation
Fastify example with funcional and typesafe approach
- Host: GitHub
- URL: https://github.com/inaiat/fastify-sample
- Owner: inaiat
- Created: 2021-12-15T01:43:13.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-15T13:47:47.000Z (over 2 years ago)
- Last Synced: 2024-10-12T03:09:29.275Z (2 months ago)
- Topics: ava, awilix, dependency-injection, esm, esmodules, fastify, fastify-plugin, functional-programming, mongodb, mongodb-driver, mongodb-native-driver, neverthrow, papr, plugins, test
- Language: TypeScript
- Homepage:
- Size: 850 KB
- Stars: 3
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fastify-sample
| ![Statements](https://img.shields.io/badge/statements-76.38%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-84%25-yellow.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-68.75%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-76.38%25-red.svg?style=flat) | ![jscpd](https://raw.githubusercontent.com/inaiat/fastify-sample/main/assets/jscpd-badge.svg?sanitize=true)**Fastify version 4 sample with functional approach**
This project is a small but feature complete application build with Fastify, native mongodb driver and papr (typesafe models for mongodb),
and it aims to show functional approach, dependency injection and type safe programming.* Update 2022-07-14 -> This project is pure native ESM! :D
Useful links of libs that we use on this project:
1. NeverThrow (avoid throwing exceptions) -> https://github.com/supermacro/neverthrow
1. Papr (Typesafe schemas for mongodb ) -> https://plexinc.github.io/papr/#/
1. Awilix (Dependency Inejection) -> https://github.com/jeffijoe/awilix
1. Ava (Test Runner) -> https://github.com/avajs/ava
1. Fastify -> https://github.com/fastify/fastifyHow to run:
```
git clone [email protected]:inaiat/fastify-sample.git
cd fastify-sample
docker run -d -p 27017:27017 mongo
yarn dev
```If everything went well you can play here -> http://localhost:3000/docs