🔗 Live App: https://artisansai-studios.streamlit.app/
Empowering artisans and creators with AI-assisted ideation, content generation, image creation, and calendar-based reminders — built with Streamlit, Firebase, Vertex AI, and Google Generative AI (Gemini 2.5 Flash).
- 🌟 Artisans GenAI
Artisans GenAI blends multilingual UI, AI content generation, optional AI image generation, and an events calendar with reminders. Authenticated users can:
- Generate stories and social captions from prompts or uploaded images.
- Discover market trends and create growth plans.
- Track craft events and set reminders.
- 🔐 Firebase-backed email/password auth (Pyrebase)
- 🤖 Google Generative AI (Gemini 2.5 Flash) for text/JSON output
- 🖼️ Vertex AI ImageGenerationModel (Imagen) for 1:1 images
- 🌐 Multilingual UI (English, Hindi; extendable)
- 📅 Events calendar with reminders and preferences
- 🎛️ Config-driven via Streamlit secrets
- 🎨 Themed Streamlit UI with logo/favicon/background support
- frontend.py — Streamlit UI, routing, session state, widgets, calendar, reminders
- backend.py — Translations, AI helpers (Gemini/Vertex), events data, auth/bootstrap
- firebase_auth.py — Firebase initialization and helpers (sign up, login, save/load user data)
- .streamlit/config.toml — Theme
- .streamlit/secrets.toml — Secrets (NOT COMMITED)
- requirements.txt — Python dependencies
artisans_ai/
frontend.py
backend.py
firebase_auth.py
.streamlit/
config.toml
secrets.toml (gitignored; contains your keys)
requirements.txt
README.md
logo.gif (app logo, used in UI)
background.jpg (optional; background image)
git clone https://github.com/jatin-encrypted/Artisans-GenAI.git
cd Artisans-GenAI
python -m venv venv
# macOS / Linux
source venv/bin/activate
# Windows (Powershell)
venv\Scripts\Activate.ps1
pip install --upgrade pip
pip install -r requirements.txt- Create a Firebase project.
- Enable Authentication (Email/Password).
- Create a Realtime Database (or ensure databaseURL exists in your web config).
- From Project Settings → Your apps (Web) copy the Web app config (apiKey, authDomain, databaseURL, etc.).
- Paste those values under [firebase_config] in .streamlit/secrets.toml (see Streamlit Secrets below).
- Create/choose a Google Cloud project.
- Enable: Vertex AI API and Generative Language API.
- Create a Service Account with Vertex permissions and generate a JSON key.
- Put the raw JSON into GCP_SERVICE_ACCOUNT_JSON in .streamlit/secrets.toml.
- Also set GEMINI_API_KEY for google-generativeai (used for text).
- Vertex region used in code: us-central1.
Create .streamlit/secrets.toml. The keys below match how the code reads them.
# Top-level API keys used by backend.py
GEMINI_API_KEY = "YOUR_GEMINI_API_KEY"
# Provide raw JSON of your service account as a string (backend.py checks 'GCP_SERVICE_ACCOUNT_JSON')
GCP_SERVICE_ACCOUNT_JSON = """
{
"type": "service_account",
"project_id": "your-project-id",
"private_key_id": "xxx",
"private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
"client_email": "service-account@your-project-id.iam.gserviceaccount.com",
"client_id": "1234567890",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/service-account%40your-project-id.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
"""
[firebase_config]
apiKey = "YOUR_FIREBASE_WEB_API_KEY"
authDomain = "yourapp.firebaseapp.com"
databaseURL = "https://yourapp-default-rtdb.firebaseio.com"
projectId = "yourapp"
storageBucket = "yourapp.appspot.com"
messagingSenderId = "1234567890"
appId = "1:1234567890:web:abc123"
measurementId = "G-XXXXXXX" # optional
[firebase_database]
databaseURL = "https://yourapp-default-rtdb.firebaseio.com/"Notes:
- Do not commit secrets.toml.
- backend.py uses GEMINI_API_KEY and GCP_SERVICE_ACCOUNT_JSON.
- firebase_auth.py expects [firebase_config] for Pyrebase initialization.
Alternative to secrets.toml (if you prefer env vars):
# Firebase web config (map to your pyrebase config)
FIREBASE_API_KEY=...
FIREBASE_AUTH_DOMAIN=yourapp.firebaseapp.com
FIREBASE_DATABASE_URL=https://yourapp-default-rtdb.firebaseio.com
FIREBASE_PROJECT_ID=yourapp
FIREBASE_STORAGE_BUCKET=yourapp.appspot.com
FIREBASE_MESSAGING_SENDER_ID=1234567890
FIREBASE_APP_ID=1:1234567890:web:abc123
# Google Generative AI (Gemini) and Vertex
GEMINI_API_KEY=...
GCP_SERVICE_ACCOUNT_JSON='{"type":"service_account", ... }'
VERTEX_LOCATION=us-central1
If you use env vars, load them into st.secrets at runtime (or adapt firebase_auth.py to read envs directly).
Run the Streamlit app:
streamlit run frontend.pyThen:
- Open the local URL from the terminal.
- Register or log in (email/password).
- Pick a workflow from the sidebar and generate content or set reminders.
Basic checks:
- Invalid login shows a friendly error.
- Valid login persists session.
- “Generate Marketing Kit” returns story/captions JSON rendered in UI.
- “Discover Market Trends” and “Growth Plan” return markdown.
- Calendar renders and reminders toggle/save to Realtime DB.
Optional rebuild:
pip install --force-reinstall -r requirements.txt- Auth fails: confirm [firebase_config] matches your Firebase Web config.
- Vertex/Gemini errors: ensure APIs are enabled and billing is active; verify GEMINI_API_KEY and service account permissions.
- Secrets not loading: ensure .streamlit/secrets.toml exists and keys match names above.
- Background/logo missing: app will warn if background.jpg is absent; logo.gif is optional but recommended.
- Persistent content save/export
- More languages
- Rich event sources (remote)
- Fine-grained role access
- Fork repository
- Create feature branch: git checkout -b feat/your-feature
- Commit: git commit -m "feat: add your feature"
- Push: git push origin feat/your-feature
- Open Pull Request
MIT License
Copyright (c) 2025 Artisans GenAI contributors
