A private AI creative workspace for Aiwa Media Group teams and client networks.
The platform will provide assisted image, video, and voice generation through BytePlus APIs, supported by NVIDIA-powered creative reasoning, story development, prompt enhancement, and workflow orchestration.
Project status: Private-alpha foundation and interactive product demo Staging: creator.aiwamediagroup.com
Repository: baba-dev/creator-platform
Aiwa Creators Platform is being built as a practical creative production environment rather than a thin model playground.
Users will be able to:
- Choose image, video, or voice generation.
- Compare available models, capabilities, descriptions, and credit prices.
- Build creative briefs and storylines with an AI copilot.
- Upload reference assets and organize work into projects.
- Save brand kits, generation preferences, and reusable workflows.
- Track generation history, costs, outputs, and remaining credits.
- Work individually or through a shared organization account.
Administrators will be able to:
- Create and manage users, organizations, and team memberships.
- Record OMR cash and cheque payments.
- Grant credits after payment confirmation.
- Allocate internal budgets and per-user spending limits.
- Configure enabled models, pricing, margins, and usage caps.
- Inspect, retry, cancel, or refund generation jobs.
- Monitor BytePlus usage, provider cost, customer revenue, and gross margin.
- Review audit, moderation, and provider health events.
Provider boundaries are deliberate and must remain explicit.
All customer-facing media generation is performed through BytePlus services:
- Image generation and editing
- Video generation
- OmniHuman 1.5 talking-avatar generation through BytePlus Vision
- Text-to-speech
- Future motion-generation capabilities
NVIDIA AI APIs are used for reasoning and creative assistance:
- Creative briefs
- Prompt improvement
- Storyline and storyboard generation
- Shot lists and scene timing
- Model recommendations
- Arabic and English localization
- Converting conversational requests into validated generation parameters
NVIDIA does not replace BytePlus as the media-generation provider.
The first release uses a modular monolith with a separately deployed background worker.
flowchart TD
A["Browser"] --> B["Next.js web and API"]
B --> C["MariaDB"]
B --> D["Redis and BullMQ"]
D --> E["Background worker"]
E --> F["BytePlus media APIs"]
E --> G["NVIDIA reasoning APIs"]
E --> H["Object storage"]
Long-running provider calls must never execute inside a browser request. The web application validates and reserves a job; the worker performs provider submission, polling, reconciliation, and asset persistence.
| Area | Choice |
|---|---|
| Runtime | Node.js 24 LTS |
| Workspace | pnpm workspaces and Turborepo |
| Application | Next.js App Router and TypeScript |
| Interface | shadcn/ui, Tailwind CSS, and Lucide |
| Forms and validation | React Hook Form and Zod |
| Authentication | Better Auth with application-owned RBAC |
| Database | MariaDB |
| ORM and migrations | Prisma |
| Background processing | Redis and BullMQ |
| Media storage | Provider-neutral asset storage (private local backend today; S3/external adapters planned) |
| Media generation | BytePlus ModelArk and Seed Speech |
| Creative reasoning | NVIDIA AI APIs |
| Testing | Vitest, React Testing Library, and Playwright |
| Deployment | Systemd, Nginx, immutable release archives, and GitHub Actions |
| Observability | OpenTelemetry and structured application logs |
Dependency versions will be pinned by the lockfile when the application bootstrap is committed.
The application uses the Pencil & Pixel light/dark design system: a warm paper-and-graphite foundation with vivid creative accents and restrained sketch details.
- Definitive implementation guide: docs/design-system.md
- Living component and token reference:
/design-system - Semantic tokens:
apps/web/src/app/globals.css
All new pages must use semantic colour tokens and be reviewed in both modes.
creator-platform/
├── .github/
│ ├── workflows/
│ ├── CODEOWNERS
│ ├── dependabot.yml
│ └── pull_request_template.md
├── apps/
│ ├── web/
│ └── worker/
├── packages/
│ ├── ui/
│ ├── db/
│ ├── core/
│ ├── assets/
│ ├── credits/
│ ├── providers/
│ │ ├── byteplus/
│ │ └── nvidia/
│ ├── validation/
│ ├── config/
│ ├── observability/
│ └── testkit/
├── docs/
│ ├── architecture/
│ ├── product/
│ ├── providers/
│ ├── finance/
│ ├── runbooks/
│ └── adr/
├── infra/
│ ├── deploy/
│ ├── nginx/
│ └── systemd/
├── AGENTS.md
├── compose.dev.yml
├── compose.production.yml
├── pnpm-workspace.yaml
├── turbo.json
├── .env.example
└── package.json
Approved product identity is Creators · Creative Cursor (01-A).
- Runtime brand media:
apps/web/public/brand/ - Logos:
/brand/logos/ - Favicons:
/brand/icons/favicon/ - PWA icons:
/brand/icons/pwa/ - Brand usage notes: docs/branding.md
Keep product-brand files separate from the customer/generated Asset domain.
The platform uses an internal credit ledger. BytePlus provider units are never exposed as the customer's wallet currency.
Customer payments are collected manually in OMR:
- A finance administrator records a cash or cheque payment.
- Cash may be confirmed immediately.
- Cheques remain pending until cleared.
- A confirmed payment creates an immutable credit-ledger transaction.
- Generation jobs reserve credits before provider submission.
- Completed jobs capture the charge.
- Failed or cancelled jobs release or refund the reservation.
Payment states:
DRAFT -> PENDING -> CONFIRMED
-> REJECTED
CONFIRMED -> REVERSED
Corrections use reversal or adjustment transactions. Administrators must never directly overwrite a wallet balance.
These are non-negotiable implementation rules:
- Store OMR values as integer baisa.
- Store USD provider costs as integer micro-USD.
- Never use JavaScript floating-point values for money.
- Derive wallet balances from immutable ledger entries and maintain only a transactional cache.
- Lock the price version and exchange-rate snapshot when a quote is accepted.
- Reserve credits before submitting a billable provider request.
- Require an idempotency key for every generation and financial mutation.
- Persist the BytePlus request ID against the internal generation job.
- Reconcile every reservation into capture, release, refund, or manual-review state.
- Treat BytePlus usage as billable provider cost.
- Prevent customer spending beyond organization and platform caps.
- Record every administrative financial action in the audit log.
The platform is organization-first.
An organization owns:
- Credit wallet
- Projects and generated assets
- Brand kits
- Members and roles
- Payment records
- Usage limits
- Generation history
Initial platform roles:
| Role | Responsibility |
|---|---|
| Platform owner | Full platform and configuration control |
| Platform administrator | Customer, model, and operational management |
| Finance administrator | Payments, credit grants, reversals, and reporting |
| Operator | Generation job and provider operations |
| Support | Read-only customer support with audited actions |
| Organization owner | Team, project, and wallet visibility |
| Organization member | Creative work within assigned limits |
| Organization viewer | Read-only access |
Administrative accounts will require multi-factor authentication before production launch.
DRAFT
-> QUOTED
-> CREDIT_RESERVED
-> QUEUED
-> SUBMITTED
-> PROCESSING
-> SUCCEEDED
-> FAILED
-> CANCELLED
-> MANUAL_REVIEW
Every transition is validated server-side and recorded with timestamps. Queue retries must be idempotent because a retried worker may run more than once.
Initial queues:
reasoningimage-generationvideo-submitvideo-statusvoice-generationasset-ingestionprovider-reconciliationnotificationsmaintenance
The following workflow becomes available once the bootstrap milestone lands.
- Node.js 24 LTS
- Corepack
- Docker with Compose
- Git
git clone git@github.com:baba-dev/creator-platform.git
cd creator-platform
corepack enable
pnpm install
cp .env.example .env
docker compose -f compose.dev.yml up -d
pnpm db:migrate
pnpm db:seed
pnpm devExpected local services:
| Service | Purpose |
|---|---|
| Next.js web | User studio, admin console, and API |
| Worker | BytePlus and NVIDIA job processing |
| MariaDB | Persistent application and ledger data |
| Redis | Queues, locks, throttling, and ephemeral progress |
| Object-storage emulator | Local media development |
No real credentials may be committed. Copy .env.example to .env; the
example contains variable names and safe placeholders only.
Server-side configuration groups:
APP_URL=
AUTH_SECRET=
DATABASE_URL=
REDIS_URL=
BYTEPLUS_API_KEY=
BYTEPLUS_REGION=ap-southeast-1
BYTEPLUS_MODELARK_BASE_URL=
BYTEPLUS_VISION_ACCESS_KEY_ID=
BYTEPLUS_VISION_SECRET_ACCESS_KEY=
BYTEPLUS_VISION_BASE_URL=https://cv.byteplusapi.com
BYTEPLUS_SPEECH_API_KEY=
BYTEPLUS_SPEECH_APP_KEY=aGjiRDfUWi
BYTEPLUS_SPEECH_BASE_URL=
BYTEPLUS_REQUEST_TIMEOUT_MS=180000
NVIDIA_API_KEY=
NVIDIA_BASE_URL=
NVIDIA_REASONING_MODEL=
S3_ENDPOINT=
S3_REGION=
S3_BUCKET=
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
OTEL_EXPORTER_OTLP_ENDPOINT=Provider credentials must never use the NEXT_PUBLIC_ prefix.
After CI passes and the provider changes are merged, add the ModelArk key to
the untracked root .env. The image smoke test is deliberately billable and
will not run until its acknowledgement is set:
BYTEPLUS_API_KEY=your-modelark-api-key
BYTEPLUS_REGION=ap-southeast-1
BYTEPLUS_LIVE_SMOKE_ACK=I_UNDERSTAND_THIS_IS_BILLABLEpnpm --filter @aiwa/worker smoke:byteplusThe command generates one 2K PNG, validates the download, and writes it with
owner-only permissions under .data/byteplus-smoke/. It never logs the API
key, prompt, or temporary provider output URL. Seed Speech v3 uses a separate
BYTEPLUS_SPEECH_API_KEY; a ModelArk key or legacy App ID/access-token pair is
not accepted by this integration.
Run the separately billable voice smoke test only after setting the Seed Speech key and the same billing acknowledgement:
pnpm --filter @aiwa/worker smoke:byteplus:voiceOn a deployed server, the equivalent root-controlled operation loads the persistent service environment and stores the image outside immutable releases:
sudo creator-ops byteplus-smokeSuccessful output is written under
/var/www/creator-platform/shared/byteplus-smoke/ with owner-only file
permissions.
The repository also includes an opt-in BytePlus live image smoke GitHub
Actions workflow. It is never triggered by push or pull request because the
generation is billable. Run it manually only after reviewing provider-adapter
changes, type I_UNDERSTAND_THIS_IS_BILLABLE, and ensure the repository
BYTEPLUS_API_KEY secret is configured. The smoke makes exactly one Seedream
5.0 Lite 2K PNG request with outputCount = 1. On a provider failure it logs
only sanitized diagnostics (errorCode, retryability and submission stage);
provider response bodies, prompts, output URLs and credentials are not logged.
The staging environment is hosted at:
Initial deployment target:
- Small Linux VPS
- Nginx reverse proxy and TLS termination
- Next.js standalone web process managed by systemd
- Bundled background worker managed by systemd
- Redis bound to localhost
- MariaDB with persistent storage and encrypted backups
- Remote S3-compatible media storage
- Immutable release archives identified by commit SHA
Staging deploys from the protected main branch after CI passes. GitHub builds the release, transfers it over SSH, and atomically activates it on the server. Production deployment will use an approved GitHub release tag and a separate environment.
Use trunk-based development:
- Create a short-lived branch such as
feat/manual-payments. - Keep commits focused and use conventional commit messages.
- Open a pull request against
main. - Pass formatting, lint, type checking, unit, integration, and build checks.
- Squash merge after review.
- Delete the merged feature branch.
Financial-ledger, authentication, pricing, and provider-adapter changes require tests and review.
- Repository and local-environment bootstrap
- Authentication, organizations, and RBAC
- Wallet ledger and manual OMR payments
- Model catalogue, quotes, and pricing versions
- BytePlus image generation
- BytePlus video generation
- BytePlus voice generation
- NVIDIA Creative Copilot
- Admin operations and finance console
- Private staging beta
- Keep all provider calls and credentials server-side.
- Use pre-signed uploads and downloads for private media.
- Validate MIME type, extension, file signature, and size.
- Rate-limit authentication, quotes, uploads, and generation requests.
- Redact credentials, payment references, prompts, and personal data from logs.
- Require explicit consent workflows before adding face or voice replication.
- Back up MariaDB and test restoration regularly.
- Report security-sensitive findings privately to the repository owner.
This repository currently includes the GNU General Public License v3.0. See LICENSE.
Before distributing the platform or sharing source with customers, the company should confirm that GPL-3.0 matches the intended commercial and source-distribution model.
The Asset Library is an organization-scoped DAM surface built on the canonical
Asset domain. It supports secure direct uploads, generated media, private
thumbnail/preview/poster variants, grid/list browsing, search/filtering,
folders, normalized tags, per-user favourites, 30-day trash/restore, project
assignment and bounded bulk operations.
Uploads validate file signatures rather than browser MIME declarations, reserve
storage before persistence, use opaque tenant-scoped object keys and finalize
quota accounting transactionally. The background asset-ingestion queue
creates bounded derivatives and permanently purges expired trash only after
private objects have been removed.
See docs/architecture/assets.md for lifecycle, security, quota and integration rules.
Studio supports queued BytePlus image generation with wallet reservation, persistent PNG assets and authenticated downloads. See the image-generation runbook for deployment, recovery behavior and the live acceptance check.
Private image editing and approved-host link imports are described in docs/image-editing.md.
Templates are curated, platform-managed creative recipes for image, video and voice work. They resolve structured customer inputs against the live model catalog and then hand off into the ordinary Studio generation pipeline; opening a template never creates a provider request or charge. Template provenance is stored on GenerationJob for recent-use and product analytics.
See docs/generation-templates.md for security, administration, deployment and resolver behavior.
Authentication, billing, membership, generation and report notifications use a durable MariaDB outbox with BullMQ delivery and pooled TLS SMTP. See the transactional-email operations runbook for production configuration, sender identities, retry behavior and diagnostics.
Provider cost configuration, quote contracts, denomination and launch migration: provider pricing.
Media worker limits, incident pause/resume and audited preview recovery: media containment runbook.
Media ownership and retries: Phase B runbook.
Worker role separation and host sizing: Phase C runbook.
Preview states, audited retries and operator diagnostics: Phase D runbook.