@nayannath/brand-builder
v1.0.3
Published
Generate consistent product campaign visuals across billboards, newspapers, and social posts with Nano-Banana image generation.
Maintainers
Readme
Brand Builder
Brand Builder turns a single product description into a consistent campaign set across multiple marketing mediums: billboard, newspaper advertisement, and social post.
The app first expands the product brief into a reusable visual identity, then uses Google's Nano-Banana image model (gemini-2.5-flash-image) to render each medium while preserving the same product form, materials, colors, logo placement, and brand motifs. Gemini API calls run on the Express server so API keys are never exposed in the browser bundle.
Key Highlights
- Single product brief: Describe the product once, including name, packaging, colors, materials, and positioning.
- Shared visual identity: The server generates a consistency protocol that is reused for every image request.
- Three campaign outputs: Billboard, newspaper advertisement, and square social post.
- Nano-Banana rendering: Image generation uses
gemini-2.5-flash-imagethrough the server-side Gemini API. - Server-side secrets:
GEMINI_API_KEYstays on the backend and is not shipped to the client. - npm-ready CLI: The
brand-buildercommand runs the compiled full-stack app from an installed package.
Installation
Brand Builder is distributed through npm and GitHub Packages:
npmjs.com: @nayannath/brand-builder
GitHub Packages: @nayan07cse/brand-builderInstall globally from npm:
npm install -g @nayannath/brand-builderSet your Gemini API key and launch the app:
export GEMINI_API_KEY="your-gemini-api-key"
brand-builderThis runs the compiled full-stack server serving the app on http://localhost:3000.
GitHub Packages users can install the GitHub-scoped package after authenticating npm for GitHub's registry:
npm login --scope=@nayan07cse --auth-type=legacy --registry=https://npm.pkg.github.com
npm install -g @nayan07cse/brand-builder --registry=https://npm.pkg.github.comLocal Development
Use these scripts when running the project from source.
Prerequisites
Define your Gemini API credentials in a .env file at the root:
# .env file
GEMINI_API_KEY="your_api_key_here"Install Dependencies
npm installRun Active Developer Environment
npm run devThis boots the Express server, mounts Vite development middleware, and starts the app on port 3000.
Build for Production
Compile the Vite client and bundle the Express server:
npm run buildThis command executes a two-stage build:
- Compiles the Vite SPA index, assets, and styling libraries into
/dist. - Bundles
/server.tsinto/dist/server.cjsusingesbuild.
Run Built Package
Once built, execute the compiled production package directly:
npm run startThe server reads PORT and HOST if your deployment platform provides them. By default it listens on 0.0.0.0:3000.
Distribution
Release builds are published to both npmjs.com and GitHub Packages. Package versions are immutable in each registry, so a new release requires a version bump:
npm version patch
git push --follow-tagsAutomation is handled by GitHub Actions:
.github/workflows/ci.yml: validates pushes and pull requests..github/workflows/npm-publish.yml: publishes@nayannath/brand-builderto npmjs.com..github/workflows/github-packages.yml: publishes@nayan07cse/brand-builderto GitHub Packages.
Architecture
- Server (
server.ts): Express API that expands product briefs, calls Gemini image generation, and returns base64 image data to the UI. - Client (
src/App.tsx): React interface for entering the product brief, showing the shared brand system, and displaying each generated medium. - Build (
npm run build): Vite compiles the SPA and esbuild bundles the server intodist/server.cjs. - Package (
bin/cli.js): Starts the compiled server when installed as an npm binary.
Metadata
package.jsondesignates executable commands inside"bin"points.metadata.jsonlists"MAJOR_CAPABILITY_SERVER_SIDE_GEMINI_API"for cloud run environments, declaring proxying compliance.
© 2026 Brand Builder. Distributed under standard release conventions.
