Skip to content

sumitk9801/PromptOps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PromptOps

PromptOps is a prompt management platform for teams building AI apps.
It helps you version prompts, run A/B tests, track quality and cost, and roll back safely.

What You Can Do

  • Manage prompt versions with history and rollback.
  • Run A/B tests on prompt variants.
  • Track quality, usage, and cost in analytics dashboards.
  • Use API keys and SDK endpoints for production integrations.
  • Monitor live updates through WebSocket events.

Repository Layout

PromptOps/
  backend/         Express API, Prisma, workers, tests
  frontend/        Next.js app (landing + dashboard UI)
  sdk-chaos-lab/   SDK wrapper example for testing integrations

Quick Start (Local)

1) Prerequisites

  • Node.js 20+
  • npm
  • PostgreSQL + Redis (or Docker Desktop)

2) Start Infrastructure (recommended)

cd backend
docker compose up -d

3) Configure and Start Backend

cd backend
npm install

Copy backend/.env.example to backend/.env, then set at least:

DATABASE_URL=postgresql://promptops:promptops_secret@localhost:5433/promptops_dev?schema=public
REDIS_URL=redis://:redis_secret@localhost:6380
JWT_SECRET=replace_with_long_random_value
JWT_REFRESH_SECRET=replace_with_different_long_random_value
ENCRYPTION_KEY=replace_with_64_hex_chars
FRONTEND_URL=http://localhost:4000
ALLOWED_ORIGINS=http://localhost:4000
PORT=3000

Run migrations and start the API:

npm run prisma:migrate
npm run dev

API health check: http://localhost:3000/health

4) Configure and Start Frontend

cd frontend
npm install

Create frontend/.env.local:

NEXT_PUBLIC_API_URL=http://localhost:3000
NEXT_PUBLIC_WS_URL=ws://localhost:3000

Start frontend on port 4000:

npm run dev -- -p 4000

Open: http://localhost:4000

Useful Commands

Backend (backend/)

  • npm run dev - start API in watch mode
  • npm run test - run all tests
  • npm run test:unit - run unit tests
  • npm run test:integration - run integration tests
  • npm run prisma:migrate - run DB migrations

Frontend (frontend/)

  • npm run dev - start Next.js dev server
  • npm run build - production build
  • npm run start - run production build
  • npm run lint - lint code

SDK Example (Optional)

The file sdk-chaos-lab/promptops-sdk-wrapper-example.js shows a wrapper flow:

  1. Resolve active prompt from PromptOps
  2. Call model provider
  3. Send call metadata back to PromptOps

Use this to validate your integration pattern before production rollout.

Security Notes

  • Never commit .env, .env.local, or API keys.
  • Keep real secrets only in local env files or secret managers.
  • If a key is exposed, rotate it immediately.
  • Do not paste credentials in issues, PR descriptions, or logs.

Troubleshooting

  • Backend exits on startup: check required env vars (DATABASE_URL, REDIS_URL, JWT_SECRET, JWT_REFRESH_SECRET, ENCRYPTION_KEY).
  • Frontend cannot call API: confirm NEXT_PUBLIC_API_URL and backend port.
  • CORS errors: confirm FRONTEND_URL and ALLOWED_ORIGINS in backend .env.
  • WebSocket not connecting: confirm NEXT_PUBLIC_WS_URL=ws://localhost:3000.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors