Code Monkey home page Code Monkey logo

fastify-rest-graphql-api's Introduction

Build Status codecov MIT Licence Open Source Love

Fastify REST GraphQL API Boilerplate

Note: in demo, I disabled email

Built with πŸ’–


Features 🎁

  • User Auth functionality (Signup, Login, Forgot Password, Reset Password)
  • JWT Authentication
  • REST API
  • Dependency injection
  • Configs via environmental variables
  • Email notification (Welcome email, Reset password email)
  • Knex with Postgres implementation
  • Unit tests
  • Travis CI
  • Badges (coverage, opesn source, MIT, up-to-date dependencies)
  • MIT LICENSE
  • GraphQL API
  • GraphQL playground
  • Swagger REST API documentation
  • Diagram
  • ? Auto migration (optional via env var)

component diagram

diagram

swagger

swagger

graphql playground

swagger


Run locally πŸš™

Envronmental variables, see ./config. You can customize the ./config/default.json and ./config/custom-environment-variables.json.

You can put .env in root of repo as well

MAILGUN_API_KEY=key-b9jksfh8s9843uhfsdhds
MAILGUN_DOMAIN=xxxxx.mailgun.org

LOG_LEVEL=info

APP_DB_TYPE=postgres
APP_DB_HOST=localhost
APP_DB_PORT=5432
APP_DB_DB=my-db
APP_DB_USER=local-user
APP_DB_PASSWORD=password

JWT_SECRET=secret
JWT_EXPIRES_IN=3h

ENV=development

APP_PORT=3000
APP_HOST=http://localhost

Run

# Terminal 1
docker-compose up        # docker-compose up (Run postgres)
docker-compose down      # docker-compose down (Shutdown postgres)

# Terminal 2
yarn migrate           # Migrate DB
yarn rollback          # Rollback migration
yarn dev               # Run application
yarn test              # Run unit tests (lint & format code as well)
yarn build             # Build application

You can see graphql playground at http:/localhost:3000/graphql once application is up and running.

You can see swagger REST API docs at http:/localhost:3000/docs once application is up and running.

See more commands in ./package.json

fastify-rest-graphql-api's People

Contributors

dependabot[bot] avatar

Stargazers

 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.