How sandeepkasturi/soulcare-ai works
Project type and purpose
• Project type: A lightweight full-stack-style application (single-tier Streamlit “frontend” + orchestration + external AI “backend” service).
• Purpose: Expose mental-health functionalities (wellness coaching, drug info, medical report analysis, expert advice) via a Streamlit web UI, using Gemini-pro for AI processing.
File structure
• README.md – project overview, features, setup instructions.
• project.py – the only code file. Contains Streamlit UI definitions, input forms, calls to configure(api_key=…), and functions that call the Gemini-pro API.
• requirements.txt – lists Python dependencies (streamlit, google-api-client or similar).
There is no internal database or microservices. The app relies on:
• Streamlit’s server runtime (handles HTTP, session state).
• Google Gemini-pro API (external AI service).
• Streamlit secrets management (st.secrets["api_key"]).
Extract additional insights from the README
• Tech stack: Python + Streamlit UI framework.
• External dependency: Gemini-pro API (Google AI Studio).
• No mention of persistence layers – all data is ephemeral in memory.
• Deployment goal: host on Streamlit Cloud or similar.
Main components
a. User (Browser) – client making HTTP requests and rendering the UI.
b. Streamlit App Server – hosts project.py and executes the UI + orchestration code.
c. Secret Manager – abstraction for st.secrets storing the API key.
d. Gemini-pro API – Google’s large-language-model service.
e. (Optional) Streamlit Cloud or Hosting Infrastructure – AWS/Heroku/Streamlit Cloud.
Relationships & Data Flow
1. User enters input in the Streamlit web UI.
2. Streamlit App Server processes UI events, retrieves API key from Secret Manager.
3. App server issues an HTTPS request to the Gemini-pro API (passes user prompt + api_key).
4. Gemini-pro returns a response (analysis, advice, summary).
5. App server renders the response back in the Streamlit UI.
Architectural patterns & design principles
• Two-tier architecture:
– Presentation tier (Streamlit UI + project.py code).
– Service tier (external AI API).
• Single responsibility: project.py handles both UI definition and orchestration; secret management is decoupled via st.secrets.
• Stateless interactions: no local database; each user action is a new API call.
• Security: API key never checked into source control; stored in st.secrets.