Personal project

PromptVault

A library for AI prompts that treats them like code. You build a prompt from reusable pieces such as a persona, a tone, a format and constraints, keep versions, and fork public prompts from other people. Built on Next.js 16, Prisma and PostgreSQL.

Next.jsReactTypeScriptPrismaPostgreSQLNextAuthTailwind
The PromptVault home page: build prompts like code, with persona, tone, context, format and constraint pieces

The problem

Good prompts get rewritten from scratch because the parts that make them work, the persona, the audience, the format, the limits, are buried in one block of text. PromptVault stores those parts as pieces, so a prompt can be assembled, versioned, rated, shared and forked, and aimed at a specific model such as ChatGPT, Claude, Gemini or Midjourney.

My role

I designed and built it on my own, from the database schema and authentication to the compose workflow and the landing page.

Key decisions

  1. Prompts assembled from typed pieces

    Personas, formats, constraints, context and tones are stored as their own records with use counts, and the compose page assembles a prompt from them. A change to a piece is made once and reused everywhere.

  2. Reads and writes kept apart

    Cached Prisma reads live in one folder and mutations in another. Every write is a server action typed with Zod through next-safe-action, and it revalidates the cache tags of the data it changed, so pages stay fast without showing stale content.

  3. Sharing with forks and visibility

    Each prompt is public, private or unlisted. Forking a public prompt keeps a link to its parent and updates the parent’s fork count, and ratings and use counts are stored on the prompt so the explore page can sort without extra queries.

  4. Sign-in and a safe baseline

    NextAuth handles email and password with bcrypt, plus GitHub and Google sign-in, through the Prisma adapter. Security headers come from Nosecone, and environment variables are validated with Zod when the app starts.