Skip to content

A professional Next.js webapp for managing AI prompts with intelligent AI enhancement, memory pattern integration, and developer-focused

Notifications You must be signed in to change notification settings

aeitroc/prompt-manager

Repository files navigation

Prompt Manager πŸ€–

πŸ€– AI-Powered Prompt Manager with VSCode Dark Theme

A professional Next.js webapp for managing AI prompts with intelligent AI enhancement, memory pattern integration, and developer-focused VSCode dark theme.

πŸš€ Features

πŸ€– AI Enhancement

  • Multi-Model Support - Configure your AI models
  • Memory Pattern Integration - Learn from your experience
  • Before/After Comparison - See exactly what AI changed
  • Smart Context - Uses relevant patterns as enhancement context
  • Professional Results - Better prompts, clearer instructions

πŸ“‹ Prompt Management

  • Full CRUD Operations - Create, read, update, delete prompts
  • Search & Filter - Real-time search by title and content
  • Category System - 6 default + unlimited custom categories
  • Tag System - Auto-create tags with full management
  • Color Coding - 30-color palette for visual organization
  • Copy to Clipboard - Quick copy with toast notifications
  • List/Card Views - Toggle between layouts with persistence

🎨 Professional Interface

  • VSCode Dark Theme - Developer-friendly interface throughout
  • Responsive Design - Works on all screen sizes
  • Loading States - Visual feedback for all operations
  • Toast Notifications - Success/error feedback
  • Keyboard Shortcuts - Power user features
  • Hover States - Professional interactions
  • Empty States - Helpful guidance

πŸ› οΈ Tech Stack

  • Framework: Next.js 15.5.6 (App Router)
  • Language: TypeScript
  • Database: SQLite + Prisma ORM
  • Styling: Tailwind CSS
  • State: Zustand
  • Forms: React Hook Form + Zod validation
  • Icons: Lucide React
  • Notifications: React Hot Toast
  • AI Integration: OpenAI SDK (multiple providers)
  • Memory Patterns: JSON-based knowledge base

πŸš€ Development

Prerequisites

  • Node.js 18+ (you have v3.14.0)
  • AI Configuration: Create your AI models config file at ~/.factory/config.json
  • Memory Patterns: Optional - Create memory directory for pattern learning

Quick Start

cd prompt-manager

# Install dependencies
npm install

# Setup database
npx prisma db push
npx prisma db seed

# Start development
npm run dev  # http://localhost:4443

πŸ“ Project Structure

prompt-manager/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/          # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ page.tsx     # Main interface
β”‚   β”‚   β”œβ”€β”€ layout.tsx     # Root layout
β”‚   β”‚   β”œβ”€β”€ globals.css    # VSCode theme
β”‚   β”‚   └── api/          # API routes
β”‚   β”‚       β”œβ”€β”€ prompts/
β”‚   β”‚       β”‚   β”œβ”€β”€ route.ts       # GET, POST
β”‚   β”‚       β”‚   β”œβ”€β”€ enhance/
β”‚   β”‚       β”‚   β”‚   route.ts   # POST
β”‚   β”‚       β”‚   └── [id]/
β”‚   β”‚       β”‚       β”‚   └── route.ts   # GET, PUT, DELETE
β”‚   β”‚   β”œβ”€β”€ categories/
β”‚   β”‚   β”‚   β”œβ”€β”€ route.ts       # GET, POST
β”‚   β”‚   β”‚   └── [id]/
β”‚   β”‚   β”‚       β”‚   └── route.ts   # PUT, DELETE
β”‚   β”‚   β”œβ”€β”€ tags/
β”‚   β”‚   β”‚   β”œβ”€β”€ route.ts       # GET, POST
β”‚   β”‚   β”‚   └── [id]/
β”‚   β”‚   β”‚       β”‚   └── route.ts   # GET, PUT, DELETE
β”‚   β”œβ”€β”€ components/                  # React components
β”‚   β”‚   β”œβ”€β”€ ui/              # shadcn/ui components (12 files)
β”‚   β”‚   β”œβ”€β”€ prompts/           # Prompt-related components (9 files)
β”‚   β”‚   β”‚   β”œβ”€β”€ layout/              # Layout components (2 files)
β”‚   β”‚   β”œβ”€β”€ ai/               # AI-related components (2 files)
β”‚   β”‚   β”‚   └── categories/        # Category management (2 files)
β”‚   β”‚   β”‚   └── tags/            # Tag management (2 files)
β”‚   β”œβ”€β”€ lib/                    # Utilities and libraries
β”‚   β”‚   β”œβ”€β”€ db.ts              # Prisma client
β”‚   β”‚   β”œβ”€β”€ utils.ts           # Utility functions
β”‚   β”‚   β”œβ”€β”€ colors.ts          # VSCode color palette
β”‚   β”‚   β”œβ”€β”€ validations/       # Zod schemas (3 files)
β”‚   β”‚   β”œβ”€β”€ ai/               # AI integration (4 files)
β”‚   β”‚   β”‚   β”œβ”€β”€ config-loader.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ client.ts
β”‚   β”‚   β”‚   └── enhance-prompt.ts
β”‚   β”‚   β”œβ”€β”€ memory/           # Memory system (4 files)
β”‚   β”‚   β”‚   β”œβ”€β”€ loader.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ matcher.ts
β”‚   β”‚   β”‚   └── types.ts
β”‚   β”‚   └── hooks/            # Custom hooks (4 files)
β”‚   β”‚   β”œβ”€β”€ store/            # State management (1 file)
β”‚   β”‚   └── types/            # TypeScript types (4 files)
β”‚   └── prisma/           # Database files (2 files)
β”‚   β”‚   └── schema.prisma
β”‚   β”‚   └── seed.ts
β”‚   β”œβ”€β”€ docs/                 # Documentation (4 files)
β”‚   β”‚   └── frontend/26-10-2025/
β”‚   β”‚       └── prompt-manager-nextjs/
β”‚   β”‚           └── plan-updated.md
β”‚   β”‚           └── research.md
β”‚   β”‚           └── implementation-status.md
β”‚   β”‚           └── current-status.md
β”‚   β”‚           └── final-status.md
β”‚   β”‚       └── additional-features.md
β”‚   └── public/             # Static assets
β”‚   β”œβ”€β”€ tests/                 # Test files (empty)
β”‚   β”œβ”€β”€ package.json          # Package configuration
β”‚   β”œβ”€β”€ tsconfig.json          # TypeScript config
β”‚   β”œβ”€β”€ next.config.js         # Next.js config
β”‚   β”œβ”€β”€ postcss.config.mjs     # PostCSS config
β”‚   └── .env                 # Environment variables
└── prisma/                   # Database files (2 files)
β”‚   └── schema.prisma
β”‚   └── seed.ts
β”œβ”€β”€ docs/                         # Documentation (4 files)
β”‚   β”œβ”€β”€ frontend/26-10-2025/
β”‚   └── prompt-manager-nextjs/
β”‚   β”‚       └── plan-updated.md
β”‚   β”‚       └── research.md
β”‚   β”‚       └── implementation-status.md
β”‚   β”‚       └── current-status.md
β”‚   β”‚       └── additional-features.md
β”‚   β”‚       └── final-status.md
└── public/                     # Static assets
└── tests/                     # Test files (empty directory)
β”œβ”€β”€ package.json                     # Package configuration
β”œβ”€β”€ tsconfig.json                 # TypeScript config
└── next.config.js                # Next.js config
└── postcss.config.mjs              # PostCSS config
└── .env                         # Environment variables
└── prisma/                   # Database files (2 files)
β”‚   └── schema.prisma
β”‚   └── seed.ts
└── README.md                    # This file

🎯 Installation

System Requirements**

  • Node.js 18+ (tested with v3.14.0)
  • npm (tested with v10.2.4)
  • VSCode (optional, for theme reference)

One-Line Setup**

git clone https://github.com/yourusername/prompt-manager.git
cd prompt-manager
npm install
npx prisma db push
npx prisma db seed
npm run dev

Detailed Installation

# Clone the repository
git clone https://github.com/yourusername/prompt-manager.git
cd prompt-manager

# Install dependencies
npm install

# Setup database
npx prisma generate
npx prisma db push

# Seed default data
npx prisma db seed

# Start development
npm run dev

🎯 Database Setup

The application uses SQLite by default for simplicity, but can easily be migrated to PostgreSQL for production:

# Update .env for PostgreSQL
DATABASE_URL="postgresql://user:password@localhost:5432/prompt_manager"

# Update schema
# prisma/schema.prisma

# Update package.json scripts
# npm run build && npm run start

Run migrations

npx prisma migrate deploy


## 🎯 **Environment Variables**

Create `.env.local` (not tracked):
```env
DATABASE_URL="file:./dev.db"
NODE_ENV="development"

Create .env.example:

DATABASE_URL="file:./dev.db"
NODE_ENV="development"

AI Model Configuration

Create ~/.factory/config.json with your AI models:

{
  "custom_models": [
    {
      "model_display_name": "Claude.Code",
      "model": "claude-sonnet-4-5-20250929",
      "base_url": "https://api.anthropic.com",
      "api_key": "your-api-key-here",
      "provider": "anthropic"
    },
    {
      "model_display_name": "GPT-4",
      "model": "gpt-4",
      "base_url": "https://api.openai.com/v1",
      "api_key": "your-openai-key-here",
      "provider": "openai"
    }
  ]
}

πŸš€ Build & Deployment

# Development
npm run dev    # http://localhost:4443

# Production
npm run build    # Optimized bundle
npm start        # Production server (http://localhost:4443)

# Build verification
npm run build
npm start

🎯 Usage

Creating Your First Prompt

  1. Open http://localhost:4443
  2. Click "New Prompt"
  3. Fill in:
    • Title: "React Hook Cleanup"
    • Content: "Use cleanup function with AbortController in useEffect"
    • Category: "Frontend"
    • Tags: ["react", "hooks", "cleanup"]
    • Choose a color
  4. Save

Enhancing with AI

  1. Click "Enhance with AI" in the form
  2. View matched memory patterns
  3. Select patterns to include
  4. Choose AI model
  5. Review before/after comparison
  6. Accept enhanced version

Managing Categories

  1. Go to "Categories" tab
  2. Click "Add Category"
  3. Add:
    • Name: "Database"
    • Color: "#4EC9B0" (teal)
    • Icon: "Database"
  4. Save

Managing Tags

  1. Go to "Tags" tab
  2. Click "Add Tag"
  3. Add: "database", "sql", "api"
  4. Tags are auto-created when used in prompts

πŸ”§ API Usage

Basic Prompt Operations

// List all prompts
const response = await fetch('/api/prompts')

// Create a prompt
const response = await fetch('/api/prompts', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    title: 'New Prompt',
    content: 'Write your prompt here...',
    categoryId: 'category-id',
    tags: ['tag1', 'tag2']
  })
})

// Enhance a prompt
const response = await fetch('/api/prompts/enhance', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    originalPrompt: 'Simple prompt',
    promptTitle: 'Testing',
    includeMemory: true,
    modelId: 0 // Use first model
  })
})

AI Models

// List available models
const response = await fetch('/api/ai/models')
const models = await response.json()

// Search memory patterns
const response = await fetch('/api/memory/search', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    promptTitle: 'React component',
    promptContent: 'Use hooks for state management'
  })
})

🎯 Keyboard Shortcuts

Shortcut Function
Cmd/Ctrl + N New Prompt
Cmd/Ctrl + K Focus Search
Cmd/Ctrl + V Toggle View
Escape Close Dialog

πŸ“šοΏ½ Memory Pattern Examples

The system finds patterns based on:

  • Technology Keywords: React, Node.js, TypeScript, Next.js
  • Content Analysis: React hooks, useEffect, state management
  • Best Practices: Clean architecture, error handling

πŸ“šοΏ½ Success Stories

  1. Faster Development - AI learns from your proven patterns
  2. Better Prompts - AI uses your experience as context
  3. Consistent Quality - AI maintains your coding standards
  4. Team Knowledge - Share patterns across team members

πŸŽ‰ Ready to Enhance Your Prompting! πŸš€

Your prompt manager is now a sophistic tool that:

  • Learns from your development experience
  • Enhances your prompts with relevant context
  • Adapts to your coding style
  • Improves with AI assistance

Start creating prompts and watch as the AI learns from your memory patterns to provide increasingly helpful enhancements! πŸš€βœ¨

About

A professional Next.js webapp for managing AI prompts with intelligent AI enhancement, memory pattern integration, and developer-focused

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •