Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

ctco/nodejs-graphql-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c433162 · Jan 14, 2019
May 11, 2018
Jan 14, 2019
Jan 14, 2019
Nov 9, 2017
Nov 4, 2017
May 8, 2017
Nov 17, 2017
Feb 17, 2018
Jun 15, 2017
Sep 22, 2017
Aug 16, 2018
Aug 16, 2018
May 8, 2017
Jan 14, 2019
May 11, 2018
Jan 14, 2019
Jun 1, 2017
Jan 14, 2019
Apr 6, 2018
Jan 14, 2019
Jan 14, 2019

Repository files navigation

Maintenance PRs Welcome Build Status TravisCI Build Status AppVeyor dependencies Status devDependencies Status

nodejs-graphql-template

Node.js, Koa, GraphQL and TypeScript template project.

Batteries and opinions included 🙌

Features

  • Docker 🐳 configuration for production deployment, development and testing

  • GraphQL tools:

    • GraphiQL
    • GraphQL Voyager
    • GraphQL Playground
    • GraphQL IDL
    • Apollo Tracing
  • Reference GraphQL Models and Connectors architecture implementation

  • CORS middleware

  • 12 Factor Configuration with .env

  • Configurable logging

    • powered by winston
  • Supercharged Development Mode

    • Incremental TypeScript builds
    • Automatic server restart on changes
    • Linting
  • Testing

    • Unit tests
    • Integration tests for GraphQL schema
  • Reporting

    • Test result export to JUnit format
    • Coverage result export to Cobertura format

Required Software

  • node >= 8.1.4 & yarn

or

  • Docker >= 17.05

Install

  • yarn: $ yarn
  • Docker: $ docker-compose up

Develop

  • yarn: $ yarn start
  • Docker: $ docker-compose up --build

Attention Windows users: when Docker for Windows is not an option, install yarn and run $ yarn && yarn docker-mount beforehand.

Generate TypeScript types for GraphQL schema and default GraphQL resolvers

$ yarn gqlgen

Test

single test run

Run unit tests

$ yarn test:unit

Run integration tests

$ yarn test:integration

Run all tests

$ yarn test

Run e2e tests

Run the app or point E2E_TEST_URL to a remote instance you want to test against.

$ yarn test:e2e

Generate coverage reports

Set environment variable CI to true to generate coverage reports.

In *nix:

CI=true yarn test

In Windows:

set CI=true&&yarn test

Build

$ yarn build or $ docker build .

Tech Stack