GithubHelp home page GithubHelp logo

bear-of-the-day's Introduction

bear-of-the-day

This is a program that will construct an image prompt by randomly combining items from a list of scenes and a list of spirits/moods, call the OpenAI DALL-E 3 API, and then send the image in an email to the chosen recipients. And the pictures are of bears, because bears are cute.

Technical Details

The program is implemented in Python and uses the following key technologies:

  • OpenAI DALL-E 3 API: This API is used to generate images of bears based on the constructed prompts.

  • AWS CloudFormation: The infrastructure of the program is defined and managed using AWS CloudFormation. This includes the deployment of the AWS Lambda function.

  • AWS Lambda: The core logic of the program is implemented in a serverless AWS Lambda function. This function is triggered on a schedule, constructs the image prompt, calls the DALL-E 3 API, and sends the email.

  • SMTP via Gmail: The program uses SMTP via Gmail to send the generated bear image to the chosen recipients.

Frontend

The frontend of the application is built with Vue.js and is hosted in the frontend directory. It displays the bear image generated by the backend.

You can run the frontend locally by navigating to the frontend directory and running npm run serve.

Setup and Deployment

The program is packaged and deployed using the AWS Serverless Application Model (SAM) CLI. The sam package and sam deploy commands are used to package the application and deploy it to AWS, respectively.

Please ensure that you have the necessary AWS permissions and that your AWS credentials are correctly set up before deploying the program.

Ensure that you have set up the necessary environment variables (SENDER_EMAIL and SENDER_PASS) for the Gmail account used to send emails.

Usage

Once deployed, the program will automatically run on the defined schedule. You can customize the list of scenes, spirits, and email recipients by modifying the corresponding variables in the Lambda function code.

bear-of-the-day's People

Contributors

theotherdavid avatar jen242 avatar

Watchers

 avatar Kostas Georgiou avatar

bear-of-the-day's Issues

Add plural chance

Add a 25% chance for the subject to be pluralized (just add an S)

Confirm all env variables on startup

If I'm going to fail at Part 3, I've still generated an image in Part 2, and paid for it and everything, but nobody will get to see that bear.
Make some kind of startup function that confirms all required variables are present before doing ANYTHING.

Store email recipients better

Storing them in Github Actions means I have to do a whole deployment every time. If I stored them outside the app, I could add more people easier.
A DB table is the obvious choice, but I'd have to add a DB, and I'd rather not unless I have to.

Write a UI

Initially just display the current bear. Fancy it up later.
Try VueJS... maybe.

Update metadata storage to save individual attributes

As a developer, I want to update the image metadata storage so that instead of saving the full prompt string, we save each element (subject, scene, moods) as separate metadata fields.

This will allow for easier filtering and analysis by querying on the specific attributes instead of parsing long prompt strings.

Acceptance Criteria
Metadata is stored in fields subject, scene, moods (make this an array)

Create a holiday system

Match to predefined holidays. Should it substitute the Scene?
St Patrick's Day, March 17, "at a St Patrick's Day Parade"
4th of July, "at a 4th of July Cookout"
Halloween, "exploring a haunted house"
Christmas, "opening Christmas presents"

Come up with more, including some dumb ones.

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.