{"id":16036790,"url":"https://github.com/leosuncin/nest-graphql-example","last_synced_at":"2025-03-18T04:30:26.850Z","repository":{"id":37594121,"uuid":"500808136","full_name":"leosuncin/nest-graphql-example","owner":"leosuncin","description":"Example of GraphQL with Nest.js and TypeORM","archived":false,"fork":false,"pushed_at":"2022-06-17T02:34:37.000Z","size":329,"stargazers_count":10,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-25T08:44:55.334Z","etag":null,"topics":["apollo-server","conventional-commits","example-project","graphql","jest","nestjs","pactum","supertest","typeorm","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leosuncin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-07T11:17:10.000Z","updated_at":"2024-12-23T06:56:08.000Z","dependencies_parsed_at":"2022-08-25T19:10:51.192Z","dependency_job_id":null,"html_url":"https://github.com/leosuncin/nest-graphql-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leosuncin%2Fnest-graphql-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leosuncin%2Fnest-graphql-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leosuncin%2Fnest-graphql-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leosuncin%2Fnest-graphql-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leosuncin","download_url":"https://codeload.github.com/leosuncin/nest-graphql-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902240,"owners_count":20366258,"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","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":["apollo-server","conventional-commits","example-project","graphql","jest","nestjs","pactum","supertest","typeorm","typescript"],"created_at":"2024-10-08T22:09:04.765Z","updated_at":"2025-03-18T04:30:26.530Z","avatar_url":"https://github.com/leosuncin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎲 Nest.js GraphQL Example\n\n[![MegaLinter](https://github.com/leosuncin/nest-graphql-example/workflows/MegaLinter/badge.svg?branch=master)](https://github.com/leosuncin/nest-graphql-example/actions/workflows/mega-linter.yml)\n[![CI](https://github.com/leosuncin/nest-graphql-example/workflows/CI/badge.svg?branch=master)](https://github.com/leosuncin/nest-graphql-example/actions/workflows/ci.yml)\n![Prettier](https://img.shields.io/badge/Code%20style-prettier-informational?logo=prettier\u0026logoColor=white)\n[![GPL v3 License](https://img.shields.io/badge/License-GPLv3-green.svg)](./LICENSE)\n[![HitCount](https://hits.dwyl.com/leosuncin/nest-graphql-example.svg)](https://hits.dwyl.com/leosuncin/nest-graphql-example)\n\n\u003e An example of how to create and test a GraphQL Server with Nest.js and TypeORM\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://nestjs.com/\" target=\"blank\"\u003e\u003cimg src=\"https://nestjs.com/img/logo_text.svg\" width=\"320\" alt=\"Nest Logo\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Features\n\n- GraphQL server with [Apollo](https://www.apollographql.com/)\n- [Code first](https://docs.nestjs.com/graphql/quick-start#code-first) approach to build the schema\n- [TypeORM](https://typeorm.io/) to connect with MySQL\n- Unit tests and E2E tests\n- [PNPM](https://pnpm.io/) for a fast and efficient installation\n- Check code quality with [MegaLinter](https://megalinter.github.io/latest/)\n- Check continuous integration with [github actions](.github/workflows/ci.yml)\n- Run the necessary services with [docker compose](https://docs.docker.com/compose/)\n\n## Run Locally\n\nClone the project\n\n```bash\n  git clone https://github.com/leosuncin/nest-graphql-example.git\n```\n\nGo to the project directory\n\n```bash\n  cd nest-graphql-example\n```\n\nInstall dependencies\n\n```bash\n  pnpm install\n```\n\nCreate a `.env` from the example one and customize it with your [environment variables](#environment-variables)\n\n```bash\n  cp .env.example .env\n```\n\nStart the services using Docker Compose\n\n```bash\n  docker-compose up -d\n```\n\nRun migrations to create the DB schema\n\n```bash\n  pnpm typeorm migration:run\n```\n\nStart the server\n\n```bash\n  pnpm start:dev\n```\n\n## Environment Variables\n\nTo run this project, you will need to add the following environment variables to your .env file\n\n`MYSQL_DATABASE` the name of the database to connect in the MySQL instance **(required)**\n\n`MYSQL_ROOT_PASSWORD` The password of the _root_ user to connect to the MySQL instance **(required)**\n\n`DATABASE_URL` a connection string to the MySQL instance, example _mysql://root@localhost/example-db_ **(required)**\n\nYou can copy the example `.env` and edit the values\n\n```bash\n  cp .env.example .env\n```\n\n## Running Tests\n\nTo run unit tests, run the following command:\n\n```bash\n  pnpm test\n```\n\nTo run e2e tests (the MySQL instance must be available), run the following command:\n\n```bash\n  pnpm test:e2e\n```\n\n## Tech Stack\n\n**Server:** Typescript, MySQL, Nest.js, TypeORM, Apollo\n\n**Test:** Jest, SuperTest\n\n**DevOps:** Docker Compose\n\n## Author\n\n👤 **Jaime Leonardo Suncin Cruz**\n\n- Twitter: [@jl_suncin](https://twitter.com/jl_suncin)\n- Github: [@leosuncin](https://github.com/leosuncin)\n\u003c!-- markdown-link-check-disable --\u003e\n- LinkedIn: [@jaimesuncin](https://linkedin.com/in/jaimesuncin)\n\u003c!-- markdown-link-check-enable --\u003e\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n## Related\n\nHere are some more example projects with Nest.js\n\n[![Authentication example](https://github-readme-stats.vercel.app/api/pin/?username=leosuncin\u0026repo=nest-auth-example)](https://github.com/leosuncin/nest-auth-example)\n\n[![API example](https://github-readme-stats.vercel.app/api/pin/?username=leosuncin\u0026repo=nest-api-example)](https://github.com/leosuncin/nest-api-example)\n\n[![TypeORM custom repository](https://github-readme-stats.vercel.app/api/pin/?username=leosuncin\u0026repo=nest-typeorm-custom-repository)](https://github.com/leosuncin/nest-typeorm-custom-repository)\n\n## License\n\nRelease under the terms of [GPL v3](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleosuncin%2Fnest-graphql-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleosuncin%2Fnest-graphql-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleosuncin%2Fnest-graphql-example/lists"}