Coder Social home page Coder Social logo

fastify-ts-starter's Introduction

fastify with typescript

Node.js CI

Integrations covered here:

  • local development setup
  • prettier and lint with editor integration
  • integration with a database
  • debugging (launch configurations for vscode for app and jest tests)
  • deployment
  • error logging

Tools:

convict

Used to create a schema for configuration and verify it at run time

copyfiles

Used to copy non typescript file into the dist dirctory during build

ts-node-dev

Restarts on file changes but re-uses compiled files as it can

json-schema-to-typescript

Used to convert the json schemas used by fastify for request/response typing into typescript typings.

Majestic

Jest interactive test runner. Should install globally

Dbmate

Golang tool for database migrations (updates the schema dump in db directory)

Dbmate Commands

dbmate           # print help
dbmate new       # generate a new migration file
dbmate up        # create the database (if it does not already exist) and run any pending migrations
dbmate create    # create the database
dbmate drop      # drop the database
dbmate migrate   # run any pending migrations
dbmate rollback  # roll back the most recent migration
dbmate down      # alias for rollback
dbmate status    # show the status of all migrations (supports --exit-code and --quiet)
dbmate dump      # write the database schema.sql file
dbmate wait      # wait for the database server to become available

Actions

npm run db:dev:start     # bring up a docker image for postgres development server (see services README)
npm run db:dev:stop      # bring down the docker image for postgres development server (see services README)
npm run db:dev:clean     # starts a fresh dev postgres docker image and creates an empty database in it (follow with dbmate up to get full schema)
npm run db:test:clean    # starts a fresh test postgres docker image and creates an empty database and then uses schema.sql to create

https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-migrate prisma db setup

npx prisma migrate save --experimental
npx prisma migrate up --experimental
npx prisma generate

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.