Viraling
AI content script generator · SaaS
Generates ready-to-record scripts — reels, carousels, stories — by combining a library of proven viral formats with each creator’s brand voice.
Built solo, end to end.
How it works
Tenant isolation the database enforces
Row level security is enabled and forced on every table, and the app connects as a dedicated role without BYPASSRLS. One user physically cannot read another’s rows. Route handlers verify ownership again on top.
A credit ledger that cannot double-spend
The debit and the ledger row happen in one transaction, using a conditional update so two simultaneous requests can’t both succeed. If the model call then fails, the credit is refunded. The balance is never written anywhere else in the codebase.
Prompt injection handled structurally
The Anthropic key is server-only, enforced at build time. System prompts are fixed server-side and all user text is wrapped as delimited data with explicit instructions to treat it as content. Output is Zod-validated before it touches the database.
Rate limiting that degrades safely
Per user and per IP, falling back to an in-memory window if Redis is unreachable — because the hard spend ceiling is the ledger, not Redis.
Sessions you cannot forge from the table
Own auth: bcrypt for passwords, random 256-bit session tokens with only their SHA-256 stored. Reading the sessions table does not let you log in as anyone.
Built with
- Next.js 16
- React 19
- TypeScript
- Drizzle ORM
- Neon Postgres
- Claude API
- Zod
- Upstash Redis
- Cloudflare R2
- Netlify
Links for Viraling
One-click “Explore the demo” — no signup, no credentials.