Skip to content

Commit ba94b1e

Browse files
feat: added new nestjs graphql sample
1 parent f63a20e commit ba94b1e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+16296
-0
lines changed

nestjs-graphql-mongodb/.gitignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# compiled output
2+
/dist
3+
/node_modules
4+
/build
5+
6+
# Logs
7+
logs
8+
*.log
9+
npm-debug.log*
10+
pnpm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
lerna-debug.log*
14+
15+
# OS
16+
.DS_Store
17+
18+
# Tests
19+
/coverage
20+
/.nyc_output
21+
22+
# IDEs and editors
23+
/.idea
24+
.project
25+
.classpath
26+
.c9/
27+
*.launch
28+
.settings/
29+
*.sublime-workspace
30+
31+
# IDE - VSCode
32+
.vscode/*
33+
!.vscode/settings.json
34+
!.vscode/tasks.json
35+
!.vscode/launch.json
36+
!.vscode/extensions.json
37+
38+
# dotenv environment variable files
39+
.env
40+
.env.development.local
41+
.env.test.local
42+
.env.production.local
43+
.env.local
44+
45+
# temp directory
46+
.temp
47+
.tmp
48+
49+
# Runtime data
50+
pids
51+
*.pid
52+
*.seed
53+
*.pid.lock
54+
55+
# Diagnostic reports (https://nodejs.org/api/report.html)
56+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

nestjs-graphql-mongodb/.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}

nestjs-graphql-mongodb/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM node:20-alpine
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
7+
RUN npm install
8+
9+
COPY . .
10+
11+
RUN npm run build
12+
13+
EXPOSE 3000
14+
15+
CMD ["npm", "run", "start:prod"]

nestjs-graphql-mongodb/README.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<p align="center">
2+
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
3+
</p>
4+
5+
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
6+
[circleci-url]: https://circleci.com/gh/nestjs/nest
7+
8+
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
9+
<p align="center">
10+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
11+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
12+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
13+
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
14+
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
15+
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
16+
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
17+
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
18+
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg" alt="Donate us"/></a>
19+
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
20+
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow" alt="Follow us on Twitter"></a>
21+
</p>
22+
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
23+
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
24+
25+
## Description
26+
27+
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
28+
29+
## Project setup
30+
31+
```bash
32+
$ npm install
33+
```
34+
35+
## Compile and run the project
36+
37+
```bash
38+
# development
39+
$ npm run start
40+
41+
# watch mode
42+
$ npm run start:dev
43+
44+
# production mode
45+
$ npm run start:prod
46+
```
47+
48+
## Run tests
49+
50+
```bash
51+
# unit tests
52+
$ npm run test
53+
54+
# e2e tests
55+
$ npm run test:e2e
56+
57+
# test coverage
58+
$ npm run test:cov
59+
```
60+
61+
## Deployment
62+
63+
When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the [deployment documentation](https://docs.nestjs.com/deployment) for more information.
64+
65+
If you are looking for a cloud-based platform to deploy your NestJS application, check out [Mau](https://mau.nestjs.com), our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:
66+
67+
```bash
68+
$ npm install -g mau
69+
$ mau deploy
70+
```
71+
72+
With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.
73+
74+
## Resources
75+
76+
Check out a few resources that may come in handy when working with NestJS:
77+
78+
- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.
79+
- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).
80+
- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).
81+
- Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks.
82+
- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).
83+
- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).
84+
- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).
85+
- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).
86+
87+
## Support
88+
89+
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
90+
91+
## Stay in touch
92+
93+
- Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec)
94+
- Website - [https://nestjs.com](https://nestjs.com/)
95+
- Twitter - [@nestframework](https://twitter.com/nestframework)
96+
97+
## License
98+
99+
Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).

nestjs-graphql-mongodb/cmd.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
keploy record -c "docker run -p 3000:3000 --name nestjs-graphql --network keploy-network nestjs-graphql" --container-name "nestjs-demo" --buildDelay 60
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// @ts-check
2+
import eslint from '@eslint/js';
3+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
4+
import globals from 'globals';
5+
import tseslint from 'typescript-eslint';
6+
7+
export default tseslint.config(
8+
{
9+
ignores: ['eslint.config.mjs'],
10+
},
11+
eslint.configs.recommended,
12+
...tseslint.configs.recommendedTypeChecked,
13+
eslintPluginPrettierRecommended,
14+
{
15+
languageOptions: {
16+
globals: {
17+
...globals.node,
18+
...globals.jest,
19+
},
20+
ecmaVersion: 5,
21+
sourceType: 'module',
22+
parserOptions: {
23+
projectService: true,
24+
tsconfigRootDir: import.meta.dirname,
25+
},
26+
},
27+
},
28+
{
29+
rules: {
30+
'@typescript-eslint/no-explicit-any': 'off',
31+
'@typescript-eslint/no-floating-promises': 'warn',
32+
'@typescript-eslint/no-unsafe-argument': 'warn'
33+
},
34+
},
35+
);

nestjs-graphql-mongodb/keploy.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Generated by Keploy (2.4.5)
2+
path: ""
3+
appId: 0
4+
appName: nestjs-graphql-mongo-db
5+
command: docker run -p 3000:3000 --name nestjs-graphql --network keploy-network nestjs-graphql
6+
templatize:
7+
testSets: []
8+
port: 0
9+
e2e: false
10+
dnsPort: 26789
11+
proxyPort: 16789
12+
debug: false
13+
disableTele: false
14+
disableANSI: false
15+
containerName: nestjs-demo
16+
networkName: ""
17+
buildDelay: 30
18+
test:
19+
selectedTests: {}
20+
globalNoise:
21+
global: {}
22+
test-sets: {}
23+
delay: 5
24+
host: ""
25+
port: 0
26+
apiTimeout: 5
27+
skipCoverage: false
28+
coverageReportPath: ""
29+
ignoreOrdering: true
30+
mongoPassword: default@123
31+
language: ""
32+
removeUnusedMocks: false
33+
fallBackOnMiss: false
34+
jacocoAgentPath: ""
35+
basePath: ""
36+
mocking: true
37+
ignoredTests: {}
38+
disableLineCoverage: false
39+
disableMockUpload: true
40+
useLocalMock: false
41+
updateTemplate: false
42+
record:
43+
filters: []
44+
basePath: ""
45+
recordTimer: 0s
46+
configPath: ""
47+
bypassRules: []
48+
generateGithubActions: false
49+
keployContainer: keploy-v2
50+
keployNetwork: keploy-network
51+
cmdType: native
52+
contract:
53+
services: []
54+
tests: []
55+
path: ""
56+
download: false
57+
generate: false
58+
driven: consumer
59+
mappings:
60+
servicesMapping: {}
61+
self: s1
62+
inCi: false
63+
64+
# Visit [https://keploy.io/docs/running-keploy/configuration-file/] to learn about using keploy through configration file.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Generated by Keploy (2.4.5)
2+
version: api.keploy.io/v1beta1
3+
kind: Http
4+
name: test-1
5+
spec:
6+
metadata: {}
7+
req:
8+
method: GET
9+
proto_major: 1
10+
proto_minor: 1
11+
url: http://localhost:3000/
12+
header:
13+
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
14+
Accept-Encoding: gzip, deflate, br, zstd
15+
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
16+
Connection: keep-alive
17+
Cookie: _ga=GA1.1.367374226.1739423302; _ga_8KGGHKN59H=GS1.1.1739423302.1.1.1739424012.0.0.0; _ga_QQYB8VTQR0=GS1.1.1739423302.1.1.1739424012.0.0.0; __next_hmr_refresh_hash__=06643411c8f2fbca41b184e6f40b6287633457081244afec; authjs.csrf-token=4f73518f73aee155854d9b5de7889c73847369f5b76983db12feb857b0dc6456%7C91f6ff7bd58fb71ea95b4e9206a0129a81b75cd4acd52fe223c0136aec781d66; authjs.callback-url=http%3A%2F%2Flocalhost%3A3000%2Flogin; authjs.session-token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwia2lkIjoiNDE2Q2hZTW9WeXVVdGpFQm1TY1ktd2JkZUhZa3FWa3puMnVmNGRlbUh5Si03WkZjVDJxUWtGRkRncUtMXy1fVXBqb1RCa29saFc4ZmtiNWJTb0dLeVEifQ..3CsaBcEBNMZseiUKR67erQ.r-SjrkNItv8b0jr8MRl_hdvTKrIpbWDT-E8B-0daQzmmRyNeaafXa7opDdg2YUiS6wqcpza5pzpEoS-NCUS12N6GwsjjuOy2xDIuhAlMNIEr8Cki7QLUxRwsOPv8Md5M1M_9aeO1ToFkfvKk0CIkvH40x1JTEZNrC-GyMXabErP3nMMS6gWavZcATzpF1khJCm6eB_QbuSF5U7oD741n7P80x18KJlQD4SSKvim2_SRC6aCuXtFZWBYVdcXMUe904dUg-VbwPFkdYx2V988vK2Ry1fL4u3GjZYgFnixg9il8UA5TGjs1hYgPg1_hBFw2CTAWXoS98GwgU4AwDPvQR_1dOT1zm95DXXNX_GZtxQ1I6BbWyPoNSsKmDGjec-QOkbRt1rRzLMtm4lJ_XUi-UB3ed3CjQsfecDOImmQ1zCtETVJ631WB6MVfAlHISe6Xl7ZLO7P2Yee5lcwhZTUfjPISwxu0SvNxRMFBmWiVnBmLHJ3CgxCHg3x6ZrbCXL8HLaKRosgmhLYfWFqX18xfv2cM8KWVjxuz1W2i9NN5HabDmfpBtYFjKLVWXhAi9Lzs5l-g6HUUKLVbSIU6UK81p2NDb8zb2AbCmabEnMcfAqUi1sEjBDw6J8wjcSn4h3AclD9gNgejUSPF5hKUFyVbdqMYDUfZWuZFNn9KeOw7Y4-vDdQGv2ejA6OeYcQDtR5wwRSBqhkpHGFekKmxu85L06TmtuIyFa-3Q5mV0jI9anWtmO3U01rDszN9Lg2wnCo1mJ1nYsYp2tq59-8elR-2Ovxd07VFQVp0e5e_rwbUm4BQTkExe9St1_TBx0-fDc967GLIdrNdWqZyKerW--8YxPR3pW6rpUUZcSVh6ikIgYBYgeFdwjhY7EOx9drwnZyYlGuaJ9gJAVO-JF4j2nujAxoeXlzodmnNImIylG6-Hwpj2D6UmVq5T0Gn0qVVwcMP5v9MYRNAW6LpEtTpmGxZgoaev2QaE191yLiWoiFLrqdHRSUwKxue9mZxgk2-uynQyUF_c3pWxi7Th5aF-D_V6jSkfbCY4BWfXKSKMYjlDQsYDSq5jobTJDIU4vod-I29JAmIiyGkTuPPcTlxJ0wjWj2z1zReackukjus8o3OU6hxUtUl82TiZ6z7YrjLM6m0dCR8h0V9D1CyteBJV1imHw.mqBoF7hKedUUS9jMEOTUPBzM54N3pjYPiJkoPGyaWWc; _clck=14qmaxi%7C2%7Cfua%7C0%7C1881; _ga_GYS09X6KHS=GS1.1.1742194877.5.1.1742195518.0.0.0
18+
Host: localhost:3000
19+
Purpose: prefetch
20+
Sec-Ch-Ua: '"Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133"'
21+
Sec-Ch-Ua-Mobile: ?0
22+
Sec-Ch-Ua-Platform: '"macOS"'
23+
Sec-Fetch-Dest: document
24+
Sec-Fetch-Mode: navigate
25+
Sec-Fetch-Site: none
26+
Sec-Fetch-User: ?1
27+
Sec-Purpose: prefetch;prerender
28+
Upgrade-Insecure-Requests: "1"
29+
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
30+
body: ""
31+
timestamp: 2025-03-23T19:10:49.281526469Z
32+
resp:
33+
status_code: 404
34+
header:
35+
Connection: keep-alive
36+
Content-Length: "63"
37+
Content-Type: application/json; charset=utf-8
38+
Date: Sun, 23 Mar 2025 19:10:49 GMT
39+
Etag: W/"3f-BunLb98SCK6azHy0RO08GDnFBek"
40+
Keep-Alive: timeout=5
41+
X-Powered-By: Express
42+
body: '{"message":"Cannot GET /","error":"Not Found","statusCode":404}'
43+
status_message: Not Found
44+
proto_major: 0
45+
proto_minor: 0
46+
timestamp: 2025-03-23T19:10:52.410725221Z
47+
objects: []
48+
assertions:
49+
noise:
50+
header.Date: []
51+
created: 1742757052
52+
curl: |
53+
curl --request GET \
54+
--url http://localhost:3000/ \
55+
--header 'Upgrade-Insecure-Requests: 1' \
56+
--header 'Sec-Fetch-User: ?1' \
57+
--header 'Sec-Fetch-Mode: navigate' \
58+
--header 'Connection: keep-alive' \
59+
--header 'Sec-Purpose: prefetch;prerender' \
60+
--header 'Sec-Fetch-Site: none' \
61+
--header 'Purpose: prefetch' \
62+
--header 'Accept-Encoding: gzip, deflate, br, zstd' \
63+
--header 'Sec-Ch-Ua-Mobile: ?0' \
64+
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36' \
65+
--header 'Host: localhost:3000' \
66+
--header 'Sec-Fetch-Dest: document' \
67+
--header 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
68+
--header 'Cookie: _ga=GA1.1.367374226.1739423302; _ga_8KGGHKN59H=GS1.1.1739423302.1.1.1739424012.0.0.0; _ga_QQYB8VTQR0=GS1.1.1739423302.1.1.1739424012.0.0.0; __next_hmr_refresh_hash__=06643411c8f2fbca41b184e6f40b6287633457081244afec; authjs.csrf-token=4f73518f73aee155854d9b5de7889c73847369f5b76983db12feb857b0dc6456%7C91f6ff7bd58fb71ea95b4e9206a0129a81b75cd4acd52fe223c0136aec781d66; authjs.callback-url=http%3A%2F%2Flocalhost%3A3000%2Flogin; authjs.session-token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwia2lkIjoiNDE2Q2hZTW9WeXVVdGpFQm1TY1ktd2JkZUhZa3FWa3puMnVmNGRlbUh5Si03WkZjVDJxUWtGRkRncUtMXy1fVXBqb1RCa29saFc4ZmtiNWJTb0dLeVEifQ..3CsaBcEBNMZseiUKR67erQ.r-SjrkNItv8b0jr8MRl_hdvTKrIpbWDT-E8B-0daQzmmRyNeaafXa7opDdg2YUiS6wqcpza5pzpEoS-NCUS12N6GwsjjuOy2xDIuhAlMNIEr8Cki7QLUxRwsOPv8Md5M1M_9aeO1ToFkfvKk0CIkvH40x1JTEZNrC-GyMXabErP3nMMS6gWavZcATzpF1khJCm6eB_QbuSF5U7oD741n7P80x18KJlQD4SSKvim2_SRC6aCuXtFZWBYVdcXMUe904dUg-VbwPFkdYx2V988vK2Ry1fL4u3GjZYgFnixg9il8UA5TGjs1hYgPg1_hBFw2CTAWXoS98GwgU4AwDPvQR_1dOT1zm95DXXNX_GZtxQ1I6BbWyPoNSsKmDGjec-QOkbRt1rRzLMtm4lJ_XUi-UB3ed3CjQsfecDOImmQ1zCtETVJ631WB6MVfAlHISe6Xl7ZLO7P2Yee5lcwhZTUfjPISwxu0SvNxRMFBmWiVnBmLHJ3CgxCHg3x6ZrbCXL8HLaKRosgmhLYfWFqX18xfv2cM8KWVjxuz1W2i9NN5HabDmfpBtYFjKLVWXhAi9Lzs5l-g6HUUKLVbSIU6UK81p2NDb8zb2AbCmabEnMcfAqUi1sEjBDw6J8wjcSn4h3AclD9gNgejUSPF5hKUFyVbdqMYDUfZWuZFNn9KeOw7Y4-vDdQGv2ejA6OeYcQDtR5wwRSBqhkpHGFekKmxu85L06TmtuIyFa-3Q5mV0jI9anWtmO3U01rDszN9Lg2wnCo1mJ1nYsYp2tq59-8elR-2Ovxd07VFQVp0e5e_rwbUm4BQTkExe9St1_TBx0-fDc967GLIdrNdWqZyKerW--8YxPR3pW6rpUUZcSVh6ikIgYBYgeFdwjhY7EOx9drwnZyYlGuaJ9gJAVO-JF4j2nujAxoeXlzodmnNImIylG6-Hwpj2D6UmVq5T0Gn0qVVwcMP5v9MYRNAW6LpEtTpmGxZgoaev2QaE191yLiWoiFLrqdHRSUwKxue9mZxgk2-uynQyUF_c3pWxi7Th5aF-D_V6jSkfbCY4BWfXKSKMYjlDQsYDSq5jobTJDIU4vod-I29JAmIiyGkTuPPcTlxJ0wjWj2z1zReackukjus8o3OU6hxUtUl82TiZ6z7YrjLM6m0dCR8h0V9D1CyteBJV1imHw.mqBoF7hKedUUS9jMEOTUPBzM54N3pjYPiJkoPGyaWWc; _clck=14qmaxi%7C2%7Cfua%7C0%7C1881; _ga_GYS09X6KHS=GS1.1.1742194877.5.1.1742195518.0.0.0' \
69+
--header 'Sec-Ch-Ua: "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133"' \
70+
--header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
71+
--header 'Sec-Ch-Ua-Platform: "macOS"' \

0 commit comments

Comments
 (0)