Skip to content

Feature/ai content workflow#5

Open
SofiaInchausti wants to merge 28 commits intonanlabs:mainfrom
SofiaInchausti:feature/ai-content-workflow
Open

Feature/ai content workflow#5
SofiaInchausti wants to merge 28 commits intonanlabs:mainfrom
SofiaInchausti:feature/ai-content-workflow

Conversation

@SofiaInchausti
Copy link

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant