Promptbase is a simple and intuitive web application built with Streamlit and PostgreSQL that allows users to store, manage, and retrieve prompts efficiently. It provides a user-friendly interface for creating, editing, searching, and rendering prompts. This is TECHIN 510 Lab 3.
- Create new prompts with a title, content, and favorite status
- Edit and update existing prompts
- Delete prompts
- Search prompts by title or content
- Sort prompts by creation date or title
- Filter prompts to show only favorites
- Render selected prompts as templates
- Copy rendered prompts to the clipboard with a single click
Before running the Promptbase application, ensure that you have the following prerequisites installed:
- Python 3.x
- PostgreSQL database
- Required Python packages listed in the
requirements.txt
file
-
Clone the repository:
git clone https://github.com/your-username/promptbase.git
-
Navigate to the project directory:
cd promptbase
-
Install the required Python packages:
pip install -r requirements.txt
-
Set up the PostgreSQL database:
- Create a new PostgreSQL database for Promptbase.
- Update the database connection details in the
.env
file.
-
Run the Streamlit application:
streamlit run app.py
-
Access the Promptbase application in your web browser at
http://localhost:8501
.
-
Create a new prompt by filling in the title, content, and optionally marking it as a favorite. Click the "Submit" button to save the prompt.
-
Use the search bar to search for prompts by title or content. The search results will be displayed automatically.
-
Sort the prompts by creation date or title using the "Sort by" dropdown.
-
Filter the prompts to show only favorites by checking the "Show favorites only" checkbox.
-
Edit a prompt by clicking the "Edit" button next to the prompt. Update the prompt details and click "Submit" to save the changes.
-
Delete a prompt by clicking the "Delete" button next to the prompt.
-
Render a selected prompt as a template by choosing a prompt from the "Choose a prompt to render" dropdown. The rendered prompt will be displayed below.
-
Copy the rendered prompt to the clipboard by clicking the "Copy Prompt" button.
- Streamlit proved to be a powerful and user-friendly framework for building interactive web applications quickly.
- Integrating PostgreSQL with Streamlit allowed for efficient storage and retrieval of prompts. Understanding how to establish a connection, execute SQL queries, and handle data manipulation was crucial for the project's success.
- How to write more fancy web pages?