SEO_iamge_renamer_starting_.../packages/worker/package.json
DustyWalker b198bfe3cf
Some checks failed
CI Pipeline / Setup Dependencies (push) Has been cancelled
CI Pipeline / Check Dependency Updates (push) Has been cancelled
CI Pipeline / Setup Dependencies (pull_request) Has been cancelled
CI Pipeline / Check Dependency Updates (pull_request) Has been cancelled
CI Pipeline / Lint & Format Check (push) Has been cancelled
CI Pipeline / Unit Tests (push) Has been cancelled
CI Pipeline / Integration Tests (push) Has been cancelled
CI Pipeline / Build Application (push) Has been cancelled
CI Pipeline / Docker Build & Test (push) Has been cancelled
CI Pipeline / Security Scan (push) Has been cancelled
CI Pipeline / Deployment Readiness (push) Has been cancelled
CI Pipeline / Lint & Format Check (pull_request) Has been cancelled
CI Pipeline / Unit Tests (pull_request) Has been cancelled
CI Pipeline / Integration Tests (pull_request) Has been cancelled
CI Pipeline / Build Application (pull_request) Has been cancelled
CI Pipeline / Docker Build & Test (pull_request) Has been cancelled
CI Pipeline / Security Scan (pull_request) Has been cancelled
CI Pipeline / Deployment Readiness (pull_request) Has been cancelled
feat(worker): complete production-ready worker service implementation
This commit delivers the complete, production-ready worker service that was identified as missing from the audit. The implementation includes:

## Core Components Implemented:

### 1. Background Job Queue System 
- Progress tracking with Redis and WebSocket broadcasting
- Intelligent retry handler with exponential backoff strategies
- Automated cleanup service with scheduled maintenance
- Queue-specific retry policies and failure handling

### 2. Security Integration 
- Complete ClamAV virus scanning service with real-time threats detection
- File validation and quarantine system
- Security incident logging and user flagging
- Comprehensive threat signature management

### 3. Database Integration 
- Prisma-based database service with connection pooling
- Image status tracking and batch management
- Security incident recording and user flagging
- Health checks and statistics collection

### 4. Monitoring & Observability 
- Prometheus metrics collection for all operations
- Custom business metrics and performance tracking
- Comprehensive health check endpoints (ready/live/detailed)
- Resource usage monitoring and alerting

### 5. Production Docker Configuration 
- Multi-stage Docker build with Alpine Linux
- ClamAV daemon integration and configuration
- Security-hardened container with non-root user
- Health checks and proper signal handling
- Complete docker-compose setup with Redis, MinIO, Prometheus, Grafana

### 6. Configuration & Environment 
- Comprehensive environment validation with Joi
- Redis integration for progress tracking and caching
- Rate limiting and throttling configuration
- Logging configuration with Winston and file rotation

## Technical Specifications Met:

 **Real AI Integration**: OpenAI GPT-4 Vision + Google Cloud Vision with fallbacks
 **Image Processing Pipeline**: Sharp integration with EXIF preservation
 **Storage Integration**: MinIO/S3 with temporary file management
 **Queue Processing**: BullMQ with Redis, retry logic, and progress tracking
 **Security Features**: ClamAV virus scanning with quarantine system
 **Monitoring**: Prometheus metrics, health checks, structured logging
 **Production Ready**: Docker, Kubernetes compatibility, environment validation

## Integration Points:
- Connects with existing API queue system
- Uses shared database models and authentication
- Integrates with infrastructure components
- Provides real-time progress updates via WebSocket

This resolves the critical gap identified in the audit and provides a complete, production-ready worker service capable of processing images with real AI vision analysis at scale.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 18:37:04 +02:00

105 lines
No EOL
3.1 KiB
JSON

{
"name": "@seo-image-renamer/worker",
"version": "1.0.0",
"description": "Worker service for AI-powered image processing and SEO filename generation",
"main": "dist/main.js",
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"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",
"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/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/config": "^3.1.1",
"@nestjs/bullmq": "^10.0.1",
"@nestjs/schedule": "^4.0.0",
"@nestjs-modules/ioredis": "^2.0.2",
"@nestjs/terminus": "^10.2.0",
"@nestjs/throttler": "^5.0.1",
"@prisma/client": "^5.6.0",
"bullmq": "^4.15.0",
"redis": "^4.6.10",
"ioredis": "^5.3.2",
"sharp": "^0.32.6",
"exifr": "^7.1.3",
"piexifjs": "^1.0.6",
"archiver": "^6.0.1",
"minio": "^7.1.3",
"aws-sdk": "^2.1489.0",
"openai": "^4.20.1",
"@google-cloud/vision": "^4.0.2",
"node-clamav": "^0.8.5",
"axios": "^1.6.0",
"class-validator": "^0.14.0",
"class-transformer": "^0.5.1",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1",
"uuid": "^9.0.1",
"lodash": "^4.17.21",
"mime-types": "^2.1.35",
"file-type": "^18.7.0",
"sanitize-filename": "^1.6.3",
"winston": "^3.11.0",
"winston-daily-rotate-file": "^4.7.1",
"@nestjs/websockets": "^10.2.7",
"@nestjs/platform-socket.io": "^10.2.7",
"socket.io": "^4.7.4",
"prom-client": "^15.0.0",
"joi": "^17.11.0",
"curl": "^0.1.4"
},
"devDependencies": {
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.2",
"@types/node": "^20.3.1",
"@types/uuid": "^9.0.7",
"@types/lodash": "^4.14.202",
"@types/mime-types": "^2.1.4",
"@types/archiver": "^6.0.2",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.5.0",
"prettier": "^3.0.0",
"source-map-support": "^0.5.21",
"supertest": "^6.3.3",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.3",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.1",
"typescript": "^5.1.3"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}