Open
Conversation
Introduce a Redis-backed event bus for async content/status events and bridge it to websocket rooms, plus local Redis compose/env configuration for development. Made-with: Cursor
Emit explicit AI processing stages from backend and surface them in the create/details pages so users can follow piece creation, localization setup, and suggestion generation in realtime. Made-with: Cursor
Add focused documentation for database design, realtime behavior, and infrastructure/devops tradeoffs while refreshing architecture and workflow notes for clearer project rationale. Made-with: Cursor
… guide Replace the challenge template README with complete project documentation covering local run, env configuration, API/realtime flow, testing, CI, and Kubernetes/Argo CD deployment. Made-with: Cursor
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR initializes the core architecture for the Campaign API and the Content Workflow system. It sets up the global configuration, database connection, and a robust event-driven system using Redis Pub/Sub.
Key Changes:
App Initialization: Configured main.ts with global validation pipes (whitelist, transform) and Swagger documentation.
Database Integration: Implemented asynchronous TypeORM connection in AppModule with support for PostgreSQL and automatic entity loading.
Event-Driven Architecture: Created EventsService using Redis to handle asynchronous communication between modules (crucial for AI processing).
Module Structure: Established the CampaignModule as a feature module, exporting services to allow cross-module interaction.
Dependencies: * @nestjs/typeorm, typeorm, pg (Postgres support)
redis (Client for Event Bus)
class-validator, class-transformer (For DTO validation)
@nestjs/swagger (API Documentation)
Fixes # (issue_number)
Type of Change
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Documentation update
How Has This Been Tested?
The changes were tested locally using a Docker-based environment for PostgreSQL and Redis.
Module Bootstrapping: Verified that the application starts without errors and connects to Redis/Postgres.
API Docs: Accessed http://localhost:3000/docs to confirm Swagger is rendering correctly.
Event Bus Test: Triggered EventsService.publish() and verified that subscribers received the payload correctly.
Validation Test: Sent invalid JSON to a mock endpoint to confirm ValidationPipe is stripping non-whitelisted fields.
[x] Integration Test: Redis Pub/Sub Connectivity
[x] Manual Test: Swagger UI Verification
Checklist
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] Any dependent changes have been merged and published in downstream modules
[x] I have checked my code and corrected any misspellings