GithubHelp home page GithubHelp logo

nearform / the-fastify-workshop Goto Github PK

View Code? Open in Web Editor NEW
116.0 75.0 29.0 13.48 MB

A workshop about Fastify

Home Page: https://nearform.github.io/the-fastify-workshop/

License: Creative Commons Attribution Share Alike 4.0 International

JavaScript 86.18% CSS 1.22% TypeScript 12.60%
fastify workshop

the-fastify-workshop's Introduction

The Fastify Workshop

ci

Slideshow Presentation

The Fastify Workshop Slides

Requirements

Setup

  • npm ci
  • npm run db:up
  • npm run db:migrate

Run automated tests

  • npm test --workspaces

Run automated tests on a single project

  • npm test -w src/step-05-testing

Running the modules

  • cd src/step-{n}-{name}
  • check each module's README file to see which scripts are available

Presenting

  • npm start

the-fastify-workshop's People

Contributors

akallabet avatar barelyhuman avatar brainrepo avatar castarco avatar d-pagey avatar dependabot[bot] avatar eomm avatar eugenio-oddone avatar g100g avatar gergohorvathnearform avatar guilhermelimak avatar hizo avatar ilteoood avatar jhonrocha avatar lbittencurt avatar luke88jones avatar marco-ippolito avatar marquicodes avatar mcollina avatar melkornemesis avatar p16 avatar rafaelgss avatar rafaelhz avatar ramonmulia avatar sameer-coder avatar simoneb avatar snyk-bot avatar tiagoheliob avatar vaclav-zeman avatar williamlines avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

the-fastify-workshop's Issues

Add hosted slides link to README

If someone is relying on just the README then they could easily miss the hosted slides link. It would be helpful to make it more obvious how to proceed through the workshop with the slides front and center in the README.

Make the type checking work

Check how to turn on the types checking works on the IDE for the serialization after setting the JSON schemas.

Database section localhost -> 0.0.0.0

On page 74 the following postgres address is suggested
PG_CONNECTION_STRING=postgres://postgres:postgres@localhost:5433/postgres
This didn't work for me, and resulted in the following error message:

req: {
      "method": "POST",
      "url": "/login",
      "hostname": "localhost:3000",
      ...
    }
    res: {
      "statusCode": 500
    }
    err: {
      "type": "Error",
      "message": "connect ECONNREFUSED ::1:5433",
      "stack":
          Error: connect ECONNREFUSED ::1:5433
              at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
      "errno": -61,
      "code": "ECONNREFUSED",
      "syscall": "connect",
      "address": "::1",
      "port": 5433
    }
 ...

As you can see the address points to ::1. After discussing this with @SociableSteve it appears to be that using localhost doesn't work in PG_CONNECTION_STRING. Replacing it with 0.0.0.0 resolved the issue, and would recommend this change, however, my understanding of it is limited, and so if there is a better way, please let me know.

Make fastify workshop slides scrollable

Problem
At the moment when the content is higher than the available height, the offset is invisible:
Screenshot 2023-08-15 at 17 21 36

Solution
Make the container scrollable so the offset can be viewed.

Fix css issue

Slides have an issue with the div of the copyright

Fix step 9 to import newly created plugin

Whilst the decorator created in step 9 is not used at this point, the plugin also includes the registration of fastify-jwt and without this the /users route will crash.

Migrate to Node's test runner

Tap has been causing issues recently due to major changes in the latest versions.

Because we're not using any tap-specific features in this repo, we should consider migrating to Node's built-in test runner.

Only one exercise per step

Currently a few steps have more than one exercise in them. Those should be split into multiple steps.

fix tests timing out

it seems that the tests have been failing more consistently as of late. let's fix them and go back to a consistently green build

Unable to start

I run npm start and I'm getting:

2:10:28 PM [vite] Internal server error: EMFILE: too many open files, open '/Users/matteo/repositories/the-fastify-workshop/src/step-2/node_modules/@babel/generator/node_modules/source-map/README.md'
   (x3)
node:internal/process/promises:246
          triggerUncaughtException(err, true /* fromPromise */);
          ^

[Error: EMFILE: too many open files, open '/Users/matteo/repositories/the-fastify-workshop/components.d.ts'] {
  errno: -24,
  code: 'EMFILE',
  syscall: 'open',
  path: '/Users/matteo/repositories/the-fastify-workshop/components.d.ts'
}

I don't know what is the problem.

Replace nf-present with Slidev

At the moment, the Fastify-workshop uses nf-present to build the slide-deck for presentation.

A Nearform slidev template is available here which has better support for content formatting and already has NF design.

Migrate the Fastify workshop from using nf-present to slidev

Coverage at zero

Using ESM the tests show ZERO coverage.

We should fix this behaviour

image

`work-here` folder easy to miss

When self-serving the fastify workshop, I missed both the hosted slides and the work-here folder. Instead, I just went through from step-01-hello-world which I later realised were the solutions.

If we changed the work-here to start-here then it will appear before all the solutions avoiding future confusion.

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.