0% found this document useful (0 votes)
8 views2 pages

Tech Stack Setup

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Tech Stack Setup

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

📄 DOC 1 – Tech Stack & Environment Setup

Project: CartSense
Version: MVP v1.0
Scope: Local-only POC with Gemini LLM + SMTP for email delivery
Primary Language: Python 3.10+
Interface Framework: Streamlit

🧰 1. Required Tools & Libraries


You'll need the following:
🔹 Python 3.10+ (recommended 3.11)
🔹 Required Python Libraries:
- streamlit — UI rendering
- sqlite3 — local database (standard lib)
- pandas — for manipulating mock data tables
- google.generativeai — for Gemini LLM access
- smtplib — email sending (standard lib)
- toml — for secrets parsing
- dotenv (optional) — for alternative config style
- time, datetime — session handling

🧾 2. Required Files in Repo Root


project/
├── app.py # Streamlit entrypoint
├── modules/
│ ├── db_ops.py
│ ├── gemini_infer.py
│ ├── logic.py
│ └── smtp_sender.py
├── .streamlit/
│ └── secrets.toml # Holds API keys and SMTP creds
├── data/
│ └── db.sqlite3 # Or JSON files for mock profiles, carts, etc.
├── assets/
│ └── products.json # Sample catalog for display
├── README.md
└── requirements.txt

📦 3. Python Requirements (requirements.txt)


streamlit
pandas
google-generativeai
toml
python-dotenv

📌 Optional:
add pyinstaller or uvicorn if packaging or running as API server later.

📁 4. Config: secrets.toml Structure

.streamlit/secrets.toml:
[toml]
[gemini]
api_key = "YOUR_GEMINI_API_KEY"

[smtp]
email = "[email protected]"
password = "your-app-specific-password"
server = "smtp.gmail.com"
port = 587
✅ Important:
- Use an App Password for Gmail or similar — avoid plain passwords if possible.
- To access in Python:
import toml
config = toml.load(".streamlit/secrets.toml")
api_key = config["gemini"]["api_key"]
smtp_email = config["smtp"]["email"]

🖥 5. Run Instructions (CLI or Cursor)


Step 1: Install dependencies
pip install -r requirements.txt

Step 2: Add your API keys in .streamlit/secrets.toml

Step 3: Launch the app


streamlit run app.py
App will open in your browser at localhost:8501

🎯 6. Environment Notes
- No external server calls beyond:
→ Gemini API
→ SMTP server
- Runs fully offline otherwise
- No login system — use dropdown to switch between mock profiles
- All behavior is simulated through local event triggers

📁 7. Optional Dev Tools


You can optionally add:
- logging — to track LLM outputs, email dispatches
- Faker — for generating additional profile mock data
- uuid — for session tokens

✅ Summary
You now have a dev-friendly, zero-deployment local environment with:
- Simple folder structure
- One-click run
- Easy-to-update profile/cart/product data
- Modular structure for logic, email, Gemini

You might also like