Git Product home page Git Product logo

wpcodevo / nextjs-typegraphql-api Goto Github PK

View Code? Open in Web Editor NEW
25.0 2.0 9.0 204 KB

This article will teach you how to build a full-stack CRUD App with Next.js, React Query, GraphQL Code Generator, React-Hook-Form, Zod, and graphql-request to perform Create/Update/Get/Delete operations.

Home Page: https://codevoweb.com/nextjs-full-stack-app-with-react-query-and-graphql-codegen

Shell 0.24% Makefile 0.07% JavaScript 1.44% TypeScript 98.06% CSS 0.19%
graphql graphql-api graphql-request graphql-server mongodb nextjs-graphql nextjs-typescript react-query nextjs-apolloserver nextjs-graphql-mongodb

nextjs-typegraphql-api's Introduction

GraphQL API with Next.js & MongoDB

1. GraphQL API with Next.js & MongoDB: Access & Refresh Tokens

This article will teach you how to build a GraphQL API with Next.js to implement JWT Authentication using apollo-server-micro, TypeGraphQL, MongoDB, Redis, Mongoose, and Typegoose.

GraphQL API with Next.js & MongoDB: Access & Refresh Tokens

Topics Covered

  • Initialize a Typescript Next.js Project
  • Setup MongoDB and Redis Database Servers
  • Setting up Environment Variables
  • Connect the Redis and MongoDB Servers to Next.js
    • Connect to the MongoDB Server
    • Connect to the Redis Server
  • Start the GraphQL Apollo Server
  • Creating TypeGraphQL and Typegoose Schemas
    • Creating the Typegoose Schema
    • Creating the TypeGraphQL Schemas
  • Creating an Error Handler
  • Create Utility Functions to Generate and Verify JWTs
    • How to Generate the Private and Public Keys
  • Create an Authentication Guard
  • Creating the Authentication Services
    • Service to Register the User
    • Service to Sign in the User
    • Service to Get the Authenticated User
    • Service to Refresh the Access Token
    • Service to Logout the User
  • Create the TypeGraphQL Resolvers
  • Update the GraphQL Server
  • Testing the GraphQL API in Postman

Read the entire article here: https://codevoweb.com/graphql-api-next-mongodb-access-and-refresh-tokens

2. Next.js, GraphQL-CodeGen, & React Query: JWT Authentication

This article will teach you how to add access and refresh token functionalities to your Next.js app using React Query, graphql-request, GraphQL CodeGen, React-Hook-Form, and Zod.

Next.js, GraphQL-CodeGen, & React Query: JWT Authentication

Topics Covered

  • Next.js, React Query & GraphQL-CodeGen Overview
  • Setup React Query & GraphQL CodeGen in Next.js
    • Install and Setup React Query
    • Install GraphQL and GraphQL-Request
    • GraphQL-CodeGen Manual Setup
  • Create the GraphQL Mutations and Queries
    • Sign-up User Mutation
    • Sign-in User Mutation
    • Get Authenticated User Query
    • Refresh Access Token Query
    • Logout User Query
  • Generating the Typescript Types & React Query Hooks
  • Setup tailwindCss in Next.js
  • Creating React Query, Axios & GraphQL Clients
    • GraphQL Request Client
    • Axios GraphQL Request Client
  • State Management with Zustand
  • Creating React Components with TailwindCSS
    • Creating a Loading Spinner
    • Creating the Header Component
    • Creating a Full-Screen Loader
    • Creating a Loading Button
    • Creating an InputField Component with React-Hook-Form
    • Creating a FileUpload with Cloudinary and React
  • React Query & GraphQL Request: Sign-up User
  • React Query & GraphQL Request: Login User
  • React Query & GraphQL Request: Middleware Guard
  • Creaeting the Profile and Home Pages
    • Home Page
    • Profile Page
  • Update the App File

Read the entire article here: https://codevoweb.com/nextjs-graphql-codegen-react-query-jwt-authentication

3. GraphQL CRUD API with Next.js, MongoDB, and TypeGraphQL

This article will teach you how to build a GraphQL API with Next.js to implement the basic CRUD operations using apollo-server-micro, TypeGraphQL, MongoDB, Redis, Mongoose, and Typegoose.

GraphQL CRUD API with Next.js, MongoDB, and TypeGraphQL

Topics Covered

  • What is TypeGraphQL?
  • Initialize a Typescript Next.js Project
  • Setup MongoDB and Redis Databases
  • Setting up Environment Variables
  • Connecting to the Redis and MongoDB Databases
    • Connect to the MongoDB Database
    • Connect to the Redis Database
  • Setup the GraphQL Apollo Server in Next.js
  • Creating TypeGraphQL and Typegoose Schemas
    • Creating the Typegoose Schema
    • Creating the TypeGraphQL Schemas
  • Create a Global Error Handler
  • Creating the CRUD Services
    • GraphQL Create Post Service
    • GraphQL Get a Single Post Service
    • GraphQL Update Post Service
    • GraphQL Get all Posts Service
    • GraphQL Delete Post Service
  • Creating the CRUD TypeGraphQL Resolvers
  • Update the Apollo GraphQL Server
  • Testing the GraphQL CRUD API in Postman

Read the entire article here: https://codevoweb.com/graphql-crud-api-nextjs-mongodb-typegraphql

4. Next.js Full-Stack App with React Query, and GraphQL-CodeGen

This article will teach you how to build a full-stack CRUD App with Next.js, React Query, GraphQL Code Generator, React-Hook-Form, Zod, and graphql-request to perform Create/Update/Get/Delete operations.

Next.js Full-Stack App with React Query, and GraphQL-CodeGen

Topics Covered

  • Next.js Full-Stack CRUD App Overview
  • Benefits of React Query
  • Setup GraphQL Code Generator
  • Creating the GraphQL Mutations and Queries
    • Create Post Mutation
    • Update Post Mutation
    • Delete Post Mutation
    • Get a Single Post Query
    • Get All Post Query
  • Generating the React Query Hooks with CodeGen
  • Create Reusable Components with tailwindCss
    • Creating the Modal Component
    • Creating the Message Component
    • Creating a Custom Input Field with React-Hook-Form
  • GraphQL Request and React Query Clients
  • React Query & GraphQL Request Create Mutation
  • React Query & GraphQL Request Update Mutation
  • React Query & GraphQL Request Delete Mutation
  • React Query & GraphQL Request Get Query

Read the entire article here: https://codevoweb.com/nextjs-full-stack-app-with-react-query-and-graphql-codegen

nextjs-typegraphql-api's People

Contributors

wpcodevo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.