Skip to content

Fastify example with funcional and typesafe approach

Notifications You must be signed in to change notification settings

inaiat/fastify-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fastify-sample

| Statements | Branches | Functions | Lines | jscpd

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
  2. Papr (Typesafe schemas for mongodb ) -> https://plexinc.github.io/papr/#/
  3. Awilix (Dependency Inejection) -> https://github.com/jeffijoe/awilix
  4. Ava (Test Runner) -> https://github.com/avajs/ava
  5. Fastify -> https://github.com/fastify/fastify

How to run:

git clone git@github.com: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