Git Product home page Git Product logo

techin510-lab3's Introduction

Promptbase

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.

Features

  • 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

Prerequisites

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

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/promptbase.git
    
  2. Navigate to the project directory:

    cd promptbase
    
  3. Install the required Python packages:

    pip install -r requirements.txt
    
  4. Set up the PostgreSQL database:

    • Create a new PostgreSQL database for Promptbase.
    • Update the database connection details in the .env file.
  5. Run the Streamlit application:

    streamlit run app.py
    
  6. Access the Promptbase application in your web browser at http://localhost:8501.

Usage

  1. 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.

  2. Use the search bar to search for prompts by title or content. The search results will be displayed automatically.

  3. Sort the prompts by creation date or title using the "Sort by" dropdown.

  4. Filter the prompts to show only favorites by checking the "Show favorites only" checkbox.

  5. Edit a prompt by clicking the "Edit" button next to the prompt. Update the prompt details and click "Submit" to save the changes.

  6. Delete a prompt by clicking the "Delete" button next to the prompt.

  7. 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.

  8. Copy the rendered prompt to the clipboard by clicking the "Copy Prompt" button.

Lessions Learned

  1. Streamlit proved to be a powerful and user-friendly framework for building interactive web applications quickly.
  2. 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.

Questions

  1. How to write more fancy web pages?

techin510-lab3's People

Contributors

ianchen06 avatar wmhst7 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.