This project contains 4 complete implementations of a self-hosted prompt refinement web application, each using different technology stacks.
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
- 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
- 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)
- Best for: Rapid prototyping, familiar stack
- Pros: Simple, well-documented, GPT-4 access
- Cons: Requires OpenAI API key
- Cost: Pay per use (OpenAI pricing)
- Best for: JavaScript developers, Claude access
- Pros: Full JavaScript stack, Claude 3 models
- Cons: Requires Anthropic API key
- Cost: Pay per use (Anthropic pricing)
- 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)
Choose your variation and follow its specific README:
# Example: Variation 1 (FastAPI + Bedrock)
cd variation-1-fastapi-bedrock
cat README.md
cat SETUP.mdEach variation includes:
- README.md: Overview and features
- SETUP.md: Step-by-step setup instructions
- ARCHITECTURE.md: Technical architecture details
- Code comments: Inline explanations throughout
Each variation includes:
- Unit tests for backend logic
- Integration tests for API endpoints
- Frontend validation tests
- End-to-end testing instructions
- Never commit
.envfiles with real credentials - Use environment variables for all secrets
- Each variation includes security best practices
- CORS is configured for local development (adjust for production)
- Start with ARCHITECTURE.md (root level) to understand the overall design
- Read COMPARISON.md to choose your variation
- Pick a variation and read its SETUP.md
- Study the code comments in the backend and frontend
- Experiment with modifications
All variations are designed for easy modification:
- Clear separation of concerns
- Modular architecture
- Extensive comments
- Configuration via environment variables
- Easy to swap LLM providers
MIT License - Free to use, modify, and distribute
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!