G33kNoob / fastify-boilerplate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to fastify-starter 👋

Version License: MIT Twitter: jellydn

Fastify Typescript Starter

Deploy

Features

Install

yarn install

Usage

yarn start

Swagger UI

http://localhost:3000/documentation

https://gyazo.com/6cf6c02cb36f9d4fababdde1ad071aba.gif

GraphQL

Run below command in your terminal/CLI

curl -H "Content-Type:application/graphql" -XPOST -d "query { hello }" http://localhost:3000/graphql | jq .

Output:

{
  "data": {
    "hello": "Hello World!"
  }
}

Run tests

yarn test

Deployment

This template comes with two GitHub Actions that handle automatically deploying your app to production and staging environments.

Prior to your first deployment, you'll need to do a few things:

  • Install Fly

  • Sign up and log in to Fly

    fly auth signup
  • Create two apps on Fly, one for staging and one for production:

    fly create fastify-starter
    fly create fastify-starter-staging
  • Create a new GitHub Repository

  • Add a FLY_API_TOKEN to your GitHub repo. To do this, go to your user settings on Fly and create a new token, then add it to your repo secrets with the name FLY_API_TOKEN.

Now that every is set up you can commit and push your changes to your repo. Every commit to your main branch will trigger a deployment to your production environment, and every commit to your dev branch will trigger a deployment to your staging environment.

GitHub Actions

We use GitHub Actions for continuous integration and deployment. Anything that gets into the main branch will be deployed to production after running tests/build/etc. Anything in the dev branch will be deployed to staging.

Author

👤 Huynh Duc Dung

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator

About


Languages

Language:TypeScript 96.4%Language:Dockerfile 2.9%Language:Shell 0.6%Language:Procfile 0.1%