Giter Club home page Giter Club logo

eomm / fastify-in-practice Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 0.0 550 KB

๐Ÿ‡ฎ๐Ÿ‡น Fastify ha una solida architettura a plugin, รจ altamente performante, supporta Typescript e pensa alla developer experience per rendere meno arduo lo sviluppo a noi programmatori. Ma tutto questo cosa vuol dire in pratica? Scopriamolo insieme, creando delle API per la nostra startup. Saliremo poi in una macchina del tempo per vedere come evolve nel tempo il backend scritto con Fastify per capire i vantaggi che questo framework offre durante tutto il ciclo di vita di un software.

License: MIT License

Makefile 6.23% JavaScript 93.77%
mongodb fastify api rest talk

fastify-in-practice's Introduction

fastify-in-practice

Welcome to this CRUD application. Read the blog post at https://backend.cafe//how-to-use-fastify-and-mongodb for more information:!

How to use

To start the project you need to run the following command:

# checkout the project
npm install
npm run mongo:start
npm run dev

To try the API you can use the following command:

make post text="hello world"
make get
make put id=61742e31dda30cab65317784
make delete id=61742e31dda30cab65317784

How it has started

This repo has been created to create a talk about fastify at the Code to Code 2021 Italian Conference.

  • Video on YouTube (Lang: ๐Ÿ‡ฎ๐Ÿ‡น)
  • Slides from the talk (Lang: ๐Ÿ‡ฎ๐Ÿ‡น)

The talk incipit ๐Ÿ‡ฎ๐Ÿ‡น

Fastify ha una solida architettura a plugin, รจ altamente performante, supporta Typescript e pensa alla developer experience per rendere meno arduo lo sviluppo a noi programmatori. Ma tutto questo cosa vuol dire in pratica? Scopriamolo insieme, creando delle API per la nostra startup. Saliremo poi in una macchina del tempo per vedere come evolve nel tempo il backend scritto con Fastify per capire i vantaggi che questo framework offre durante tutto il ciclo di vita di un software.

Talk summary ๐Ÿ‡ฎ๐Ÿ‡น

La progressione di questa applicazione รจ suddivisa in branch:

  • one-init: lo stato iniziale, con l'essenziale per partire come questo README
  • two-init: lo stato consolidato di partenza per la seconda parte. Dovrebbe coincidere con one
  • main: lo stato finale del talk

Per provare le chiamate ai servizi senza lasciare la shell, รจ possibile richiamare il Makefile:

# make <comando> <param=valore>
make post text="Fare la spesa"
make get

Step one

  • Preparazione del progetto
  • Logging
  • Creazione delle routes
  • Connessione al database
  • Validazione input
  • Configurazione applicazione
mkdir fastify-in-practice
cd fastify-in-practice
npm init --yes
npm install fastify fastify-mongodb
npm install standard pino-pretty -D
code server.js

Step two

  • Test legacy
  • Estrai plugin
  • Siblings plugin
  • Aggiungi autenticazione
npm install tap mongo-clean -D
npm install fastify-basic-auth

Further reading

You may find inspiration on the following projects:

fastify-in-practice's People

Contributors

eomm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.