-
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.
github action을 통핸 CI/CD 구축
- Loading branch information
Showing
288 changed files
with
9,505 additions
and
224 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,6 @@ | ||
test | ||
.vscode | ||
.git | ||
.github | ||
.yarn/sdks | ||
node_modules |
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,60 @@ | ||
name: SEOKO Server Deploy | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
|
||
jobs: | ||
build: | ||
name: Build and Push Project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 16 | ||
|
||
- name: Install the project dependencies | ||
run: yarn install | ||
|
||
- name: Create .env file | ||
run: | | ||
jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' <<< "$SECRETS_CONTEXT" > .env | ||
cat .env | ||
env: | ||
SECRETS_CONTEXT: ${{ toJson(secrets) }} | ||
|
||
- name: Login to Docker Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{secrets.DOCKER_REGISTRY_URL}} | ||
username: ${{secrets.DOCKER_REGISTRY_ACCESS_KEY}} | ||
password: ${{secrets.DOCKER_REGISTRY_SECRET_KEY}} | ||
|
||
- name: Docker build & push to push | ||
run: docker buildx build -t ${{secrets.DOCKER_REGISTRY_URL}}/${{secrets.BACK_DOCKER_IMAGE_NAME}}:${{ github.sha }} -t ${{secrets.DOCKER_REGISTRY_URL}}/${{secrets.BACK_DOCKER_IMAGE_NAME}}:latest --push . | ||
working-directory: ${{ env.working-directory }} | ||
|
||
deploy: | ||
needs: build | ||
name: Deploy | ||
runs-on: [seoko-server] | ||
steps: | ||
- name: Login to Docker Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{secrets.DOCKER_REGISTRY_URL}} | ||
username: ${{secrets.DOCKER_REGISTRY_ACCESS_KEY}} | ||
password: ${{secrets.DOCKER_REGISTRY_SECRET_KEY}} | ||
|
||
- name: Docker run | ||
run: | | ||
if [ `docker ps -f "name=back" -q` ] | ||
then | ||
docker rm -f $(docker ps -f "name=back" -q) | ||
fi | ||
docker pull ${{secrets.DOCKER_REGISTRY_URL}}/${{secrets.BACK_DOCKER_IMAGE_NAME}}:${{ github.sha }} | ||
docker run -dit -p 3065:3065 --name back ${{secrets.DOCKER_REGISTRY_URL}}/${{secrets.BACK_DOCKER_IMAGE_NAME}}:${{ github.sha }} |
Binary file not shown.
Binary file added
BIN
+17.5 KB
.yarn/cache/@aws-crypto-ie11-detection-npm-3.0.0-71f24dcf6a-299b2ddd46.zip
Binary file not shown.
Binary file added
BIN
+20.8 KB
.yarn/cache/@aws-crypto-sha256-browser-npm-3.0.0-467f48a447-ca89456bf5.zip
Binary file not shown.
Binary file added
BIN
+28.2 KB
.yarn/cache/@aws-crypto-sha256-js-npm-3.0.0-2ba1013fd6-644ded32ea.zip
Binary file not shown.
Binary file added
BIN
+12.1 KB
.yarn/cache/@aws-crypto-supports-web-crypto-npm-3.0.0-55222d294a-35479a1558.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+173 KB
.yarn/cache/@aws-sdk-client-cognito-identity-npm-3.370.0-9b45c43400-e13eb18f70.zip
Binary file not shown.
Binary file added
BIN
+75.9 KB
.yarn/cache/@aws-sdk-client-sso-npm-3.370.0-a9bd886ca2-e6797cac37.zip
Binary file not shown.
Binary file added
BIN
+69.2 KB
.yarn/cache/@aws-sdk-client-sso-oidc-npm-3.370.0-9943f04319-a94d58fdef.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+26 KB
...cache/@aws-sdk-credential-provider-cognito-identity-npm-3.370.0-9f621fdb7e-3ee862b115.zip
Binary file not shown.
Binary file added
BIN
+9.6 KB
.yarn/cache/@aws-sdk-credential-provider-env-npm-3.370.0-63ab7b9144-0295278ca3.zip
Binary file not shown.
Binary file added
BIN
+25.2 KB
.yarn/cache/@aws-sdk-credential-provider-ini-npm-3.370.0-e1030b1253-8d8d0d386e.zip
Binary file not shown.
Binary file added
BIN
+13.9 KB
.yarn/cache/@aws-sdk-credential-provider-node-npm-3.370.0-8675fb3d01-564422e77d.zip
Binary file not shown.
Binary file added
BIN
+14.9 KB
.yarn/cache/@aws-sdk-credential-provider-process-npm-3.370.0-5a4d7fd671-286080cfdb.zip
Binary file not shown.
Binary file added
BIN
+18.5 KB
.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.370.0-03241fdcc0-a5ef52fd21.zip
Binary file not shown.
Binary file added
BIN
+14.7 KB
.yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.370.0-da1f5214fa-3e9ce1c774.zip
Binary file not shown.
Binary file added
BIN
+43.9 KB
.yarn/cache/@aws-sdk-credential-providers-npm-3.370.0-6591d3aac1-7eb60bda6b.zip
Binary file not shown.
Binary file added
BIN
+8.87 KB
.yarn/cache/@aws-sdk-middleware-host-header-npm-3.370.0-874d1a2ffd-2a7d3f3a0a.zip
Binary file not shown.
Binary file added
BIN
+9.7 KB
.yarn/cache/@aws-sdk-middleware-logger-npm-3.370.0-12a9f2b942-f3c4062247.zip
Binary file not shown.
Binary file added
BIN
+9.09 KB
.yarn/cache/@aws-sdk-middleware-recursion-detection-npm-3.370.0-914f181981-ee25951954.zip
Binary file not shown.
Binary file added
BIN
+8.37 KB
.yarn/cache/@aws-sdk-middleware-sdk-sts-npm-3.370.0-ebc73af313-14877966d5.zip
Binary file not shown.
Binary file added
BIN
+19.9 KB
.yarn/cache/@aws-sdk-middleware-signing-npm-3.370.0-2cb6d89c62-f8581ad377.zip
Binary file not shown.
Binary file added
BIN
+14.5 KB
.yarn/cache/@aws-sdk-middleware-user-agent-npm-3.370.0-179c9f8167-c4366db10a.zip
Binary file not shown.
Binary file added
BIN
+23.9 KB
.yarn/cache/@aws-sdk-token-providers-npm-3.370.0-a1ea87e333-7126c5bdc8.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+79.2 KB
.yarn/cache/@aws-sdk-util-endpoints-npm-3.370.0-a26911f59e-d351ad2fdc.zip
Binary file not shown.
Binary file added
BIN
+7.54 KB
.yarn/cache/@aws-sdk-util-locate-window-npm-3.310.0-0bb775a2bf-d552ce5f0f.zip
Binary file not shown.
Binary file added
BIN
+11.3 KB
.yarn/cache/@aws-sdk-util-user-agent-browser-npm-3.370.0-15a59b38ca-3a549b1337.zip
Binary file not shown.
Binary file added
BIN
+10.3 KB
.yarn/cache/@aws-sdk-util-user-agent-node-npm-3.370.0-1bd47fb171-83b1f2c7f2.zip
Binary file not shown.
Binary file added
BIN
+11.2 KB
.yarn/cache/@aws-sdk-util-utf8-browser-npm-3.259.0-343a1dba08-b6a1e580da.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+17.4 KB
...ting-npm-10.0.5-7ab4fac79c-dfc6b492ca.zip → ...ting-npm-10.1.0-fefe10019d-80e609e4d0.zip
Binary file not shown.
Binary file added
BIN
+11.1 KB
.yarn/cache/@smithy-abort-controller-npm-1.0.2-7f32adc09f-5d0c5b0463.zip
Binary file not shown.
Binary file added
BIN
+47.3 KB
.yarn/cache/@smithy-config-resolver-npm-1.0.2-0f50d5f700-23efcb59d6.zip
Binary file not shown.
Binary file added
BIN
+41.5 KB
.yarn/cache/@smithy-credential-provider-imds-npm-1.0.2-08dc132d2c-91b57891b6.zip
Binary file not shown.
Binary file added
BIN
+33.7 KB
.yarn/cache/@smithy-eventstream-codec-npm-1.0.2-c7c5feddbc-64e2f6e5b0.zip
Binary file not shown.
Binary file added
BIN
+15.1 KB
.yarn/cache/@smithy-fetch-http-handler-npm-1.0.2-ad97dc7181-62965f69eb.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+9.98 KB
.yarn/cache/@smithy-invalid-dependency-npm-1.0.2-c3c4b73575-51d4bfc258.zip
Binary file not shown.
Binary file added
BIN
+7.6 KB
.yarn/cache/@smithy-is-array-buffer-npm-1.0.2-a8ef5bb507-811b100b80.zip
Binary file not shown.
Binary file added
BIN
+8.77 KB
.yarn/cache/@smithy-middleware-content-length-npm-1.0.2-b108132555-4b00aa7411.zip
Binary file not shown.
Binary file added
BIN
+31.3 KB
.yarn/cache/@smithy-middleware-endpoint-npm-1.0.3-81e4f50747-8081b51595.zip
Binary file not shown.
Binary file added
BIN
+32.6 KB
.yarn/cache/@smithy-middleware-retry-npm-1.0.4-db58446b68-3ca5c4abe3.zip
Binary file not shown.
Binary file added
BIN
+13.1 KB
.yarn/cache/@smithy-middleware-serde-npm-1.0.2-9a3fabbdce-563045c0ad.zip
Binary file not shown.
Binary file added
BIN
+14.3 KB
.yarn/cache/@smithy-middleware-stack-npm-1.0.2-569268495f-34794d1e6d.zip
Binary file not shown.
Binary file added
BIN
+15.3 KB
.yarn/cache/@smithy-node-config-provider-npm-1.0.2-b1838ef775-593bd5adf0.zip
Binary file not shown.
Binary file added
BIN
+44.1 KB
.yarn/cache/@smithy-node-http-handler-npm-1.0.3-e77f20770f-727e1391cc.zip
Binary file not shown.
Binary file added
BIN
+19.5 KB
.yarn/cache/@smithy-property-provider-npm-1.0.2-0958386554-55d09de3da.zip
Binary file not shown.
Binary file added
BIN
+19.9 KB
.yarn/cache/@smithy-protocol-http-npm-1.1.1-a6955fb975-6320e8b010.zip
Binary file not shown.
Binary file added
BIN
+8.15 KB
.yarn/cache/@smithy-querystring-builder-npm-1.0.2-cd386247de-c0e6807a5b.zip
Binary file not shown.
Binary file added
BIN
+8 KB
.yarn/cache/@smithy-querystring-parser-npm-1.0.2-588300d020-348672b1bc.zip
Binary file not shown.
Binary file added
BIN
+11.2 KB
.yarn/cache/@smithy-service-error-classification-npm-1.0.3-626eea7f1d-adf840de78.zip
Binary file not shown.
Binary file added
BIN
+34.3 KB
.yarn/cache/@smithy-shared-ini-file-loader-npm-1.0.2-fe69af7fa4-c9ba908a48.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+9.4 KB
.yarn/cache/@smithy-util-body-length-browser-npm-1.0.2-dbde19a47e-3b0eacc376.zip
Binary file not shown.
Binary file added
BIN
+9.27 KB
.yarn/cache/@smithy-util-body-length-node-npm-1.0.2-8f10cf41cb-472371dc0a.zip
Binary file not shown.
Binary file added
BIN
+8.17 KB
.yarn/cache/@smithy-util-buffer-from-npm-1.0.2-58dd9f842b-ca4308ebc5.zip
Binary file not shown.
Binary file added
BIN
+9.41 KB
.yarn/cache/@smithy-util-config-provider-npm-1.0.2-d61fd81ad6-625c100b8a.zip
Binary file not shown.
Binary file added
BIN
+14.3 KB
.yarn/cache/@smithy-util-defaults-mode-browser-npm-1.0.2-4be5a50c54-ca03c9f596.zip
Binary file not shown.
Binary file added
BIN
+14.2 KB
.yarn/cache/@smithy-util-defaults-mode-node-npm-1.0.2-e9f11134c0-805977758a.zip
Binary file not shown.
Binary file added
BIN
+8.38 KB
.yarn/cache/@smithy-util-hex-encoding-npm-1.0.2-701dc5e90a-c70bfccb41.zip
Binary file not shown.
Binary file added
BIN
+8.93 KB
.yarn/cache/@smithy-util-middleware-npm-1.0.2-92048f4c53-899aca62ef.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+9.89 KB
.yarn/cache/@smithy-util-uri-escape-npm-1.0.2-7a2e0f5e15-6df9fb3aed.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+3.23 KB
.yarn/cache/@types-webidl-conversions-npm-7.0.0-0903313151-60142c7ddd.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+3.78 KB
.yarn/cache/buffer-equal-constant-time-npm-1.0.1-41826f3419-80bb945f5d.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+13.6 KB
.yarn/cache/mongodb-connection-string-url-npm-2.6.0-af011ba17f-1d662f0ecf.zip
Binary file not shown.
Binary file added
BIN
+115 KB
.yarn/cache/mongodb-memory-server-core-npm-8.13.0-c46ab8f8fc-05ee432d70.zip
Binary file not shown.
Binary file added
BIN
+3.47 KB
.yarn/cache/mongodb-memory-server-npm-8.13.0-8ab039ac60-93bc1f40db.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+5.53 KB
.yarn/cache/new-find-package-json-npm-2.0.0-90004ee195-5488ead794.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -1 +1,14 @@ | ||
yarnPath: .yarn/releases/yarn-3.6.1.cjs | ||
|
||
packageExtensions: | ||
ts-loader@*: | ||
dependencies: | ||
webpack: "*" | ||
|
||
"@nestjs/passport@*": | ||
dependencies: | ||
passport: "*" | ||
|
||
"@nestjs/axios@*": | ||
dependencies: | ||
axios: "*" |
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 @@ | ||
FROM node:16-alpine as base | ||
|
||
FROM base as builder | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json . | ||
COPY yarn.lock . | ||
COPY .yarnrc.yml . | ||
COPY .pnp.cjs . | ||
COPY .pnp.loader.mjs . | ||
COPY .yarn ./.yarn | ||
|
||
RUN yarn install | ||
|
||
COPY . . | ||
|
||
RUN yarn build | ||
|
||
FROM base AS runner | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/.yarn/releases ./.yarn/releases | ||
COPY --from=builder /app/.yarn/cache ./.yarn/cache | ||
COPY --from=builder /app/.yarn/unplugged ./.yarn/unplugged | ||
COPY --from=builder /app/dist ./dist | ||
COPY --from=builder /app/.env ./.env | ||
|
||
COPY --from=builder /app/.pnp.cjs ./.pnp.cjs | ||
COPY --from=builder /app/package.json ./package.json | ||
COPY --from=builder /app/yarn.lock ./yarn.lock | ||
COPY --from=builder /app/.yarnrc.yml ./.yarnrc.yml | ||
|
||
ENV NODE_ENV production | ||
ENV PORT 4000 | ||
ENV HOSTNAME 0.0.0.0 | ||
|
||
EXPOSE 4000 | ||
|
||
CMD ["node", "-r", "./.pnp.cjs", "dist/main.js"] |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"version": "1.0.0", | ||
"main": "index.js", | ||
"repository": "https://github.com/seoko97/SEOKO-server.git", | ||
"author": "seokho10007 <[email protected]>", | ||
"author": "seoko97 <[email protected]>", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "nest build", | ||
|
@@ -12,26 +12,44 @@ | |
"start:dev": "nest start --watch", | ||
"start:debug": "nest start --debug --watch", | ||
"start:prod": "node dist/main", | ||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", | ||
"test": "jest", | ||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"", | ||
"lint:fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", | ||
"test": "jest --runInBand", | ||
"test:watch": "jest --watch", | ||
"test:cov": "jest --coverage", | ||
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", | ||
"test:e2e": "jest --config ./test/jest-e2e.json" | ||
}, | ||
"dependencies": { | ||
"@nestjs/axios": "^3.0.0", | ||
"@nestjs/common": "^10.0.0", | ||
"@nestjs/config": "^3.0.0", | ||
"@nestjs/core": "^10.0.0", | ||
"@nestjs/jwt": "^10.1.0", | ||
"@nestjs/mapped-types": "^2.0.2", | ||
"@nestjs/mongoose": "^10.0.0", | ||
"@nestjs/passport": "^10.0.0", | ||
"@nestjs/platform-express": "^10.0.0", | ||
"bcryptjs": "^2.4.3", | ||
"class-transformer": "^0.5.1", | ||
"class-validator": "^0.14.0", | ||
"cookie-parser": "^1.4.6", | ||
"crypto-js": "^4.1.1", | ||
"mongoose": "^7.3.4", | ||
"multer": "^1.4.5-lts.1", | ||
"passport-jwt": "^4.0.1", | ||
"passport-local": "^1.0.0", | ||
"reflect-metadata": "^0.1.13", | ||
"rxjs": "^7.8.1" | ||
}, | ||
"devDependencies": { | ||
"@nestjs/cli": "^10.0.0", | ||
"@nestjs/schematics": "^10.0.0", | ||
"@nestjs/testing": "^10.0.0", | ||
"@types/cookie-parser": "^1.4.3", | ||
"@types/express": "^4.17.17", | ||
"@types/jest": "^29.5.2", | ||
"@types/multer": "^1.4.7", | ||
"@types/node": "^20.3.1", | ||
"@types/supertest": "^2.0.12", | ||
"@typescript-eslint/eslint-plugin": "^5.59.11", | ||
|
@@ -42,6 +60,7 @@ | |
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"jest": "^29.5.0", | ||
"mongodb-memory-server": "^8.13.0", | ||
"prettier": "^2.8.8", | ||
"source-map-support": "^0.5.21", | ||
"supertest": "^6.3.3", | ||
|
@@ -57,16 +76,20 @@ | |
"json", | ||
"ts" | ||
], | ||
"rootDir": "src", | ||
"rootDir": ".", | ||
"testRegex": ".*\\.spec\\.ts$", | ||
"transform": { | ||
"^.+\\.(t|j)s$": "ts-jest" | ||
}, | ||
"collectCoverageFrom": [ | ||
"**/*.(t|j)s" | ||
"src/**/*.(t|j)s" | ||
], | ||
"coverageDirectory": "../coverage", | ||
"testEnvironment": "node" | ||
"coverageDirectory": "./coverage", | ||
"testEnvironment": "node", | ||
"moduleNameMapper": { | ||
"^@/(.*)$": "<rootDir>/src/$1", | ||
"^test/(.*)$": "<rootDir>/test/$1" | ||
} | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,33 @@ | ||
import { Module } from "@nestjs/common"; | ||
import { APP_GUARD } from "@nestjs/core"; | ||
|
||
import { AppController } from "./app.controller"; | ||
import { AppService } from "./app.service"; | ||
import { AccessJwtAuthGuard } from "@/common/guards"; | ||
import { CommonModule } from "@/common/modules"; | ||
import { SequenceModule } from "@/common/sequence/sequence.module"; | ||
import { AuthModule } from "@/routes/auth/auth.module"; | ||
import { ExperienceModule } from "@/routes/experience/experience.module"; | ||
import { ImageModule } from "@/routes/image/image.module"; | ||
import { PostModule } from "@/routes/post/post.module"; | ||
import { ProjectModule } from "@/routes/project/project.module"; | ||
import { SeriesModule } from "@/routes/series/series.module"; | ||
import { SkillModule } from "@/routes/skill/skill.module"; | ||
import { TagModule } from "@/routes/tag/tag.module"; | ||
import { UserModule } from "@/routes/user/user.module"; | ||
|
||
@Module({ | ||
imports: [], | ||
controllers: [AppController], | ||
providers: [AppService], | ||
imports: [ | ||
CommonModule, | ||
SequenceModule, | ||
UserModule, | ||
AuthModule, | ||
PostModule, | ||
SeriesModule, | ||
TagModule, | ||
ProjectModule, | ||
ExperienceModule, | ||
SkillModule, | ||
ImageModule, | ||
], | ||
providers: [{ provide: APP_GUARD, useClass: AccessJwtAuthGuard }], | ||
}) | ||
export class AppModule {} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { createParamDecorator } from "@nestjs/common"; | ||
|
||
const RealIp = createParamDecorator((data, ctx) => { | ||
const req = ctx.switchToHttp().getRequest(); | ||
const ip = req.headers["x-forwarded-for"] || req.headers["x-real-ip"] || "0.0.0.0"; | ||
|
||
return ip; | ||
}); | ||
|
||
export { RealIp }; |
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 @@ | ||
export * from "./skip-auth.decorator"; | ||
export * from "./user.decorator"; |
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,9 @@ | ||
import { applyDecorators } from "@nestjs/common"; | ||
|
||
import { IsNotEmpty, IsOptional } from "class-validator"; | ||
|
||
const IsOptionalCustom = (..._decorators: PropertyDecorator[]) => { | ||
return applyDecorators(IsOptional(), IsNotEmpty(), ..._decorators); | ||
}; | ||
|
||
export { IsOptionalCustom }; |
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,7 @@ | ||
import { SetMetadata } from "@nestjs/common"; | ||
|
||
import { IS_PUBLIC_KEY } from "@/utils/constants"; | ||
|
||
const Public = () => SetMetadata(IS_PUBLIC_KEY, true); | ||
|
||
export { Public }; |
Oops, something went wrong.