Merge pull request 'development' (#6) from development into test

Reviewed-on: https://gitea.maskantech.in/gitea_admin/support_backend/pulls/6
This commit is contained in:
2026-08-20 07:54:13 +00:00
9 changed files with 261 additions and 35 deletions
+9 -5
View File
@@ -6,12 +6,16 @@ BUILD_COMMAND=npm run build:development
# Database
POSTGRES_HOST=postgres
POSTGRES_DB=myapp_development
POSTGRES_USER=myapp_development
POSTGRES_PASSWORD=dev_password
DATABASE_URL=postgresql://myapp_development:dev_password@postgres:5432/myapp_development
POSTGRES_DB=support_dev
POSTGRES_USER=support_user
POSTGRES_PASSWORD=z1F3tKF1JNDBQmMq95Up
DATABASE_URL=postgresql://support_user:z1F3tKF1JNDBQmMq95Up@postgres:5432/support_dev
# Redis
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=dev_redis_password
REDIS_PASSWORD=D7FJ7QDKo5gF9KQAO1GL
# Security & CORS
JWT_SECRET=super-secret-development-jwt-key-32-chars-long
CORS_ORIGINS=https://support-dev.maskantech.in
+5 -1
View File
@@ -13,4 +13,8 @@ DATABASE_URL=postgresql://myapp_prod:CHANGE_ME@postgres:5432/myapp_prod
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=CHANGE_ME
REDIS_PASSWORD=CHANGE_ME
# Security & CORS
JWT_SECRET=CHANGE_ME_PRODUCTION_JWT_SECRET_32_CHARS
CORS_ORIGINS=https://app.supporthub.com,https://admin.supporthub.com
+9 -5
View File
@@ -6,11 +6,15 @@ BUILD_COMMAND=npm run build:test
# Database
POSTGRES_HOST=postgres
POSTGRES_DB=myapp_test
POSTGRES_USER=myapp_test
POSTGRES_PASSWORD=test_password
DATABASE_URL=postgresql://myapp_test:test_password@postgres:5432/myapp_test
POSTGRES_DB=support_test
POSTGRES_USER=support_user
POSTGRES_PASSWORD=7uJUmublUy0zWXU3bMrX
DATABASE_URL=postgresql://support_user:7uJUmublUy0zWXU3bMrX@postgres:5432/support_test
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=test_redis_password
REDIS_PASSWORD=PNx5hjbbZScCePmApFo3
# Security & CORS
JWT_SECRET=super-secret-testing-jwt-key-32-chars-long
CORS_ORIGINS=https://support-test.maskantech.in
+3 -2
View File
@@ -2,7 +2,7 @@ FROM node:22-alpine AS base
WORKDIR /app
RUN apk add --no-cache libc6-compat
RUN apk add --no-cache openssl
FROM base AS dependencies
@@ -31,9 +31,10 @@ WORKDIR /app
USER node
COPY --from=production-dependencies --chown=node:node /app/node_modules ./node_modules
COPY --from=builder --chown=node:node /app/node_modules/.prisma ./node_modules/.prisma
COPY --from=builder --chown=node:node /app/dist ./dist
COPY --chown=node:node package*.json ./
CMD ["node", "dist/main.js"]
CMD ["node", "dist/src/server.js"]
+13 -8
View File
@@ -1,12 +1,17 @@
# Development
docker compose --env-file .env.development -f docker-compose.development.yml up -d --build
### Development
- docker compose --env-file .env.development -f docker-compose.development.yml up -d --build
# Test
docker compose --env-file .env.test -f docker-compose.test.yml up --build
### Test
- docker compose --env-file .env.test -f docker-compose.test.yml up --build
# Production
docker compose --env-file .env.prod -f docker-compose.prod.yml up --build -d
### Production
- docker compose --env-file .env.prod -f docker-compose.prod.yml up --build -d
# Stop
docker compose -f docker-compose.prod.yml down
### Stop
- docker compose -f docker-compose.prod.yml down
### list containers
- docker compose --env-file .env.development -f docker-compose.development.yml ps
### logs
- docker compose --env-file .env.development -f docker-compose.development.yml logs -f
+2 -1
View File
@@ -6,7 +6,7 @@ services:
args:
BUILD_COMMAND: ${BUILD_COMMAND}
container_name: support-development
container_name: support-api-development
env_file:
- .env.development
@@ -39,6 +39,7 @@ services:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- postgres_development_data:/var/lib/postgresql
+2 -1
View File
@@ -6,7 +6,7 @@ services:
args:
BUILD_COMMAND: ${BUILD_COMMAND}
container_name: support-test
container_name: support-api-test
env_file:
- .env.test
@@ -39,6 +39,7 @@ services:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- postgres_test_data:/var/lib/postgresql
+194
View File
@@ -38,6 +38,7 @@
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"prisma": "^5.12.1",
"tsc-alias": "^1.9.2",
"tsx": "^4.7.2",
"typescript": "^5.4.5",
"vitest": "^1.5.0"
@@ -2414,6 +2415,20 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/anymatch": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
"dev": true,
"license": "ISC",
"dependencies": {
"normalize-path": "^3.0.0",
"picomatch": "^2.0.4"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
@@ -2486,6 +2501,19 @@
],
"license": "MIT"
},
"node_modules/binary-extensions": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
"integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/bintrees": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.2.tgz",
@@ -2638,6 +2666,44 @@
"node": "*"
}
},
"node_modules/chokidar": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
"dev": true,
"license": "MIT",
"dependencies": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
},
"engines": {
"node": ">= 8.10.0"
},
"funding": {
"url": "https://paulmillr.com/funding/"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/chokidar/node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dev": true,
"license": "ISC",
"dependencies": {
"is-glob": "^4.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/cli-cursor": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
@@ -3744,6 +3810,19 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/get-tsconfig": {
"version": "4.14.3",
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.14.3.tgz",
"integrity": "sha512-++QEw4DIY7WGoukz+/+A/8dGYPT9l9yIadnmSgZ8Rjr3YVSVDipQSO9CdnJo9ePqFqUUqh+wk9uIaoiAwsiPkA==",
"dev": true,
"license": "MIT",
"dependencies": {
"resolve-pkg-maps": "^1.0.0"
},
"funding": {
"url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
}
},
"node_modules/glob": {
"version": "10.5.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",
@@ -3986,6 +4065,19 @@
"url": "https://opencollective.com/ioredis"
}
},
"node_modules/is-binary-path": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
"dev": true,
"license": "MIT",
"dependencies": {
"binary-extensions": "^2.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
@@ -4735,6 +4827,20 @@
"@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.4"
}
},
"node_modules/mylas": {
"version": "2.1.14",
"resolved": "https://registry.npmjs.org/mylas/-/mylas-2.1.14.tgz",
"integrity": "sha512-BzQguy9W9NJgoVn2mRWzbFrFWWztGCcng2QI9+41frfk+Athwgx3qhqhvStz7ExeUUu7Kzw427sNzHpEZNINog==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=16.0.0"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/raouldeheer"
}
},
"node_modules/nanoid": {
"version": "3.3.18",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz",
@@ -4782,6 +4888,16 @@
"node-gyp-build-optional-packages-test": "build-test.js"
}
},
"node_modules/normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/npm-run-path": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz",
@@ -5163,6 +5279,19 @@
"dev": true,
"license": "MIT"
},
"node_modules/plimit-lit": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/plimit-lit/-/plimit-lit-1.6.1.tgz",
"integrity": "sha512-B7+VDyb8Tl6oMJT9oSO2CW8XC/T4UcJGrwOVoNGwOQsQYhlpfajmrMj5xeejqaASq3V/EqThyOeATEOMuSEXiA==",
"dev": true,
"license": "MIT",
"dependencies": {
"queue-lit": "^1.5.1"
},
"engines": {
"node": ">=12"
}
},
"node_modules/postcss": {
"version": "8.5.26",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.26.tgz",
@@ -5335,6 +5464,16 @@
"node": ">=6"
}
},
"node_modules/queue-lit": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/queue-lit/-/queue-lit-1.5.2.tgz",
"integrity": "sha512-tLc36IOPeMAubu8BkW8YDBV+WyIgKlYU7zUNs0J5Vk9skSZ4JfGlPOqplP0aHdfv7HL0B2Pg6nwiq60Qc6M2Hw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
}
},
"node_modules/queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -5369,6 +5508,19 @@
"dev": true,
"license": "MIT"
},
"node_modules/readdirp": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
"dev": true,
"license": "MIT",
"dependencies": {
"picomatch": "^2.2.1"
},
"engines": {
"node": ">=8.10.0"
}
},
"node_modules/real-require": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz",
@@ -5418,6 +5570,16 @@
"node": ">=4"
}
},
"node_modules/resolve-pkg-maps": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
"integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
"dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
}
},
"node_modules/restore-cursor": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
@@ -6079,6 +6241,38 @@
"typescript": ">=4.2.0"
}
},
"node_modules/tsc-alias": {
"version": "1.9.2",
"resolved": "https://registry.npmjs.org/tsc-alias/-/tsc-alias-1.9.2.tgz",
"integrity": "sha512-VTWQGMv0xXCEyHDLpmV2DEvGYHMxwsyx87dZeou2ynkM0+WOFdHe+KWiRucavMPUEdQysr7xSu60Y/WY0R4YKA==",
"dev": true,
"license": "MIT",
"dependencies": {
"chokidar": "^3.5.3",
"commander": "^9.0.0",
"get-tsconfig": "^4.10.0",
"globby": "^11.0.4",
"mylas": "^2.1.9",
"normalize-path": "^3.0.0",
"plimit-lit": "^1.2.6"
},
"bin": {
"tsc-alias": "dist/bin/index.js"
},
"engines": {
"node": ">=16.20.2"
}
},
"node_modules/tsc-alias/node_modules/commander": {
"version": "9.5.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
"integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^12.20.0 || >=14"
}
},
"node_modules/tslib": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+24 -12
View File
@@ -4,22 +4,27 @@
"description": "SupportHub API — Production Enterprise Modular Monolith API",
"main": "dist/server.js",
"scripts": {
"dev": "tsx watch src/server.ts",
"development": "tsx --env-file=.env.development watch src/server.ts",
"dev:env": "tsx --env-file=.env.development watch src/server.ts",
"build": "tsc -p tsconfig.build.json",
"start": "node dist/server.js",
"start:prod": "NODE_ENV=production node dist/server.js",
"start:dev": "NODE_ENV=development tsx src/server.ts",
"dev": "tsx watch --env-file=.env.development src/server.ts",
"development": "tsx watch --env-file=.env.development src/server.ts",
"dev:env": "tsx watch --env-file=.env.development src/server.ts",
"build": "prisma generate && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
"build:development": "prisma generate && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
"build:test": "prisma generate && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
"build:prod": "prisma generate && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
"start": "node dist/src/server.js",
"start:dev": "node --env-file=.env.development dist/src/server.js",
"start:test": "node --env-file=.env.test dist/src/server.js",
"start:prod": "node --env-file=.env.prod dist/src/server.js",
"typecheck": "tsc --noEmit",
"architecture:check": "tsx scripts/check-architecture.ts",
"lint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.ts\"",
"lint:fix": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.ts\" --fix",
"format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.ts\" \"prisma/**/*.ts\"",
"format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.ts\" \"prisma/**/*.ts\"",
"test": "vitest run",
"test": "npm run test:unit",
"test:unit": "vitest run",
"test:watch": "vitest",
"test:env": "vitest run --env-file=.env.test",
"test:unit": "vitest run tests/unit",
"test:integration": "vitest run tests/integration",
"test:e2e": "vitest run tests/e2e",
"test:concurrency": "vitest run tests/concurrency",
@@ -29,9 +34,15 @@
"prisma:deploy": "prisma migrate deploy",
"prisma:seed": "tsx prisma/seed/index.ts",
"openapi:generate": "tsx scripts/generate-openapi.ts",
"docker:up": "docker compose -f docker-compose.dev.yml up -d",
"docker:down": "docker compose -f docker-compose.dev.yml down",
"docker:build:prod": "docker build -t supporthub-api:latest ."
"docker:up:dev": "docker compose --env-file .env.development -f docker-compose.development.yml up -d",
"docker:down:dev": "docker compose --env-file .env.development -f docker-compose.development.yml down",
"docker:up:test": "docker compose --env-file .env.test -f docker-compose.test.yml up -d",
"docker:down:test": "docker compose --env-file .env.test -f docker-compose.test.yml down",
"docker:up:prod": "docker compose --env-file .env.prod -f docker-compose.prod.yml up -d",
"docker:down:prod": "docker compose --env-file .env.prod -f docker-compose.prod.yml down",
"docker:build:dev": "docker compose --env-file .env.development -f docker-compose.development.yml build",
"docker:build:test": "docker compose --env-file .env.test -f docker-compose.test.yml build",
"docker:build:prod": "docker compose --env-file .env.prod -f docker-compose.prod.yml build"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.556.0",
@@ -64,6 +75,7 @@
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"prisma": "^5.12.1",
"tsc-alias": "^1.9.2",
"tsx": "^4.7.2",
"typescript": "^5.4.5",
"vitest": "^1.5.0"