diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml index 2bb943e4c..88c0bcf4d 100644 --- a/.github/workflows/publish-docker-image.yml +++ b/.github/workflows/publish-docker-image.yml @@ -6,6 +6,10 @@ on: branches: - v4 +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: IMAGE: amruthpillai/reactive-resume diff --git a/.gitignore b/.gitignore index ae109aa61..9318bd04e 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ Thumbs.db # Generated Files .nx stats.html +libs/prisma # Environment Variables *.env* \ No newline at end of file diff --git a/.npmrc b/.npmrc index 83252e62c..7545c982e 100644 --- a/.npmrc +++ b/.npmrc @@ -1,3 +1,6 @@ auto-install-peers=true enable-pre-post-scripts=true -strict-peer-dependencies=false \ No newline at end of file +strict-peer-dependencies=false +public-hoist-pattern[]=*eslint* +public-hoist-pattern[]=*prisma* +public-hoist-pattern[]=*prettier* \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a2f578d58..eb3d36e41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,19 +9,15 @@ ENV PATH="$PNPM_HOME:$PATH" RUN corepack enable -RUN apt update && apt install -y build-essential --no-install-recommends - # --- Build Image --- FROM base AS build -ENV PUPPETEER_SKIP_DOWNLOAD true ENV NX_CLOUD_ACCESS_TOKEN=$NX_CLOUD_ACCESS_TOKEN COPY .npmrc package.json pnpm-lock.yaml ./ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile COPY . . -RUN pnpm prisma generate RUN pnpm build @@ -33,18 +29,12 @@ RUN apt update && apt install -y dumb-init --no-install-recommends COPY --chown=node:node --from=build /app/dist ./dist COPY --chown=node:node --from=build /app/.npmrc /app/package.json /app/pnpm-lock.yaml ./ -ENV PUPPETEER_SKIP_DOWNLOAD true - -RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm add --global husky RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile # Copy Prisma Generated Client COPY --chown=node:node --from=build ./app/node_modules/.pnpm/@prisma+client* ./node_modules/.pnpm/ -COPY --chown=node:node --from=build ./app/node_modules/@prisma/client ./node_modules/@prisma/client # Copy Prisma Schema & Migrations COPY --chown=node:node --from=build ./app/tools/prisma ./tools/prisma -ENV NODE_ENV production - CMD [ "dumb-init", "pnpm", "start" ] diff --git a/apps/server/src/config/schema.ts b/apps/server/src/config/schema.ts index b87ed8090..823b5aad4 100644 --- a/apps/server/src/config/schema.ts +++ b/apps/server/src/config/schema.ts @@ -1,7 +1,7 @@ import { z } from "nestjs-zod/z"; export const configSchema = z.object({ - NODE_ENV: z.enum(["development", "production"]).default("development"), + NODE_ENV: z.enum(["development", "production"]).default("production"), // Ports PORT: z.coerce.number().default(3000), diff --git a/apps/server/src/database/database.module.ts b/apps/server/src/database/database.module.ts index 78d17494e..2a2ff098d 100644 --- a/apps/server/src/database/database.module.ts +++ b/apps/server/src/database/database.module.ts @@ -17,16 +17,12 @@ import { Config } from "@/server/config/schema"; useFactory: async (configService: ConfigService) => ({ prismaOptions: { datasourceUrl: configService.get("DATABASE_URL") }, middlewares: [ - ...(configService.get("NODE_ENV") === "development" - ? [ - loggingMiddleware({ - logLevel: "debug", - logger: new Logger(PrismaService.name), - logMessage: (query) => - `[Query] ${query.model}.${query.action} - ${query.executionTime}ms`, - }), - ] - : []), + loggingMiddleware({ + logLevel: "debug", // only in development + logger: new Logger(PrismaService.name), + logMessage: (query) => + `[Query] ${query.model}.${query.action} - ${query.executionTime}ms`, + }), ], }), }), diff --git a/package.json b/package.json index 6adeabd42..48485137f 100644 --- a/package.json +++ b/package.json @@ -164,7 +164,7 @@ "@songkeys/nestjs-redis": "^10.0.0", "@songkeys/nestjs-redis-health": "^10.0.0", "@swc/helpers": "~0.5.3", - "@tanstack/react-query": "^5.7.0", + "@tanstack/react-query": "^5.7.1", "@tiptap/extension-highlight": "^2.1.12", "@tiptap/extension-image": "^2.1.12", "@tiptap/extension-link": "^2.1.12", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 01f50f8de..7463a3818 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -153,8 +153,8 @@ dependencies: specifier: ~0.5.3 version: 0.5.3 '@tanstack/react-query': - specifier: ^5.7.0 - version: 5.7.0(react-dom@18.2.0)(react@18.2.0) + specifier: ^5.7.1 + version: 5.7.1(react-dom@18.2.0)(react@18.2.0) '@tiptap/extension-highlight': specifier: ^2.1.12 version: 2.1.12(@tiptap/core@2.1.12) @@ -6385,8 +6385,8 @@ packages: resolution: {integrity: sha512-fnI9ORjcuLGm1sNrKatKIosRQUpuqcD4SV7RqRSVmj8JSicX2aoMyKryHEBpVQvf6N4PaBVgBxQomjsbsGPssQ==} dev: false - /@tanstack/react-query@5.7.0(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-f6F9OdW4MC0bwlYPXop114ngkkZtg650TeJpR2/ME9q/iJ/59dg2+LoGHEdHk2w1mNAdiuiPFYzCcl2WNkFiiw==} + /@tanstack/react-query@5.7.1(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-7onwx519jOKh7/nspf70dOSejJSYfhFRnVsSicuPrmO8L6Iw05G1wwDpp1PjqFLsm7suixlHDXhcNfK0sy0kWg==} peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 diff --git a/tools/compose/traefik.yml b/tools/compose/traefik.yml index 7c58f1c8b..4df7e3fd3 100644 --- a/tools/compose/traefik.yml +++ b/tools/compose/traefik.yml @@ -55,8 +55,6 @@ services: app: image: amruthpillai/reactive-resume restart: unless-stopped - ports: - - 3000:3000 depends_on: - postgres - minio @@ -112,7 +110,6 @@ services: - --entrypoints.web.address=:80 ports: - 80:80 - - 8080:8080 volumes: - /var/run/docker.sock:/var/run/docker.sock diff --git a/tools/scripts/set-version.js b/tools/scripts/set-version.js deleted file mode 100644 index d658cfc89..000000000 --- a/tools/scripts/set-version.js +++ /dev/null @@ -1,7 +0,0 @@ -const fs = require("fs"); -const path = require("path"); - -const packageJsonPath = path.join(__dirname, "..", "..", "package.json"); -const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8")); - -process.stdout.write(packageJson.version); diff --git a/tsconfig.base.json b/tsconfig.base.json index 16af6ca57..b36e5a245 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -15,8 +15,10 @@ "skipDefaultLibCheck": true, "baseUrl": ".", "paths": { + // App Paths "@/client/*": ["apps/client/src/*"], "@/server/*": ["apps/server/src/*"], + // Library Paths "@reactive-resume/dto": ["libs/dto/src/index.ts"], "@reactive-resume/hooks": ["libs/hooks/src/index.ts"], "@reactive-resume/parser": ["libs/parser/src/index.ts"],