Skip to content

Latest commit

 

History

134 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Discord Backers on Open Collective Sponsors on Open Collective Donate us Support us Follow us on Twitter

Description

GDPR Audit Backend - API сервер для анализа веб-сайтов на соответствие GDPR.

Queue System

Проект поддерживает 4 режима работы очереди для обработки сканирований:

1. PostgreSQL Queue (по умолчанию)

QUEUE_TYPE=postgres
  • ✅ Использует базу данных PostgreSQL для хранения задач
  • ✅ Не требует дополнительных сервисов (Redis)
  • ✅ Простая настройка и деплой
  • ⚠️ Подходит для небольших и средних нагрузок
  • 💡 Use case: Development, staging, малый/средний production

2. Redis/BullMQ Queue

QUEUE_TYPE=redis
REDIS_URL=redis://localhost:6379
  • ✅ Высокопроизводительная очередь на базе Redis и BullMQ
  • ✅ Локальный worker обрабатывает все задачи на VPS
  • ✅ Лучшая производительность для высоких нагрузок
  • ⚠️ Требует Redis сервер (дополнительная RAM ~64-128MB)
  • 💡 Use case: Production с высокой нагрузкой, все задачи обрабатываются локально

3. Hybrid Queue (Redis + Cloud Run overflow)

QUEUE_TYPE=hybrid
REDIS_URL=redis://localhost:6379
WORKER_URL=https://your-worker.run.app
OVERFLOW_QUEUE_THRESHOLD=2
OVERFLOW_WAIT_THRESHOLD_SEC=120
  • ✅ Оптимизация затрат: 90%+ задач обрабатываются локально (бесплатно)
  • ✅ При пиковых нагрузках автоматически использует Cloud Run
  • ✅ Cloud Run масштабируется до нуля ($0 в idle)
  • ⚠️ Требует Redis + настройку Cloud Run worker
  • 💡 Use case: Production с переменной нагрузкой, оптимизация затрат

4. Cloud Run Queue (serverless only)

QUEUE_TYPE=cloudrun
WORKER_URL=https://your-worker.run.app
  • ✅ Полностью serverless, масштабируется автоматически
  • ✅ Не требует постоянно работающего VPS worker
  • ⚠️ Выше стоимость при постоянной нагрузке
  • 💡 Use case: Serverless архитектура, спорадические нагрузки

Общие переменные окружения:

QUEUE_TYPE=postgres|redis|hybrid|cloudrun  # Тип очереди (по умолчанию: postgres)
REDIS_URL=redis://localhost:6379           # URL Redis (для redis/hybrid)
WORKER_ENABLED=true                        # Включить локальный worker
WORKER_CONCURRENCY=1                       # Параллельные обработчики
WORKER_URL=https://worker.run.app          # URL Cloud Run worker (для hybrid/cloudrun)
OVERFLOW_QUEUE_THRESHOLD=2                 # Порог очереди для overflow (hybrid)
OVERFLOW_WAIT_THRESHOLD_SEC=120            # Порог ожидания для overflow (hybrid)

Docker Compose профили:

  • postgres - API с PostgreSQL очередью (по умолчанию)
  • redis - API с Redis/BullMQ очередью

Важно: При использовании QUEUE_TYPE=postgres RedisModule не инициализируется, что экономит ресурсы и предотвращает ошибки подключения к несуществующему Redis.

Project setup

$ npm install

Compile and run the project

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Run tests

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Deployment

When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the deployment documentation for more information.

If you are looking for a cloud-based platform to deploy your NestJS application, check out Mau, our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:

$ npm install -g @nestjs/mau
$ mau deploy

With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.

Resources

Check out a few resources that may come in handy when working with NestJS:

  • Visit the NestJS Documentation to learn more about the framework.
  • For questions and support, please visit our Discord channel.
  • To dive deeper and get more hands-on experience, check out our official video courses.
  • Deploy your application to AWS with the help of NestJS Mau in just a few clicks.
  • Visualize your application graph and interact with the NestJS application in real-time using NestJS Devtools.
  • Need help with your project (part-time to full-time)? Check out our official enterprise support.
  • To stay in the loop and get updates, follow us on X and LinkedIn.
  • Looking for a job, or have a job to offer? Check out our official Jobs board.

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

About

NestJS backend for GDPR Audit application

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages