Skip to content

BiosBrick/SalvaPrompt

Repository files navigation

SalvaPrompt

Your prompts. Your repo. Your rules.

The open-source prompt vault that stores everything in a Git repository you own.
Sign in with GitHub or Bitbucket. Save your AI prompts as versioned files.
No database. No subscriptions. No vendor lock-in.


Next.js NextAuth TypeScript Tailwind CSS License: MIT Website

🌐 www.salvaprompt.org


What is SalvaPrompt?

SalvaPrompt is a self-hostable web app that turns any GitHub or Bitbucket repository into a personal prompt library.

You don't sign up for yet another SaaS platform. You don't trust a stranger's database with your carefully crafted prompts.

You just sign in with the Git account you already have, and SalvaPrompt stores your prompts as versioned .prt files — directly in a repo you control.

Write a prompt
       ↓
SalvaPrompt saves it as a .prt file in your Git repo
       ↓
Full version history. Public or private. Yours forever.
       ↓
Access it from anywhere. Share it with anyone (or no one).

Every prompt is a first-class citizen: it has a title, a body, tags, a creation date, and a full Git history. You can make the vault public to share your prompt library with the world, or keep it private.


Why SalvaPrompt is different

Most prompt managers store your data in their own database on their own servers. SalvaPrompt stores nothing — your Git repo is the database.

Capability SalvaPrompt Typical prompt managers
You own 100% of the data
Full version history (Git)
Works with your existing GitHub/Bitbucket account
Public or private vault — your choice
No subscription, no usage limits
Self-hostable on any Node.js server
Open source
Zero vendor lock-in

How it works

SalvaPrompt uses the GitHub and Bitbucket APIs to read and write files directly to your repository. Each prompt is stored as a .prt file (a plain JSON document) inside a prompts/ folder in your chosen repo.

{
  "title": "Senior code reviewer",
  "body": "Review the following code as a senior engineer would...",
  "tags": ["code", "review", "engineering"],
  "createdAt": "2025-04-20T10:30:00Z"
}

No proprietary format. No lock-in. If you ever stop using SalvaPrompt, your prompts are still there — readable JSON files in a Git repo.


Getting Started

1. Clone the repo

git clone https://gitlab.com/your-username/salvaprompt.git
cd salvaprompt

2. Install dependencies

npm install

3. Configure environment variables

cp .env.local.example .env.local

Open .env.local and fill in your values. See Environment Variables for the full reference.

4. Run the development server

npm run dev

Open http://localhost:3000 — sign in and start saving prompts.


Environment Variables

Variable Required Description
NEXTAUTH_SECRET Random secret for signing sessions — generate with openssl rand -base64 32
NEXTAUTH_URL Public base URL of the app (e.g. https://yourdomain.com)
GITHUB_ID GitHub OAuth App Client ID
GITHUB_SECRET GitHub OAuth App Client Secret
BITBUCKET_ID ⚠️ Bitbucket OAuth Consumer Key (required if Bitbucket login is enabled)
BITBUCKET_SECRET ⚠️ Bitbucket OAuth Consumer Secret
ENABLE_BITBUCKET Set to false to hide the Bitbucket login option. Defaults to true
MAINTENANCE_MODE Set to true to redirect all traffic to /maintenance
MAINTENANCE_UNTIL ISO 8601 date shown on the maintenance page (e.g. 2025-12-31T23:59:00Z)
PORT HTTP port for the standalone server. Defaults to 3000

Setting up OAuth Apps

GitHub

  1. Go to GitHub Developer SettingsOAuth AppsNew OAuth App
  2. Set Authorization callback URL to https://yourdomain.com/api/auth/callback/github
  3. Copy the Client ID and Secret into your .env.local

Bitbucket

  1. Go to Bitbucket Workspace SettingsOAuth consumersAdd consumer
  2. Grant Account: Read and Repositories: Read & Write permissions
  3. Set Callback URL to https://yourdomain.com/api/auth/callback/bitbucket
  4. Copy the Key and Secret into your .env.local

Deployment

Vercel

npm i -g vercel
vercel

Set all environment variables under Project → Settings → Environment Variables in the Vercel dashboard.

Standalone Node.js server (Hostinger, VPS, etc.)

npm run build
npm start          # starts server.js on $PORT (default 3000)

The build uses output: "standalone" — the .next/standalone folder is fully self-contained and ready to ship.


Project Structure

├── app/
│   ├── api/           # Backend endpoints (auth, prompts, repo)
│   ├── dashboard/     # Prompt library view
│   ├── prompts/       # Create & view individual prompts
│   ├── onboarding/    # First-time setup flow
│   └── maintenance/   # Maintenance page
├── components/        # Shared React components
├── lib/               # Auth config, Bitbucket client, utilities
├── types/             # TypeScript type definitions
└── middleware.ts      # Maintenance-mode redirect logic

Roadmap

  • Full-text search across all saved prompts
  • Tags & filtering — filter the dashboard by tag
  • Prompt export — download your library as a ZIP or Markdown collection
  • GitLab support — third OAuth provider alongside GitHub and Bitbucket
  • Prompt templates — start from a curated set of community prompts
  • Dark mode

Contributing

Pull requests are welcome. For major changes please open an issue first to discuss what you'd like to change.

  1. Fork the project
  2. Create your feature branch: git checkout -b feat/my-feature
  3. Commit your changes: git commit -m 'feat: add my feature'
  4. Push to the branch: git push origin feat/my-feature
  5. Open a Pull Request

License

MIT — use it, fork it, ship it, build on it.


SalvaPromptEvery prompt you ever wrote. Safe, versioned, yours.

About

SalvaPrompt is an open-source, self-hostable web app that turns any GitHub or Bitbucket repository into a personal AI prompt library. Built with Next.js 14 and TypeScript, it lets users sign in with their existing Git account and save prompts as versioned .prt files directly in a repo they own — no database, no subscriptions, no vendor lock-in

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors