A Ruby on Rails application for creating, managing, and executing prompts with language models (LLMs). Built with modern Rails conventions, Hotwire for dynamic interactions, and Tailwind CSS for styling.
- Prompt Management: Create, edit, and organize prompts with variable support
- LLM Integration: Execute prompts with multiple AI providers (OpenAI, Anthropic)
- Generation History: Track and view all prompt executions and results
- Modern UI: Responsive interface built with Hotwire and Tailwind CSS
- Docker Support: Containerized deployment ready
- Basic Authentication: HTTP Basic Auth protection for the entire application
- Backend: Ruby on Rails 7.2+
- Database: PostgreSQL with UUID primary keys
- Frontend: Hotwire (Turbo + Stimulus), Tailwind CSS
- JavaScript: Importmap-based (no bundler required)
- Deployment: Docker containerization
- Authentication: HTTP Basic Authentication
- Ruby 3.1.4+
- PostgreSQL 9.3+
- Node.js (for Tailwind CSS compilation)
bundle install
Create a .env
file in the root directory with the following variables:
# Basic Authentication Credentials
BASIC_AUTH_USERNAME=admin
BASIC_AUTH_PASSWORD=your_secure_password_here
# Add your other API keys here
Important: Replace your_secure_password_here
with a strong password. The .env
file is already in .gitignore
to keep your credentials secure.
# Create and setup database
bin/rails db:create
bin/rails db:migrate
bin/rails db:seed
bin/dev
The application will be available at http://localhost:3000
This application is protected with HTTP Basic Authentication. When you first visit the application, you'll be prompted for credentials:
- Username: Set via
BASIC_AUTH_USERNAME
environment variable (defaults to "admin") - Password: Set via
BASIC_AUTH_PASSWORD
environment variable (defaults to "password")
To change the credentials:
- Update the values in your
.env
file - Restart the Rails server
For production deployment, make sure to set strong, unique credentials using environment variables.
# Start the development server with hot reloading
bin/dev
# Or start components individually
bin/rails server
bin/rails tailwindcss:watch
This application uses different background job systems for different environments:
Development: Uses Sucker Punch (in-process, no additional setup required)
- Jobs run in the same process as the web server
- No Redis or additional services needed
- Perfect for development and testing
Production: Uses Sidekiq (requires Redis)
- Jobs run in separate worker processes
- Requires Redis server running
- Better for production workloads
To run in production:
# Start Redis
redis-server
# Start Sidekiq workers
bundle exec sidekiq
# Start Rails server
rails server
- Prompt: Stores prompt templates with variable placeholders
- Generation: Records prompt executions and LLM responses
The application integrates with multiple LLM providers through service objects:
AnthropicService
: Claude API integrationLlmService
: Generic LLM service interface
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions, please open an issue in the repository.