Express Graphql Boilerplate

screenshot of Express Graphql Boilerplate
express

Express Graphql Boilerplate

Express GraphQL API with JWT Authentication and support for sqlite, mysql, and postgresql

Overview

The express-graphql-boilerplate is a GraphQL API template that supports JWT authentication and has built-in support for SQLite, MySQL, and PostgreSQL databases. It also includes support for graphiql, which is a tool for exploring and testing a GraphQL API. This boilerplate provides environments for development, testing, and production, and includes linting via eslint and integration tests with Jest. It is built using npm scripts and includes examples for User, Note, and nested GraphQL Queries.

Features

  • Authentication via JWT: Provides authentication using JSON Web Tokens (JWT).
  • Database support: Supports SQLite, MySQL, and PostgreSQL databases.
  • Graphiql support: Includes support for graphiql, an easy way to explore and test a GraphQL API.
  • Environments: Provides separate environments for development, testing, and production.
  • Linting via eslint: Includes linting using eslint for code quality and consistency.
  • Integration tests with Jest: Includes integration tests running with Jest for testing the API.
  • Built with npm scripts: Utilizes npm scripts for build, run, and test commands.
  • Examples for User, Note, and nested GraphQL Queries: Includes example implementations for User, Note, and nested GraphQL Queries.

Installation

To install and use the express-graphql-boilerplate, follow these steps:

  1. Clone this repository to your local machine.
  2. Choose the desired database to use (SQLite, MySQL, or PostgreSQL).
  3. Set the appropriate database configuration in the config/database.js file.
  4. Install the required dependencies by running the command npm install.
  5. Start the server by running the command npm start.

Summary

The express-graphql-boilerplate is a comprehensive GraphQL API template that includes support for authentication, multiple databases, and testing. It also provides a user-friendly way to explore and test the API using graphiql. With its intuitive folder structure and examples for common entities, developers can quickly get started with building their own GraphQL API.

express
Express

Express.js is a simple Node.js framework for single, multi-page, and hybrid web applications.

fullstack
Fullstack Boilerplates

A fullstack boilerplate provides a starter application that includes both frontend and backend. It should include database, auth, payments, user roles and other backend services to build a fully featured saas or webapps.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

graphql
Graphql

A website that uses GraphQL as a query language to manage data fetching and state management. This includes features such as a strongly typed schema, client-side caching, and declarative data fetching to streamline data management and optimize website performance.