A full-stack web application for generating professional AI prompts for various AI models including ChatGPT, Midjourney, DALL-E, and more.
- Multi-Model Support: Generate prompts for ChatGPT, Midjourney, DALL-E, Stable Diffusion, Claude
- Customizable Parameters: Control tone, complexity, type, and additional options
- Smart Generation: Uses DeepSeek AI API for intelligent prompt generation
- Fallback System: Template-based fallback when AI service is unavailable
- Responsive Design: Works perfectly on desktop and mobile devices
- Example Templates: Pre-built templates for common use cases
- Export Options: Copy to clipboard or save as text file
promptpilot-api/
βββ backend/
β βββ app.py # Flask API server
β βββ requirements.txt # Python dependencies
βββ frontend/
βββ index.html # Frontend interface
- Python 3.8+
- Flask
- DeepSeek API account (for AI generation)
-
Navigate to backend directory:
cd backend -
Create virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set environment variables:
export DEEPSEEK_API_KEY="your_deepseek_api_key_here" export PORT=5000 # Optional, defaults to 5000
-
Run the server:
python app.py
-
Update API URL:
- Open
frontend/index.html - Find the
API_BASE_URLconfiguration in the JavaScript section - Update with your actual domain for production:
const API_BASE_URL = 'https://your-actual-domain.com/api';
- Open
-
Deploy frontend:
- Serve
index.htmlfrom your web server - Ensure CORS is properly configured for your domain
- Serve
-
Upload backend files to your hosting service
-
Set environment variables:
DEEPSEEK_API_KEY: Your DeepSeek API keyPORT: Server port (usually set automatically by hosting provider)
-
Install dependencies:
pip install -r requirements.txt
- Upload frontend files to your static hosting service
- Update API endpoint URL in
index.html - Configure proper CORS headers if needed
DEEPSEEK_API_KEY: Required for AI-powered prompt generationPORT: Server port (default: 5000)
Update the allowed origins in app.py:
CORS(app, origins=[
"https://yourdomain.com",
"http://yourdomain.com",
"https://www.yourdomain.com"
])Generate an AI prompt based on user parameters.
Request Body:
{
"model": "chatgpt",
"type": "creative",
"topic": "Artificial Intelligence",
"tone": "professional",
"complexity": 3,
"include_examples": true,
"step_by_step": false,
"include_questions": true,
"custom_instructions": "Focus on practical applications"
}Response:
{
"success": true,
"prompt": "Generated prompt text...",
"source": "ai"
}Health check endpoint.
- Update the
modeldropdown inindex.html - Add model-specific formatting in the
build_fallback_promptmethod inapp.py
- Update the
prompt-typedropdown inindex.html - Add type descriptions in the
build_system_promptmethod inapp.py
- Keep your DeepSeek API key secure and never commit it to version control
- Use environment variables for all sensitive configuration
- Implement rate limiting in production
- Validate all user inputs on the backend
- CORS Errors: Update the allowed origins in the Flask CORS configuration
- API Key Issues: Verify your DeepSeek API key is correctly set as an environment variable
- Generation Failures: The system will automatically fall back to template-based generation
Check the application logs for detailed error information:
# View logs in production
heroku logs --tail # For HerokuThis project is licensed under the GNU GENERAL PUBLIC LICENSE.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
For support and questions:
- Create an issue in the GitHub repository
- Check the documentation at PromptPilot
Note: Remember to replace placeholder domains and API keys with your actual production values before deployment.