Skip to content

wuyongjun1972/prompt-refinement-app

Repository files navigation

Prompt Refinement Web Application - All Variations

This project contains 4 complete implementations of a self-hosted prompt refinement web application, each using different technology stacks.

📁 Project Structure

prompt-refinement-app/
├── README.md (this file)
├── ARCHITECTURE.md (detailed architecture explanation)
├── COMPARISON.md (comparison of all variations)
│
├── variation-1-fastapi-bedrock/
│   ├── README.md
│   ├── SETUP.md
│   ├── ARCHITECTURE.md
│   ├── backend/
│   ├── frontend/
│   ├── docker-compose.yml
│   └── .env.example
│
├── variation-2-flask-openai/
│   ├── README.md
│   ├── SETUP.md
│   ├── ARCHITECTURE.md
│   ├── backend/
│   ├── frontend/
│   ├── docker-compose.yml
│   └── .env.example
│
├── variation-3-nodejs-anthropic/
│   ├── README.md
│   ├── SETUP.md
│   ├── ARCHITECTURE.md
│   ├── backend/
│   ├── frontend/
│   ├── docker-compose.yml
│   └── .env.example
│
└── variation-4-fastapi-ollama/
    ├── README.md
    ├── SETUP.md
    ├── ARCHITECTURE.md
    ├── backend/
    ├── frontend/
    ├── docker-compose.yml
    └── .env.example

🎯 Features (All Variations)

  • Prompt Analysis: Analyze your prompt and get detailed feedback
  • Refinement Suggestions: Get specific, actionable improvements
  • Before/After Comparison: See original vs refined prompts side-by-side
  • Test Mode: Test prompts with sample inputs
  • Version History: Track all refinement iterations
  • Export/Import: Save and load prompt templates
  • Real-time Preview: See changes as you type

🔧 Variations Overview

Variation 1: FastAPI + AWS Bedrock (Recommended for AWS Users)

  • Best for: Production AWS environments
  • Pros: Serverless-ready, multiple models, AWS integration
  • Cons: Requires AWS account and credentials
  • Cost: Pay per use (AWS Bedrock pricing)

Variation 2: Flask + OpenAI API

  • Best for: Rapid prototyping, familiar stack
  • Pros: Simple, well-documented, GPT-4 access
  • Cons: Requires OpenAI API key
  • Cost: Pay per use (OpenAI pricing)

Variation 3: Node.js + Anthropic API

  • Best for: JavaScript developers, Claude access
  • Pros: Full JavaScript stack, Claude 3 models
  • Cons: Requires Anthropic API key
  • Cost: Pay per use (Anthropic pricing)

Variation 4: FastAPI + Ollama (Recommended for Local/Free)

  • Best for: Privacy, no API costs, offline use
  • Pros: Completely free, runs locally, no API keys
  • Cons: Requires local GPU/CPU resources
  • Cost: Free (hardware only)

🚀 Quick Start

Choose your variation and follow its specific README:

# Example: Variation 1 (FastAPI + Bedrock)
cd variation-1-fastapi-bedrock
cat README.md
cat SETUP.md

📚 Documentation Files

Each variation includes:

  • README.md: Overview and features
  • SETUP.md: Step-by-step setup instructions
  • ARCHITECTURE.md: Technical architecture details
  • Code comments: Inline explanations throughout

🧪 Testing

Each variation includes:

  • Unit tests for backend logic
  • Integration tests for API endpoints
  • Frontend validation tests
  • End-to-end testing instructions

🔒 Security Notes

  • Never commit .env files with real credentials
  • Use environment variables for all secrets
  • Each variation includes security best practices
  • CORS is configured for local development (adjust for production)

📖 Learning Path

  1. Start with ARCHITECTURE.md (root level) to understand the overall design
  2. Read COMPARISON.md to choose your variation
  3. Pick a variation and read its SETUP.md
  4. Study the code comments in the backend and frontend
  5. Experiment with modifications

🛠️ Customization

All variations are designed for easy modification:

  • Clear separation of concerns
  • Modular architecture
  • Extensive comments
  • Configuration via environment variables
  • Easy to swap LLM providers

📝 License

MIT License - Free to use, modify, and distribute

🤝 Contributing

This is a learning project. Feel free to:

  • Modify for your needs
  • Add new variations
  • Improve documentation
  • Share your enhancements

Next Steps: Read ARCHITECTURE.md and COMPARISON.md, then choose your variation!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors