Tarot App - GPT generated reading and card

Hey there, been a lurker for a bit and recently completed a coding bootcamp. Trying to build up my portfolio and experience since I came from a non-traditional background, and built a mini project using mongoDB, express, graphQL, and react. Hope this is the right place to show it off a bit!

This App (deployed demo) (GitHub link) comes with a daily, relationship, abundance, Yes or No and some frame color options. When you first “sign up” (you can use a bogus email) you can choose if you want upright only as an option.

What it does

This decides a specific tarot card drawn, and then send it to the completion end point asking for a json back using the OpenAI node npm package.

My prompt:

You are an agent simulated as an helpful API wizard: This is a daily reading and ${pulledCards} was pulled. Provide a sentence describing only the occult imagery (for text to image generation) of the card while avoiding any references of nudity or nakedness, then provide an unique explanation for this reading, and also 1 advice per Card you would share to clarify this specific reading. only provide a RFC8259 compliant JSON response following this format without deviation. {"upright": "true"/"false", "card": "name", "imagery": "imagery", "meaning" :"meaning", "advice": "advice"};

codeSnippet
it then uses the imagery response from davinci, manipulate it into a prompt for the image edit end point.
I also fetch two pre-made card frame that I made, with a png mask in b64 blob to send along to the api on the react front end.

CodeSnippetTwo

Since the url can expire, I ended up retrieving the image in b64 and upload it directly to cloudinary for storage.

(I for the life of me wasn’t able to get the API node npm package and Apollo graphQL to work with the edit endpoint with uploading the input and mask. the image completion endpoint did worked fine)

Excluding the daily reading, you can also ask a question and have it take it into consideration.

The demo is hosted on a heroku eco server so the it might take a little bit to wake up if it was idle. Unfortunately the load time can a bit long due to the image generation bits and the result can be a bit unpredictable, but I am having a ton of fun with it and trying to interpret these cards:


samplesample2sample3sample4


P.S. wanted to shout out these couple thread for pointing me in the right directions:

Great Thread on image edits

on JSON prompting


Thank you for taking time to check it out, and feel free to let me know what you think!

3 Likes

I think this is really cool. I would like to create something like this, what ever came of this?. You say you have completed a coding bootcamp, did you have no knowledge/experience prior to the bootcamp?