đź“–AI-Powered Bible Verse Generator

Introduction

Have you ever wanted a Bible verse to inspire you in moments of doubt, faith, or gratitude? Our AI-Powered Bible Verse Generator is designed to help! With just a keyword, the AI finds a perfect verse to uplift your spirit.

Features

  • AI-Powered Verse Selection: Enter any theme, and AI finds the best matching Bible verse.
  • User-Friendly Interface: Simple and elegant UI with dark mode.
  • Desktop App: Works offline once installed on Windows and Mac.
  • Copy & Share: Instantly copy or share your favorite verses.

Overview

The application is built using Streamlit, React, and Electron.js. It utilizes the OpenAI API to generate Bible verses dynamically.

Architecture

  1. Frontend (React + Electron.js): User interface for input and display.
  2. Backend (Streamlit + Python): Handles AI requests and serves responses.
  3. Electron.js: Bundles the app as a desktop application.

Components

  • Streamlit Backend (ai_bible_verse_app.py):
    • Accepts user input (theme/keyword)
    • Calls OpenAI API for verse generation
    • Sends response to frontend
  • React Frontend (BibleVerseApp.js):
    • Handles UI interactions
    • Fetches data from Streamlit backend
    • Displays the generated verse
  • Electron Main Process (electron_main.js):
    • Starts Streamlit backend
    • Loads React frontend
    • Manages app lifecycle

Frontend (Electron + React/Streamlit UI)

  • User enters a theme or keyword (e.g., “faith,” “hope,” “love”).
  • The app fetches an AI-generated Bible verse related to the theme.
  • Users can save, copy, or share the verse.

Backend (Python + Streamlit)

  • Uses an AI model to generate relevant Bible verses.
  • Supports predefined themes or open-ended user inputs.
  • Option to display explanations or cross-references.

Packaging (Electron)

  • Wraps the app as a desktop application (Windows/Mac/Linux).
  • Integrates the Streamlit app into an Electron window.

UI Layout (React + Tailwind for styling)

  1. Header: “AI-Powered Bible Verse Generator” (with a Bible icon)
  2. Input Field: Users enter a keyword or theme (e.g., “faith,” “hope”).
  3. Generate Button: Triggers the verse generation.
  4. Verse Display Area: Shows the generated verse with a smooth fade-in animation.
  5. Copy & Share Buttons: Allows users to copy the verse or share it on social media.
  6. Save Button: Saves favorite verses in a local storage list.
  7. Sidebar (Optional): A history section displaying previously generated verses.

Color Theme:

  • Background: Soft gradient (light beige to white, like old parchment)
  • Buttons: Blue & gold theme for a spiritual feel
  • Font: Elegant serif for Bible text

Features Included:

âś… Light & Dark Mode
âś… User Input for Theme/Keyword
âś… Fetching Verse from Streamlit Backend
âś… Animated Verse Display
âś… Copy & Share Buttons

Electron.js integration

âś… Starts the Streamlit backend automatically.
âś… Loads the React frontend inside an Electron window.
âś… Handles app closing gracefully.

configure Electron Builder to generate Windows EXE & Mac DMG installers.

How to Build the App:

  1. Run npm install to install dependencies.
  2. Run npm run build:win for Windows EXE.
  3. Run npm run build:mac for Mac DMG.

API Integration

  • OpenAI API: Used to generate Bible verses based on input.
  • Local API Communication: http://localhost:8501/generate_verse?theme=<keyword>

Packaging & Deployment

  • Uses Electron Builder for creating Windows (.exe) and Mac (.dmg) installers.
  • Run npm run build:win for Windows.
  • Run npm run build:mac for Mac.

You May Love