Docs
← Back to app

Bani Studio Documentation

Everything you need to set up, configure, and integrate Bani Studio — your AI-powered app builder.

Platform URL: elbani.studio  ·  Source: /home/Hajeri/studio/bani-studio  ·  SSH: Hajeri@40.120.92.59

How it works

Users describe what they want to build in plain text (Arabic or English). The AI generates a full-stack web app — HTML, CSS, JavaScript, and optionally a Node.js backend — deploys it on a subdomain, and gives the user a live URL within minutes.

Each build costs 2 credits. Running a live app costs 1 credit per day. Credits can be purchased as one-time packs or included in monthly subscriptions.

Credits & Billing

ActionCost
AI build2 credits
Live app per day1 credit
PostgreSQL provision10 credits

Credit packs (one-time)

PackCreditsBuildsPrice
Starter6030$5
Builder250125$20
Pro700350$50

Monthly subscriptions

PlanCredits/monthBuilds/monthPrice
Starter10050$15/mo
Builder300150$39/mo
Studio700350$99/mo

Your Apps

Every app gets a free subdomain: yourapp.elbani.studio. Custom domains require connecting via workspace settings.

You own everything. Download a ZIP export any time — it includes all source code, a Dockerfile, and a README. Deploy it anywhere: Docker, Vercel, Railway, your own server.

SendGrid (email)

Bani Studio sends transactional emails: account verification, password reset, welcome, build-done notifications, low-credit warnings.

Required for email delivery. Without this, emails log to console only — users cannot verify accounts.
1

Create a SendGrid account

Go to sendgrid.com → free plan includes 100 emails/day.

2

Verify your sender domain

Settings → Sender Authentication → Authenticate a domain → enter elbani.studio → add the DNS records they give you.

3

Create an API key

Settings → API Keys → Create API Key → give it "Mail Send" permission → copy the key (starts with SG.).

4

Set environment variables

SENDGRID_API_KEY=SG.xxxxxxxxxxxxxxxxxxxxxxxx
SMTP_FROM=noreply@elbani.studio
EMAIL_FROM_NAME=Bani Studio

Or use generic SMTP credentials from SendGrid (Settings → API Keys → SMTP relay):

SMTP_HOST=smtp.sendgrid.net
SMTP_PORT=587
SMTP_USER=apikey
SMTP_PASS=SG.xxxxxxxxxxxxxxxxxxxxxxxx
SMTP_FROM=noreply@elbani.studio

Stripe (billing)

Handles credit pack purchases and monthly subscription payments.

1

Get your Stripe keys

Dashboard → Developers → API keys → copy Secret key and Publishable key.

2

Create products in Stripe

Create one product per credit pack and one per subscription plan. The Price IDs are stored in server.js — update CREDIT_PACKS and SUBSCRIPTION_PLANS with your real Stripe Price IDs.

3

Set up webhook

Stripe Dashboard → Webhooks → Add endpoint → URL: https://elbani.studio/api/credits/webhook → Events: checkout.session.completed, customer.subscription.created, customer.subscription.updated, customer.subscription.deleted.

4

Set environment variables

STRIPE_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxx
STRIPE_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxx

MongoDB (database)

By default, Bani Studio stores all data in JSON files on disk (/app/data/). When MONGODB_URL is set, it automatically switches to MongoDB and migrates existing data.

Recommended for production. JSON files are fine for low traffic but MongoDB gives you durability, indexing, and easy backups.
1

Create a MongoDB Atlas cluster

Go to cloud.mongodb.com → Create a free cluster → choose Azure or the nearest region.

2

Create a database user

Security → Database Access → Add new user → username bani → auto-generate password → copy it.

3

Whitelist IP / allow all

Security → Network Access → Add IP Address → 0.0.0.0/0 (allow from anywhere, needed for Azure Container App).

4

Get connection string

Connect → Drivers → copy the connection string. Replace <password> with your actual password.

MONGODB_URL=mongodb+srv://bani:yourpassword@cluster0.xxxxx.mongodb.net/bani
MONGODB_DB=bani
Migration: On first run with MONGODB_URL set, existing JSON data is automatically migrated to MongoDB. No manual steps needed.

GitHub (auto-push)

Users can connect a GitHub repo to any app. After each successful build, code is automatically pushed to the linked repo.

1

Create a GitHub OAuth App

GitHub → Settings → Developer settings → OAuth Apps → New OAuth App

  • Homepage URL: https://elbani.studio
  • Authorization callback URL: https://elbani.studio/api/auth/github/callback
2

Set environment variables

GITHUB_CLIENT_ID=Ov23lixxxxxxxxxxxxxxxx
GITHUB_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Azure Blob Storage (backup)

When configured, Bani Studio automatically backs up all data files to Azure Blob Storage daily at 3am UTC.

1

Create a Storage Account

Azure Portal → Storage accounts → Create → choose the same region as your Container App.

2

Get connection string

Your storage account → Security + networking → Access keys → copy Connection string.

3

Set environment variables

AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=...
AZURE_BACKUP_CONTAINER=bani-backups

All Environment Variables

Set these in your Azure Container App → Settings → Environment variables (or in a .env file for local development).

Core

VariableDescriptionDefault
JWT_SECRET Secret key for signing auth tokens. Change this in production. bani-secret-change-me REQUIRED
PORT HTTP port the server listens on 3000 optional
DOMAIN Root domain for subdomains elbani.studio optional
BASE_URL Full URL of the platform (used in emails) https://elbani.studio optional
OWNER_EMAIL Admin account email — auto-created on startup malhajeri@cultureyes.ae optional
NODE_ENV Set to production to hide internal error details recommended
ANTHROPIC_API_KEY Claude AI key for building apps REQUIRED
PROJECTS_DIR Where deployed app files are stored /app/projects optional
DATA_DIR Where JSON data files are stored /app/data optional

Email (SendGrid / SMTP)

VariableDescriptionDefault
SENDGRID_API_KEYSendGrid API key (starts with SG.) — alternative to SMTP_* varsrecommended
SMTP_HOSTSMTP server hostname (e.g. smtp.sendgrid.net)recommended
SMTP_PORTSMTP port587optional
SMTP_USERSMTP username (for SendGrid: apikey)optional
SMTP_PASSSMTP password (for SendGrid: your API key)optional
SMTP_FROMFrom address for outgoing emailsnoreply@elbani.studiooptional
EMAIL_FROM_NAMESender name in emailsBani Studiooptional

Stripe

VariableDescriptionDefault
STRIPE_SECRET_KEYStripe secret key (sk_live_... or sk_test_...)recommended
STRIPE_WEBHOOK_SECRETStripe webhook signing secret (whsec_...)recommended

MongoDB

VariableDescriptionDefault
MONGODB_URLMongoDB connection string (mongodb+srv://...)— (uses JSON files)recommended
MONGODB_DBMongoDB database namebanioptional

GitHub

VariableDescriptionDefault
GITHUB_CLIENT_IDGitHub OAuth App client IDoptional
GITHUB_CLIENT_SECRETGitHub OAuth App client secretoptional

Azure Backup

VariableDescriptionDefault
AZURE_STORAGE_CONNECTION_STRINGAzure Blob Storage connection string for backupsoptional
AZURE_BACKUP_CONTAINERContainer name for backup filesbani-backupsoptional

PostgreSQL (per-app databases)

VariableDescriptionDefault
PG_HOSTPostgreSQL host for provisioning user databasesoptional
PG_PORTPostgreSQL port5432optional
PG_USERPostgreSQL admin usernameoptional
PG_PASSWORDPostgreSQL admin passwordoptional
PG_ADMIN_DBPostgreSQL admin database namepostgresoptional

App Secrets

Each user app can store secrets (environment variables) that are injected into the running process but never exposed to the AI or in exports.

Add secrets in the workspace → Settings tab → Environment Variables section. They're stored encrypted in the app record and passed as process.env.VARIABLE_NAME to your app at runtime.

Custom Domains

Every app gets appname.elbani.studio automatically (wildcard SSL certificate covers all subdomains).

To add a custom domain: workspace → Settings → Custom Domain → enter your domain → add a CNAME record pointing to elbani.studio with your DNS provider.

API — Authentication

All protected endpoints require a Bearer token in the Authorization header:

Authorization: Bearer <your-jwt-token>

Get a token by calling POST /api/auth/login.

POST/api/auth/register
Register a new user. Body: { email, password, name? }
POST/api/auth/login
Login. Body: { email, password }. Returns { token, user }.
GET/api/auth/verify/:token
Verify email address using token from email link.
POST/api/auth/forgot-password
Send password reset email. Body: { email }. Rate limited.

API — Apps

GET/api/apps
🔒 Auth required
List your apps.
POST/api/apps
🔒 Auth required
Create a new app. Body: { name, framework?, prompt? }.
PUT/api/apps/:id
🔒 Auth required
Update app settings. Accepts: name, description, isPublic, icon, seoTitle, seoDescription, ogImage, seoLang, domain, secrets, protection.
GET/api/apps/:id/export
🔒 Auth required
Download app as ZIP with source code, Dockerfile, and README.
POST/api/apps/:id/inject-meta
🔒 Auth required
Re-inject SEO/OG meta tags into deployed app's HTML.
POST/api/apps/:id/fork
🔒 Auth required
Duplicate an app (creates a copy with all files).

API — Credits

GET/api/credits/balance
🔒 Auth required
Get current credit balance, plan, and subscription info.
GET/api/credits/packs
List available credit packs and subscription plans (public).
POST/api/credits/checkout
🔒 Auth required
Create a Stripe checkout session for a credit pack. Body: { packId }.
POST/api/credits/subscribe
🔒 Auth required
Create a Stripe subscription. Body: { planId }.
POST/api/billing/portal
🔒 Auth required
Get a Stripe billing portal URL to manage subscription.

API — Admin

All admin endpoints require an admin account.

GET/api/admin/stats
🔒 Admin required
Platform statistics: total users, apps, revenue, builds.
GET/api/admin/users
🔒 Admin required
List all users with credits and app counts.
POST/api/admin/users/:id/credits
🔒 Admin required
Grant or deduct credits from a user. Body: { amount, reason }.
GET/api/health
Platform health check — uptime, database mode, active apps, memory usage (public).