-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* development init * Update README.md Signed-off-by: gitworkflows <[email protected]> --------- Signed-off-by: gitworkflows <[email protected]> Co-authored-by: gitworkflows <[email protected]>
- Loading branch information
1 parent
506064c
commit 0d44c15
Showing
256 changed files
with
10,366 additions
and
9,609 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"projectName": "nestjs-template", | ||
"projectOwner": "khulnasoft", | ||
"files": [ | ||
"README.md" | ||
], | ||
"commitType": "docs", | ||
"commitConvention": "angular", | ||
"contributorsPerLine": 7, | ||
"contributors": [ | ||
{ | ||
"login": "Shchepotin", | ||
"name": "Vladyslav Shchepotin", | ||
"avatar_url": "https://avatars.githubusercontent.com/u/6001723?v=4", | ||
"profile": "https://github.com/Shchepotin", | ||
"contributions": [ | ||
"maintenance", | ||
"doc", | ||
"code" | ||
] | ||
}, | ||
{ | ||
"login": "SergeiLomako", | ||
"name": "SergeiLomako", | ||
"avatar_url": "https://avatars.githubusercontent.com/u/31205374?v=4", | ||
"profile": "https://github.com/SergeiLomako", | ||
"contributions": [ | ||
"code" | ||
] | ||
}, | ||
{ | ||
"login": "ElenVlass", | ||
"name": "Elena Vlasenko", | ||
"avatar_url": "https://avatars.githubusercontent.com/u/72293912?v=4", | ||
"profile": "https://github.com/ElenVlass", | ||
"contributions": [ | ||
"doc" | ||
] | ||
}, | ||
{ | ||
"login": "sars", | ||
"name": "Rodion", | ||
"avatar_url": "https://avatars.githubusercontent.com/u/226194?v=4", | ||
"profile": "http://khulnasoft.com", | ||
"contributions": [ | ||
"business" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/node_modules | ||
/.data | ||
/dist | ||
/files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: Shchepotin | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Send '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Desktop (please complete the following information):** | ||
- OS: [e.g. Windows] | ||
- NodeJS Version [e.g. 18.16.0] | ||
- Database [e.g. PostgreSQL] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: NestJS API CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# <database-relational-block> | ||
- name: Run e2e tests for NestJS with TypeORM | ||
id: relational | ||
run: docker compose -f docker-compose.relational.ci.yaml --env-file env-example-relational -p ci-relational up --build --exit-code-from api | ||
|
||
- name: Copy prod.log from container to host | ||
if: ${{ failure() && steps.relational.conclusion == 'failure' }} | ||
run: docker cp ci-relational-api-1:/usr/src/app/prod.log . | ||
# </database-relational-block> | ||
|
||
# <database-document-block> | ||
- name: Run e2e tests for NestJS with Mongoose | ||
id: document | ||
run: docker compose -f docker-compose.document.ci.yaml --env-file env-example-document -p ci-document up --build --exit-code-from api | ||
|
||
- name: Copy prod.log from container to host | ||
if: ${{ failure() && steps.document.conclusion == 'failure' }} | ||
run: docker cp ci-document-api-1:/usr/src/app/prod.log . | ||
# </database-document-block> | ||
|
||
- name: Upload prod.log to artifacts for debugging | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: prod-logs | ||
path: prod.log |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npx commitlint --edit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
npm run lint | ||
npm run test -- --passWithNoTests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
templates: `${__dirname}/.hygen`, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
to: src/database/seeds/document/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>-seed.module.ts | ||
--- | ||
import { Module } from '@nestjs/common'; | ||
import { MongooseModule } from '@nestjs/mongoose'; | ||
import { <%= name %>Schema, <%= name %>SchemaClass } from '../../../../<%= h.inflection.transform(name, ['pluralize', 'underscore', 'dasherize']) %>/infrastructure/persistence/document/entities/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>.schema'; | ||
import { <%= name %>SeedService } from './<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>-seed.service'; | ||
|
||
@Module({ | ||
imports: [ | ||
MongooseModule.forFeature([ | ||
{ | ||
name: <%= name %>SchemaClass.name, | ||
schema: <%= name %>Schema, | ||
}, | ||
]), | ||
], | ||
providers: [<%= name %>SeedService], | ||
exports: [<%= name %>SeedService], | ||
}) | ||
export class <%= name %>SeedModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
inject: true | ||
to: src/database/seeds/document/run-seed.ts | ||
after: \@nestjs\/core | ||
--- | ||
import { <%= name %>SeedService } from './<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>-seed.service'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
inject: true | ||
to: src/database/seeds/document/run-seed.ts | ||
before: close | ||
--- | ||
await app.get(<%= name %>SeedService).run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
inject: true | ||
to: src/database/seeds/document/seed.module.ts | ||
before: \@Module | ||
--- | ||
import { <%= name %>SeedModule } from './<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>-seed.module'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
inject: true | ||
to: src/database/seeds/document/seed.module.ts | ||
after: imports | ||
--- | ||
<%= name %>SeedModule, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
to: src/database/seeds/document/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>-seed.service.ts | ||
--- | ||
import { Injectable } from '@nestjs/common'; | ||
import { InjectModel } from '@nestjs/mongoose'; | ||
import { Model } from 'mongoose'; | ||
import { <%= name %>SchemaClass } from '../../../../<%= h.inflection.transform(name, ['pluralize', 'underscore', 'dasherize']) %>/infrastructure/persistence/document/entities/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>.schema'; | ||
|
||
@Injectable() | ||
export class <%= name %>SeedService { | ||
constructor( | ||
@InjectModel(<%= name %>SchemaClass.name) | ||
private readonly model: Model<<%= name %>SchemaClass>, | ||
) {} | ||
|
||
async run() { | ||
const count = await this.model.countDocuments(); | ||
|
||
if (count === 0) { | ||
const data = new this.model({}); | ||
await data.save(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
to: src/database/seeds/relational/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>-seed.module.ts | ||
--- | ||
import { Module } from '@nestjs/common'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { <%= name %>Entity } from '../../../../<%= h.inflection.transform(name, ['pluralize', 'underscore', 'dasherize']) %>/infrastructure/persistence/relational/entities/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>.entity'; | ||
import { <%= name %>SeedService } from './<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>-seed.service'; | ||
|
||
@Module({ | ||
imports: [TypeOrmModule.forFeature([<%= name %>Entity])], | ||
providers: [<%= name %>SeedService], | ||
exports: [<%= name %>SeedService], | ||
}) | ||
export class <%= name %>SeedModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
inject: true | ||
to: src/database/seeds/relational/run-seed.ts | ||
after: \@nestjs\/core | ||
--- | ||
import { <%= name %>SeedService } from './<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>-seed.service'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
inject: true | ||
to: src/database/seeds/relational/run-seed.ts | ||
before: close | ||
--- | ||
await app.get(<%= name %>SeedService).run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
inject: true | ||
to: src/database/seeds/relational/seed.module.ts | ||
before: \@Module | ||
--- | ||
import { <%= name %>SeedModule } from './<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>-seed.module'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
inject: true | ||
to: src/database/seeds/relational/seed.module.ts | ||
after: imports | ||
--- | ||
<%= name %>SeedModule, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
to: src/database/seeds/relational/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>-seed.service.ts | ||
--- | ||
import { Injectable } from '@nestjs/common'; | ||
import { InjectRepository } from '@nestjs/typeorm'; | ||
import { <%= name %>Entity } from '../../../../<%= h.inflection.transform(name, ['pluralize', 'underscore', 'dasherize']) %>/infrastructure/persistence/relational/entities/<%= h.inflection.transform(name, ['underscore', 'dasherize']) %>.entity'; | ||
import { Repository } from 'typeorm'; | ||
|
||
@Injectable() | ||
export class <%= name %>SeedService { | ||
constructor( | ||
@InjectRepository(<%= name %>Entity) | ||
private repository: Repository<<%= name %>Entity>, | ||
) {} | ||
|
||
async run() { | ||
const count = await this.repository.count(); | ||
|
||
if (count === 0) { | ||
await this.repository.save(this.repository.create({})); | ||
} | ||
} | ||
} |
Oops, something went wrong.