Tutorial and Examples of how to work with Fastify, GraphQL and PouchDB. Working via REST API and GraphQL API with Postman and GraphiQL.
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.
List of methodologies and tools used in this project for compliance with Quality Assurance Code (QAC)
- TypeScript, These projects provide templates which include TypeScript support.
NPM TypeScript - ESTlint, tool for identifying and reporting on patterns found in ECMAScript/JavaScript code.
NPM ESLint
NPM ESLint | Airbnb - Jest, delightful JavaScript Testing.
NPM Jest - SuperTest, HTTP assertions made easy via superagent.
NPM SuperTest - Mozilla, Standard HTTP response status codes.
HTTP Status MOZILLA
The project structure has been created with Yeoman and Generator Standard REST API Projects.
The main libraries and tools used in this project are:
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
With these two graphs I want to expose the life cycle when we use the endpoints with GraphQL and without it.
You have to do the following steps to be able to work with this project.
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
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
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
/
โโโ 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.
| โโโ ...
โโโ ...
This project is based on the Fastify framework as a core for the development of the project structure and with custom libraries.
Version | DOC | Postman |
---|---|---|
REST | More Info | Collection |
GraphQL | More Info | Collection |
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.
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
Created with JavaScript, lot of โค๏ธ and a few โ๏ธ