Create designs based on your interests and taste.
I wanted to help my wife kickstart her print-on-demand business. She often has a concept or theme in mind, but struggles to come up with specific design ideas. Finding out "what's popular" based on a certain concept is difficult and time consuming. I wanted to build her something to inspire her designs.
I made the user flow as simple as possible. The user simply just have to type in some ideas they had in mind and the tool will automatically figure out designs related to those ideas for them.
Under the hood, the process is split into multiple steps:
- After the user types in the inspiration, LLM extracts the entity type, filters, signals and output from their enquiry.
- Keywords from entities and tags are extracted from the output of Step 1 so that IDs can be retrieved using Qloo's Entity Search and Tag Search APIs using keywords.
- IDs for entity and tags are combined with the analysis output of Step 1. This replaces the keywords for entities and tags with IDs.
- The combined result from Step 3 is mapped to real parameters of Insights API
- Insights API is called using the parameters
- The insights from Qloo and the original user input are combined to create image generation prompts
- Images are generated from the prompts
This app was built using the following core technologies:
Qloo API:
- Provides insights on related data based on user "taste".
Gemini:
- Analyses text and translate the information the something that Qloo API can understand.
- Transforms outputs to generate prompts to create designs.
- Generates images based on automatically generated prompts
Supabase:
- Used to store generates images and data. (Side Note: Firebase can also be used to support this but they've recently removed storage options in the free-tier)
Firebase:
- Provides a secure backend to integrate with Gemini and keep API keys safe.
- App Check is used to protect against spam and API misuse. This ensures that I do not exceed their free quota.
- Due to the unpredictable nature of LLMs, you sometimes get parsing errors on some steps. This happens when the LLM produces an output that is not a JSON object.
- Refine prompts so that it can consistently return JSON objects
- Use different models to produce higher quality images
- Extend the tool to show insights such as how to market the images
- Set up a Firebase project.
- Follow these steps to set up reCAPTCHA v3 for App Check
- Follow these steps to enable AI Logic in Firebase
Use docs for reference: https://supabase.com/docs/guides/database/tables
- Create a database table called "generated-images" with the following schema

- Set up table policy to enable table insertion

- Set up table policy to enable table selection

- Navigate to "Authentication"
- Open Configuration > Sign In / Providers
- Enable "Allow anonymous sign-ins"
See docs for reference: https://supabase.com/docs/guides/storage/buckets/creating-buckets
- Create a bucket called "trendprints-images"
- Make sure that
Publicis enabled - Open Configuration > Policies
- Create a bucket policy for "trendprint-images" with the following configuration:

- Create a
.envfile with the following contentsVITE_FIREBASE_API_KEY=<CHECK_FIREBASE_CONSOLE> VITE_FIREBASE_AUTH_DOMAIN=<CHECK_FIREBASE_CONSOLE> VITE_FIREBASE_PROJECT_ID=<CHECK_FIREBASE_CONSOLE> VITE_FIREBASE_STORAGE_BUCKET=<CHECK_FIREBASE_CONSOLE> VITE_FIREBASE_MESSAGING_SENDER_ID=<CHECK_FIREBASE_CONSOLE> VITE_FIREBASE_APP_ID=<CHECK_FIREBASE_CONSOLE> VITE_FIREBASE_MEASUREMENT_ID=<CHECK_FIREBASE_CONSOLE> VITE_RECAPTCHA_SITE_KEY=<CHECK_RECAPTCHA_SITE_ID> VITE_QLOO_API_URL= VITE_QLOO_API_KEY= VITE_SUPABASE_URL=<CHECK_SUPABASE_DASHBOARD> VITE_SUPABASE_ANON_KEY=<CHECK_SUPABASE_DASHBOARD> - Define values for the environment variables in the
.envfile - Run
npm install - Run
npm run dev