{"id":20391266,"url":"https://github.com/thomasrainford/graphql-typescript-server-starter","last_synced_at":"2026-04-14T06:33:26.173Z","repository":{"id":54688406,"uuid":"321799183","full_name":"ThomasRainford/graphql-typescript-server-starter","owner":"ThomasRainford","description":"Lightweight GraphQL-TypeScript server starter for MongoDB databases.","archived":false,"fork":false,"pushed_at":"2021-02-07T22:17:08.000Z","size":295,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-05T01:43:25.621Z","etag":null,"topics":["api","boilerplate","graphql","graphql-typescript-server","mikro-orm","mongodb","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ThomasRainford.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":"2020-12-15T21:58:32.000Z","updated_at":"2022-06-19T03:18:47.000Z","dependencies_parsed_at":"2022-08-14T00:01:07.737Z","dependency_job_id":null,"html_url":"https://github.com/ThomasRainford/graphql-typescript-server-starter","commit_stats":null,"previous_names":[],"tags_count":2,"template":true,"template_full_name":null,"purl":"pkg:github/ThomasRainford/graphql-typescript-server-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasRainford%2Fgraphql-typescript-server-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasRainford%2Fgraphql-typescript-server-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasRainford%2Fgraphql-typescript-server-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasRainford%2Fgraphql-typescript-server-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThomasRainford","download_url":"https://codeload.github.com/ThomasRainford/graphql-typescript-server-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasRainford%2Fgraphql-typescript-server-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31785677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","boilerplate","graphql","graphql-typescript-server","mikro-orm","mongodb","typescript"],"created_at":"2024-11-15T03:30:12.807Z","updated_at":"2026-04-14T06:33:26.141Z","avatar_url":"https://github.com/ThomasRainford.png","language":"TypeScript","readme":"# GraphQL-TypeScript Server Starter\n\nLightweight boilerplate for a GraphQL TypeScript server for MongoDB databases with basic user functionality included.\n\n## Features\n\n-  Type-GraphQL.\n-  Mikro-Orm with MongoDB.\n-  GraphQL schema and ORM entities can be defined in the same class!\n-  Apollo server as the GraphQL server.\n-  MongoDB session storage.\n-  Generate enviroment variable types with gen-env-types.\n\n### TypeScript Features\n\n-  Continously watches .ts files for changes and converts them to JavaScript in a seperate file.\n-  Uses nodemon to run the index.js file.\n-  ESLint with recommended linting rules for TypeScript.\n-  VSCode setting for running linting command when a file is saved.\n\n## Getting Started\n\n### Step 1: Clone the repo.\n\n```bash\n$ git clone https://github.com/ThomasRainford/graphql-typescript-server-starter.git\n$ cd graphql-typescript-server-starter\n```\n\n### Step 2: Install the dependencies using yarn.\n\n```bash\n$ yarn\n```\n\n### Step 3: Add a _.env_ file\u003cbr\u003e\u003cbr\u003e\n\nYou will need to add an _.env_ file which includes the enviroment variables found in the _.env.example_ file.\n\nYou will also need to have a MongoDB username and password, and you will need to create a new DB and add the host name.\n\n### \u003cbr\u003eStep 4: Watch the .ts files.\n\n```bash\n$ yarn watch\n```\n\n### Step 5: Launch in dev mode.\n\n```bash\n$ yarn dev\n```\n\nThe .ts files will be compiled to JavaScript and placed in the dist directory. Nodemon will then run the project using the index.js file.\n\n**Note:** Step 3 and step 4 will need to be run in seperate terminals.\n\n### Step 6: Open GraphQL Playground\n\nGo to the URL displayed in the console. i.e http://localhost:3000/graphql\n\n### Step 7: Test the User queries and mutations\n\n**Note:** You will have to run the register mutation first.\n\n**Queries:**\n\nUser:me\n\n```graphql\nquery {\n\tme {\n\t\t_id\n\t\temail\n\t\tusername\n\t}\n}\n```\n\nUser:login\n\n```graphql\nquery Login($usernameOrEmail: String!, $password: String!) {\n\tlogin(usernameOrEmail: $usernameOrEmail, password: $password) {\n\t\tuser {\n\t\t\t_id\n\t\t\temail\n\t\t\tusername\n\t\t}\n\t\terrors {\n\t\t\tfield\n\t\t\tmessage\n\t\t}\n\t}\n}\n```\n\nUser:logout\n\n```graphql\nquery {\n\tlogout\n}\n```\n\n**Mutations:**\n\nUser:register\n\n```graphql\nmutation Register($registerInput: UserRegisterInput!) {\n\tregister(registerInput: $registerInput) {\n\t\tuser {\n\t\t\t_id\n\t\t\temail\n\t\t\tusername\n\t\t}\n\t\terrors {\n\t\t\tfield\n\t\t\tmessage\n\t\t}\n\t}\n}\n```\n\nUser:updateUser\n\n```graphql\nmutation UpdateUser($username: String!, $password: String!) {\n\tupdateUser(username: $username, password: $password) {\n\t\tuser {\n\t\t\t_id\n\t\t\temail\n\t\t\tusername\n\t\t}\n\t\terrors {\n\t\t\tfield\n\t\t\tmessage\n\t\t}\n\t}\n}\n```\n\n## Next Steps:\n\n-  Once all queries and mutations work you're good to go.\n-  Note that the user functionality can be used or removed, it's up to you.\n-  Checkout all scripts below.\n-  Feel free to open issues.\n\n## All Scripts:\n\n-  `yarn build` -- Compiles the .ts files into JavaScript.\n-  `yarn watch` -- Watches the .ts files and compiles them into JavaScript.\n-  `yarn dev` -- Runs the project in developer mode. This means any changes made will automatically re-run the typescript code.\n-  `yarn start` -- Runs the project using Node instead of nodemon.\n-  `yarn lint` -- Runs ESLint\n-  `yarn gen-env-types` -- Takes the .env file and generates a .d.ts file of the types for each variable.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasrainford%2Fgraphql-typescript-server-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomasrainford%2Fgraphql-typescript-server-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasrainford%2Fgraphql-typescript-server-starter/lists"}