{"id":23785249,"url":"https://github.com/benjaminadk/graphql-server-boilerplate","last_synced_at":"2025-09-06T03:31:01.807Z","repository":{"id":38804128,"uuid":"200883385","full_name":"benjaminadk/graphql-server-boilerplate","owner":"benjaminadk","description":"GraphQL server boilerplate powered by Express, Apollo, Prisma and Redis","archived":false,"fork":false,"pushed_at":"2023-01-04T06:26:35.000Z","size":1479,"stargazers_count":4,"open_issues_count":20,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T19:39:31.117Z","etag":null,"topics":["express","graphql","prisma","redis"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benjaminadk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-06T16:00:18.000Z","updated_at":"2022-01-22T02:17:32.000Z","dependencies_parsed_at":"2023-02-02T01:17:08.268Z","dependency_job_id":null,"html_url":"https://github.com/benjaminadk/graphql-server-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/benjaminadk/graphql-server-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminadk%2Fgraphql-server-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminadk%2Fgraphql-server-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminadk%2Fgraphql-server-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminadk%2Fgraphql-server-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benjaminadk","download_url":"https://codeload.github.com/benjaminadk/graphql-server-boilerplate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminadk%2Fgraphql-server-boilerplate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273853146,"owners_count":25179792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express","graphql","prisma","redis"],"created_at":"2025-01-01T13:15:29.727Z","updated_at":"2025-09-06T03:31:01.386Z","avatar_url":"https://github.com/benjaminadk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express Apollo Prisma Boilerplate\n\nBasic starter for a modern GraphQL backend. Powered by Express, Apollo and Prisma.\n\n## Features\n\n- Sign Up\n- Sign In\n- Sign Out\n- Twitter OAuth\n- Email Verification\n- Forgot Password\n- Cookies\n- Authentication\n- Permission System\n- Rate Limiting\n- Account Locking\n- Datebase Seeding\n\n## Installation\n\n- Clone this repository to your local machine\n\n```bash\ngit clone https://github.com/benjaminadk/graphql-server-boilerplate.git\n```\n\n- Install dependencies\n\n```bash\ncd graphql-server-boilerplate\nnpm install\n```\n\n## Prisma\n\nDownload the Prisma CLI\n\n```bash\nnpm install prisma -g\n```\n\nCreate a [Prisma Server](https://www.prisma.io/docs/prisma-server/) for development\n\n## Redis\n\n- Install and run [Redis](https://redis.io)\n\n## Twitter OAuth\n\n- To utilize optional OAuth a [Twitter Developer](https://developer.twitter.com/) account and project is needed\n\n## Environment Variables\n\nCreate a `.env` at the project root with these [Environment Variables](#environment-variables)\n\n```\n// example\nADMIN_EMAIL=\"example@gmail.com\"\n```\n\n|          Name           |            Description            |\n| :---------------------: | :-------------------------------: |\n|       ADMIN_EMAIL       |        Your email address         |\n|       ADMIN_PASS        |    Your password for this app     |\n|         BACKEND         |          URL of backend           |\n|       EMAIL_HOST        |          SMTP Email Host          |\n|       EMAIL_PASS        |       Email client password       |\n|       EMAIL_USER        |       Email client username       |\n|        FRONTEND         |          URL of frontend          |\n|          PORT           |   Express listens on this port    |\n|     PRISMA_ENDPOINT     |     HTTP endpoint for Prisma      |\n|      PRISMA_SECRET      | Security for your Prisma endpoint |\n|      PRISMA_TOKEN       |   Used to authenticate seeding    |\n|      SESSION_NAME       |          Name of session          |\n|     SESSION_SECRET      |    Security for session cookie    |\n|  TWITTER_CONSUMER_KEY   |        Provided by Twitter        |\n| TWITTER_CONSUMER_SECRET |        Provided by Twitter        |\n\n## Email\n\nCreate [Mail Trap](https://mailtrap.io/) or equivilant account to test email service\n\n## Usage\n\n```bash\nnpm run dev\n```\n\n- GraphQL Playground will be availble at `http://localhost:$PORT/graphql`\n- Make sure `\"request.credentials\": \"include\"` is in your Playground Settings\n\n## NPM Scripts\n\n- Any script with the prefix `db` can also be done via _Prisma CLI_\n\n|   Script    |                 Description                 |\n| :---------: | :-----------------------------------------: |\n|   `start`   |         Start server in production          |\n|    `dev`    |         Start server in development         |\n|  `db:drop`  |     Deletes all data in Prisma database     |\n| `db:deploy` | Updates Prisma datamodel \u0026 generates schema |\n|  `db:seed`  |       Reset and seed Prisma database        |\n| `db:token`  | Generate and copy Prisma token to clipboard |\n\n## Testing\n\n- Coming Soon\n\n## Playground\n\n- Helpful `Query` and `Mutation` setup to test backend flows\n  - SIGNUP - create user in database\n  - SIGNIN_1 - should throw error due to user not being confirmed\n  - Check testing email account and click confirm link\n  - SIGNIN_1 - should work now\n  - USER - session cookie should be read\n  - SIGNOUT - should clear session\n  - USER - should return `null`\n  - FORGOT_PASSWORD - locks account\n  - SIGNIN_1 - should throw account locked error\n  - Check testing email and click link - copy id param\n  - CHANGE_FORGOT_PASS - replace `key` with id from last step\n  - SIGNIN_1 - should throw password mismatch error\n  - SIGNIN_2 - should work\n  - USER - should work\n\n```graphql\n# Reads cookie to get current user\nquery USER {\n  currentUser {\n    id\n    twitterId\n    createdAt\n    name\n    email\n    image\n    role\n    forgotPasswordLock\n    confirmed\n  }\n}\n\n# initial sign up\nmutation SIGNUP {\n  signup(name: \"example\", email: \"example@gmail.com\", password: \"password\") {\n    success\n    message\n    user {\n      id\n      twitterId\n      createdAt\n      name\n      email\n      image\n      role\n      forgotPasswordLock\n      confirmed\n    }\n  }\n}\n\n# sign in after confirmation email\nmutation SIGNIN_1 {\n  signin(email: \"example@gmail.com\", password: \"password\") {\n    success\n    message\n    user {\n      id\n      twitterId\n      createdAt\n      name\n      email\n      image\n      role\n      forgotPasswordLock\n      confirmed\n    }\n  }\n}\n\n# sign in after changing password\nmutation SIGNIN_2 {\n  signin(email: \"example@gmail.com\", password: \"newpassword\") {\n    success\n    message\n    user {\n      id\n      twitterId\n      createdAt\n      name\n      email\n      image\n      role\n      forgotPasswordLock\n      confirmed\n    }\n  }\n}\n\n# sign out clears session\nmutation SIGNOUT {\n  signout {\n    success\n    message\n  }\n}\n\n# trigger forgot password email and account lock\nmutation FORGOT_PASSWORD {\n  sendForgotPasswordEmail(email: \"example@gmail.com\") {\n    success\n    message\n  }\n}\n\n# change password\n# make sure to replace key with route param in email link\nmutation CHANGE_FORGOT_PASS {\n  forgotPasswordChange(newPassword: \"newpassword\", key: \"cf346fe0-aa16-44b8-b2a8-c9307aae6445\") {\n    success\n    message\n  }\n}\n```\n\n## Acknowledgements\n\n- Shout Out to @benawad for his [GraphQl Typescript Boilerplate](https://github.com/benawad/graphql-ts-server-boilerplate) which inspired the use of [Redis](https://redis.io) and Rate Limitting in this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjaminadk%2Fgraphql-server-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenjaminadk%2Fgraphql-server-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjaminadk%2Fgraphql-server-boilerplate/lists"}