How rjmad1/fluxora works
1. Repository shape
- This is a monorepo for the Fluxora platform, not just an app codebase.
- It combines product/architecture governance, spec-driven planning artifacts, and two runtime applications: a NestJS backend and a Next.js frontend.
2. Governance and spec pipeline
- The .specify, .cursor, and .agents folders hold Spec-Kit workflows, prompts, templates, and agent integrations.
- specs/001-* and specs/002-* contain feature-level architecture/spec/plan/task artifacts.
- PM_Deliverables/ and Functional Requirements/ are upstream business inputs, so architecture is intentionally documentation-driven before implementation.
3. Frontend boundary
- apps/frontend is a Next.js App Router client.
- It has separate surfaces for:
- a workspace/admin experience at src/app/workspaces
- a tokenized approval portal at src/app/approval/[token]
- Shared UI components include Composer and AnalyticsDashboard, indicating the frontend is both an operations console and an approval workflow entry point.
4. Backend boundary
- apps/backend is a NestJS modular API.
- The code is split into feature domains rather than a single monolith:
- ai
- analytics
- asset
- identity
- observability
- publishing
- secrets
- tenant
- This suggests a domain-oriented backend where each module owns its own controllers/services and can be diagrammed as separate backend subsystems.
5. Tenant isolation and identity
- The tenant module and tenant.interceptor.ts indicate tenant context injection/enforcement at request time.
- prisma.service.ts, schema.prisma, and the prisma/migrations/rls_init.sql file show that PostgreSQL row-level security is part of the isolation strategy.
- identity/keycloak.module.ts makes Keycloak the identity boundary, likely handling OIDC/OAuth2 authentication and tenant/user access control.
6. Publishing and approval workflow
- The publishing module is the most workflow-heavy part of the backend.
- Files like publish.controller.ts, approval.controller.ts, publish.processor.ts, publish.activities.ts, and token-refresh.activities.ts show a split between:
- API entry points
- asynchronous processing
- workflow activities
- token refresh/adaptor logic
- This is the likely core of the product’s scheduling, approval, and distribution pipeline.
7. External channel adapters
- publishing/adapters.service.ts implies the backend wraps external social platforms behind an internal adapter layer.
- In architecture terms, Fluxora’s custom logic sits behind a provider abstraction, so channel integrations can be swapped or extended without changing the rest of the platform.
8. Asset and content handling
- The asset module is a separate boundary for media/content management.
- Because the README frames Fluxora around content adaptation and distribution, the asset subsystem is likely the hub for upload, persistence, and preparation of media artifacts before publishing.
9. AI and compliance
- ai/brand-compliance.service.ts shows a dedicated AI-facing service for brand-voice or policy validation.
- This aligns with the repository’s stated differentiator around AI content operations rather than generic LLM usage.
- The AI layer is therefore a guardrail/service module, not the primary app surface.
10. Secrets, observability, and event boundaries
- secrets/vault.service.ts and oauth.controller.ts isolate sensitive material such as OAuth tokens, API keys, or certificates behind a Vault-backed service boundary.
- observability/otel.middleware.ts and outbox.interceptor.ts indicate instrumentation plus an outbox-style event capture path for reliable telemetry or domain events.
- This suggests the runtime is designed to emit traces/events/metrics without coupling them directly to business handlers.
11. Infrastructure and platform integration
- infra/kong/kong.yml shows an API gateway layer in front of the backend.
- docker-compose.infra.yaml implies a local/integration deployment environment for platform services.
- The README’s target stack also names Temporal, Kafka, PostgreSQL, ClickHouse, OpenSearch, MinIO, CloudFront, Vault, and OpenTelemetry, so the intended architecture is a service-oriented platform with workflow, eventing, storage, and analytics backends.
12. Diagramming takeaway
- A good architecture diagram for this repo should separate:
- governance/spec artifacts
- frontend workspaces + approval portal
- NestJS backend domains
- identity/tenant enforcement
- publishing workflow and adapter layer
- secrets/observability infrastructure
- external platform services
- The key architectural theme is strict multi-tenant isolation with workflow-driven publishing and extensible integrations, backed by spec-first governance.
Main entry points: app.module.ts API Shell · publishing.module.ts Publishing · .specify Spec Kit · page.tsx Workspace UI
Components 22
Governance
Spec-first planning, prompts, and product artifacts.
- Spec Kit · Spec-driven workflows, templates, and agent integrations.
.specify - Agent Skills · Cursor and agent skill packs for spec analysis, planning, and implementation.
.cursor - PM Inputs · Upstream strategy, PRD, personas, backlog, and metrics artifacts.
PM_Deliverables - Requirements · Functional requirements and source business inputs.
Functional Requirements - Feature Specs · Spec, plan, and task artifacts for platform and portal work.
specs/001-platform-architecture - Portal Specs · Spec, plan, and task artifacts for adapters and portal work.
specs/002-social-adapters-and-portal
Frontend
Next.js surfaces for workspace operations and approvals.
- Workspace UI · Admin/workspace experience in the Next.js App Router.
apps/frontend/src/app/workspaces/page.tsx - Approval Portal · Token-based approval surface for review and consent flows.
apps/frontend/src/app/approval/[token]/page.tsx - Composer · Shared content composition and editing surface.
apps/frontend/src/components/Composer.tsx - Analytics · Shared dashboard for performance and operational insight.
apps/frontend/src/components/AnalyticsDashboard.tsx - App Shell · Root layout and page composition for the frontend.
apps/frontend/src/app/layout.tsx
Backend
NestJS domain services, workflow, isolation, and integrations.
- API Shell · Backend application bootstrap and module assembly.
apps/backend/src/app.module.ts - Tenant · Tenant context injection and request-time enforcement.
apps/backend/src/tenant/tenant.module.ts - Identity · Keycloak-backed authentication and access boundary.
apps/backend/src/identity/keycloak.module.ts - Publishing · Publish, approval, processor, activities, and adapter orchestration.
apps/backend/src/publishing/publishing.module.ts - Assets · Media and content management boundary.
apps/backend/src/asset/asset.module.ts - AI Guardrails · Brand and policy compliance checks for content operations.
apps/backend/src/ai/ai.module.ts - Secrets · Secure handling of OAuth tokens, keys, and certificates.
apps/backend/src/secrets/secrets.module.ts - Observability · OpenTelemetry middleware and outbox capture for runtime signals.
apps/backend/src/observability/otel.middleware.ts
Platform
Infrastructure, gateway, and external runtime dependencies.
- Gateway · Kong gateway configuration in front of backend services.
infra/kong/kong.yml - Infra Stack · Local integration environment for platform services.
docker-compose.infra.yaml - Data Plane · PostgreSQL, Temporal, Kafka, ClickHouse, OpenSearch, MinIO, Vault, and telemetry backends.
Connections 30
- PM Inputs → Spec Kit: shape inputs · Business artifacts feed the spec-first workflow.
- Requirements → Spec Kit: define scope · Functional requirements inform feature specs and plans.
- Spec Kit → Feature Specs: produces · Spec Kit creates architecture and implementation artifacts.
- Spec Kit → Portal Specs: produces · Spec Kit creates feature-level artifacts for portal work.
- Agent Skills → Spec Kit: assist · Agent skills support the spec pipeline and implementation flow.
- Feature Specs → Workspace UI: guides · Platform architecture informs the admin workspace UI.
- Portal Specs → Approval Portal: guides · Portal specs drive the approval experience.
- App Shell → Workspace UI: hosts · Root app shell composes the workspace route surface.
- App Shell → Approval Portal: hosts · Root app shell composes the approval route surface.
- Composer → Workspace UI: supports · Composer powers content creation and editing flows.
- Analytics → Workspace UI: supports · Dashboard provides operational insight in the workspace.
- Gateway → API Shell: routes · API gateway fronts the NestJS backend.
- API Shell → Tenant: loads · Application bootstrap includes tenant enforcement.
- API Shell → Identity: loads · Application bootstrap includes identity integration.
- API Shell → Publishing: loads · Application bootstrap includes the publish workflow domain.
- API Shell → Assets: loads · Application bootstrap includes content management.
- API Shell → AI Guardrails: loads · Application bootstrap includes AI compliance services.
- API Shell → Secrets: loads · Application bootstrap includes secret handling.
- API Shell → Observability: loads · Application bootstrap includes telemetry and outbox hooks.
- Tenant → Data Plane: enforces · Tenant module relies on PostgreSQL row-level security and tenant-aware persistence.
- Identity → Data Plane: authenticates · Identity boundary depends on platform identity and secure runtime services.
- Publishing → Assets: uses · Publishing orchestrates asset preparation before distribution.
- Publishing → AI Guardrails: checks · Publishing invokes brand compliance guardrails.
- Publishing → Secrets: reads · Publishing accesses provider credentials and tokens.
- Publishing → Observability: emits · Publishing produces workflow telemetry and domain events.
- Assets → Data Plane: stores · Assets persist in platform storage and data services.
- AI Guardrails → Data Plane: queries · AI services call into model- and data-backed runtime services.
- Secrets → Data Plane: backs · Vault-backed secrets are part of the platform data plane.
- Observability → Data Plane: ships · Telemetry and outbox data flow into the platform services.
- Infra Stack → Data Plane: provisions · Local infrastructure brings up the platform runtime dependencies.