Skip to content

Repository files navigation

PromptCrafter

PromptCrafter Logo

License: MIT Python: 3.12+ FastAPI React

PromptCrafter is a web application that helps users create effective AI prompts with structured templates. It uses a modern stack with FastAPI backend and React frontend.

🎯 Features

  • Structured Prompt Generation: Create well-organized prompts following best practices
  • Personalized Templates: Generate prompts with role, task, constraints, output style, and personality
  • Advanced Templates: Pre-filled specialized templates for common technical scenarios
  • User Accounts: Save, organize, edit, and share your favorite prompts
  • Public Prompt Library: Explore prompts shared by the community with search, filtering and pagination
  • Tagging System: Organize and discover prompts with a flexible tagging system
  • Profile Management: Update user profile and customize account settings
  • Rate Limiting: API rate limiting to prevent abuse
  • Responsive Design: Modern UI that works well on all devices

🚀 Getting Started

Prerequisites

  • Python 3.12+
  • uv (Modern Python package manager)
  • Node.js & npm (for Frontend)
  • Git
  • PostgreSQL or SQLite

Local Development Setup

  1. Clone the repository:

    git clone https://github.com/FIBA00/promptCrafter.git
    cd promptCrafter
  2. Backend Setup:

    cd backend
    
    # Install dependencies with uv
    uv sync
    
    # Set up environment variables
    # Ensure you have a .env file based on your configuration
    
    # Run migrations
    uv run alembic upgrade head
    
    # Run the development server
    uv run fastapi dev main.py
  3. Frontend Setup:

    (Instructions for React frontend setup)

  4. Open your browser and go to http://localhost:8000/docs for the API documentation.

Docker Deployment

  1. Make sure Docker and Docker Compose are installed

  2. Run:

    docker-compose up -d
  3. Visit http://localhost to see the application

🏗️ Project Structure

promptCrafter/
├── backend/               # FastAPI Backend
│   ├── core/              # Core configuration and models
│   ├── db/                # Database connection
│   ├── migrations/        # Alembic migrations
│   ├── routers/           # API routes/endpoints
│   ├── schema/            # Pydantic schemas
│   ├── services/          # Business logic
│   ├── utility/           # Utility functions
│   ├── main.py            # Application entry point
│   ├── pyproject.toml     # Python dependencies (uv)
│   └── alembic.ini        # Alembic configuration
├── frontend/              # React Frontend (planned/in-progress)
├── __docs__/              # Documentation
└── resources/             # Project resources

🔌 API Documentation

PromptCrafter provides a RESTful API. Documentation is automatically generated by FastAPI.

  • Swagger UI: /docs
  • ReDoc: /redoc

Example Endpoint: Process Prompt

Endpoint: /api/v1/process_prompt/

Method: POST

Request Body:

{
  "role": "AI architect",
  "task": "design a prediction engine",
  "context": "Startups",
  "persona": "nerdy but strategic",
  "format": "step-by-step",
  "tone": "professional"
}

🧪 Testing

Run the test suite with:

cd backend
uv run pytest

🛠️ Tech Stack

  • Backend: FastAPI, SQLAlchemy, Pydantic, Alembic, Uvicorn
  • Frontend: React
  • Database: PostgreSQL (Production), SQLite (Dev)
  • Package Manager: uv
  • Deployment: Docker

📊 Roadmap

  • AI-assisted prompt improvement suggestions
  • Export prompts to various formats (PDF, Markdown)
  • Prompt collections/folders
  • OAuth login options (GitHub, Google)
  • Mobile app

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

📬 Contact

Fraol D. - @FIBA00

Project Link: https://github.com/FIBA00/promptCrafter

About

When using any ai editor or prompting we need structure and perfect prompt with additional infos into the prompt so that i created this small flask based system that puts together differnt sections of the prompt and gives strucutured prompt.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages