Skip to content

๐Ÿ™ Tutorial and Examples of how to work with Fastify, GraphQL and PouchDB. Working via REST API and GraphQL API with Postman and GraphiQL.

Notifications You must be signed in to change notification settings

JoseJPR/tutorial-fastify-graphql-pouchdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

39 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Tutorial Fastify with GraphQL and PouchDB

standard-readme compliant Twitter: JoseJ_PR

Banner

๐Ÿ”– Description

Tutorial and Examples of how to work with Fastify, GraphQL and PouchDB. Working via REST API and GraphQL API with Postman and GraphiQL.

๐Ÿ“น Video Demo

The following videos shows how you can work with this project and execute request to the REST API from Postman and to the GraphQL API from Postman and from GraphiQL.

  • Run NPM Install and create seed for the first Start.
    Video 1

  • How work with Rest API via Postman
    Video 2

  • How work with GraphQL API via Postman
    Video 3

  • How work with GraphQL API via GraphiQL
    Video 4

๐Ÿ“Œ Methodologies and Guidelines

List of methodologies and tools used in this project for compliance with Quality Assurance Code (QAC)

โšก๏ธ Technologies and Tools

The project structure has been created with Yeoman and Generator Standard REST API Projects.

The main libraries and tools used in this project are:

โœ… Prerequisites

In order to work with this project, your local environment must have at least the following versions:

  • NodeJS Version: 12.xx
  • NPM Version: 6.12.0

๐ŸŒ€ Workflow HTTP REST API

With these two graphs I want to expose the life cycle when we use the endpoints with GraphQL and without it.

Fastify and PouchDB Banner

Fastify, GraphQL and PouchDB Banner

๐Ÿ“ How to work with this project

You have to do the following steps to be able to work with this project.

1๏ธโƒฃ Install NodeJS Dependencies

To work with this project locally and to be able to deploy in different environments, it is necessary to install the NPM dependencies.

# Install npm dependencies
$npm i

2๏ธโƒฃ Development

To add the seed for /articles endpoints you will have to execute the following command:

# Seed
$npm run create:seed

To run the project locally and to develop you will have to execute the following command (You will see a message on your terminal with the address and port of the local server):

# Run
$npm run start:watch

To run the unit tests of this project you will have to execute the following command:

# Tests
$npm run test

๐Ÿ”Œ Enviroments files

If you have selected one or more environments you will see an env file for each environment that you can modify. The complete list of the .env files that you should have in the "env" folder should be:

  • .env.local

๐Ÿ“‚ Code scaffolding

/
โ”œโ”€โ”€ assets ๐ŸŒˆ               # Images Sources.
โ”œโ”€โ”€ doc
|   โ”œโ”€โ”€ api ๐Ÿš               # Api Versions.
|   โ”œโ”€โ”€ qac ๐Ÿ”ฐ              # Quality Assurance Code.
โ”œโ”€โ”€ env ๐Ÿ”Œ                  # Configure enviroments deploy.
โ”œโ”€โ”€ src
|   โ”œโ”€โ”€ __mocks__ ๐Ÿ‘ป        # Mocks data for test.
|   โ”œโ”€โ”€ __tests__ ๐Ÿšฅ        # Unit tests.
|   โ”œโ”€โ”€ config              # Generic config.
|   โ”œโ”€โ”€ controllers         # Controllers.
|   โ”œโ”€โ”€ libs                # Custom libreries and tools.
|   โ”œโ”€โ”€ resolvers           # GraphQL Resolvers.
|   โ”œโ”€โ”€ routes              # Routes.
|   โ”œโ”€โ”€ services            # Services.
|   โ”œโ”€โ”€ shemas              # GraphQL Shemas.
|   โ”œโ”€โ”€ types               # TypeScript types.
|   โ””โ”€โ”€ ...
โ””โ”€โ”€ ...

๐Ÿ“ฆ Core and Libraries

This project is based on the Fastify framework as a core for the development of the project structure and with custom libraries.

๐Ÿš  API Documentation

Version DOC Postman
REST More Info Collection
GraphQL More Info Collection

๐Ÿ”ฎ GraphiQL

GraphiQL is the reference implementation of this monorepo, GraphQL IDE, an official project under the GraphQL Foundation.

You can to work with the GraphiQL IDE in your browser.

โ›ฝ๏ธ Review and Update Dependences

For review and update all npm dependences of this project you need install in global npm package "npm-check-updates" npm module.

# Install and Run
$npm i -g npm-check-updates

# Run library to check npm modules
$ncu

Happy Code

Created with JavaScript, lot of โค๏ธ and a few โ˜•๏ธ

This README.md file has been written keeping in mind

About

๐Ÿ™ Tutorial and Examples of how to work with Fastify, GraphQL and PouchDB. Working via REST API and GraphQL API with Postman and GraphiQL.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published