mo-fouad / graphql-ts-server

📡GraphQL, 📜Typescript, 🎛️TypeORM, 🛰️TypeGraphQL, 💾PostgreSQL, 🚀Apollo-Server, 🗃️Redis, incl. 🚔ESLint & Prettier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraphQL TS Server Boilerplate

Steps to run this repo:

  1. Run yarn install command

  2. Setup database settings inside ormconfig.ts file

  3. Setup .env

    TYPEORM_HOST=
    TYPEORM_USERNAME=
    TYPEORM_PASSWORD=
    TYPEORM_DATABASE=
    DEBUG=true
    ACCESS_TOKEN_SECRET=
    REFRESH_TOKEN_SECRET=
    SESSION_SECRET=
    FRONTEND_URL=http://localhost:3000
  4. Run yarn start command

Schema or Code First

  • Before using this Boilerplate it is recommended that you know Schema-First GraphQL Development
  • Type-GraphQL lies on Code First while Prisma on Schema-First

Why Type-GraphQL for SDL Development

  1. You can use a single class for both a db model and graphql model
  2. Way smoother to code (generating types is clunky)
  3. The schema + resolver can be together in the same place

Create & Access DB (PostgreSQL Windows)

Implemented

  • Register - Done
  • Validation - Done
  • Login - Done
  • Authorization Roles - Done
  • Authorization Middleware - Done
  • Confirmation Email - Done
  • Forgot/Change Password - Done
  • Logout - Done
  • Test Environment (ts-jest) - Done
  • Pagination - Done
  • Rate Limiting - Done
  • Higher Order Resolver - 🏃
  • File/Image Multi-upload - Done - Minor Issues
  • Query Complexity - Done
  • Time Performance GraphQL Resolver - 🏃
  • Locking Accounts - 🏃
  • JWT Authentication (Access/Refresh Tokens, Revoking) - Done

Plans

  • Will try to migrate to Rust

Sources

About

📡GraphQL, 📜Typescript, 🎛️TypeORM, 🛰️TypeGraphQL, 💾PostgreSQL, 🚀Apollo-Server, 🗃️Redis, incl. 🚔ESLint & Prettier


Languages

Language:TypeScript 94.1%Language:JavaScript 5.8%Language:Dockerfile 0.1%