Coder Social home page Coder Social logo

streamlit's Introduction

Streamlit book generator front end

This is the repo for the front-end component of the SADA-U/R&D team's "Baby Book Generator" app.

Summary

The front-end captures a users story prompt via an input field which saves the prompt as a state variable. This variable is passed to the flask back-end server as a parameter in a GET request to the back-end API endpoint. Once the prompt is passed to the back-end, this kicks off our AI text and image generators. Using Google Cloud PubSub, a relationship was created between our front-end and our Google Cloud storage bucket. PubSub listens for changes in that storage bucket in the form of AI generated images that have our generated story texts attached as metadata. Once a change is recognized, a callback is triggered that tells the front-end to go look into our Google Cloud storage bucket and display the generated item as well as save it locally to be used. The stored items are reformatted to acceptable pdf text and images to be saved if desired. -The back-end repo can be found here https://github.com/ertrtx/backend-bookgenerator

Run the app.

-run the app with streamlit run Homepage.py

Installation Requirements

  • Install modules
pip install google-cloud-storage
pip install streamlit_lottie
pip install google-auth
pip install google-cloud-storage
pip install streamlit
pip install google-cloud-pubsub
pip install fpdf
  • Setting up PubSub to receive notification for your Google Cloud storage bucket in the cloud shell
gsutil mb gs://BUCKET_NAME
gcloud pubsub topics create TOPIC_NAME
gcloud pubsub subscriptions create SUBSCRIPTION_NAME
gsutil notification create -f json -t <TOPIC_NAME> gs://<BUCKET_NAME>

special setup considerations

Streamlit manages keys via .toml files, if your keys are in json format they will have to be converted and placed in your .streamlit/secrets.toml file. If you're using Streamlit to also deploy your app, these keys must be included in the app settings via their secrets manager because the keys would/should not be pushed to github.

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.