GithubHelp home page GithubHelp logo

graphql-boilerplate's Introduction

GraphQL Boilerplate

Prisma 1.30 + GraphQL Yoga + Typescript

Before Starting

  1. Install prisma cli: npm install -g prisma

  2. Install docker

  3. Launch Prisma and the connected database: docker-compose up -d

    Prisma is now connected to a local database and runs on http://localhost:4466

  4. Set your envars inside config/dev.env

    PRISMA_ENDPOINT=http://localhost:4466
    PRISMA_SECRET=pi389xjam2b3pjsd0
    JWT_SECRET=23oijdsm23809sdf
  5. Deploy the Prisma datamodel: prisma deploy -e config/.env.dev

    This step generates the Prisma client automatically, also you can generate it again by running prisma generate, and seeds the database with testing data, also you can seed whenever you want by running yarn database:seed

Note: For more info about how to set up prisma with a new or existing database here

Getting Started

  1. Install dependencies:

    yarn or npm install

  2. Run in local env:

    yarn dev or npm run dev

  3. Visit: http://localhost:4000

Using Prisma

Entering to the database prisma

You can access to your database by running prisma admin -e config/.env.dev

Generating a prisma token

You can generate an access token to use it at the playground by running prisma token -e config/.env.dev

Note: Remember you need to put your access token generated as a http header when you query using playground

{
	"Authorization":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiY2p1ZWlxd2NpMDBreDA4NjFrbDhnYjc1cyIsInJvbGUiOiJBZG1pbiJ9LCJpYXQiOjE1NTUxMDM1NTYsImV4cCI6MTU1NTcwODM1Nn0.4Y3QdckBpyk9xZcJhQsZlzVPfWbGSnpivaFTHAwQ0PU"
}

Features

  • Basic sign up
  • Basic login with user and password
  • JWT Authentication
  • Authentication Middleware
  • Authorization Middleware based on roles (User, Admin and Super)
  • Set of directives for input validations
  • Limitation of graph depth

Uses

graphql-boilerplate's People

Contributors

raulingg avatar renovate-bot avatar

Watchers

 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.