CoolFace
Apppublic

jainsandesh960/symptomap-ai

sourceHugging Facemitupdated 8mo agoView on Hugging Face
0likes
App README

๐ŸŒฟ SymptoMap.ai

Your Calm Companion for Understanding Body Sensations

SymptoMap.ai is a wellness education web application that helps users understand everyday body sensations in a calm, educational way. It provides general wellness information without diagnosis or medical advice.

SymptoMap.ai

โš ๏ธ Important Disclaimer

SymptoMap.ai is NOT a medical device, diagnostic tool, or healthcare provider.

This application provides general educational information only and should NEVER be used as a substitute for professional medical advice, diagnosis, or treatment. Always consult with qualified healthcare professionals for any health concerns.

โœจ Features

  • โ€”๐Ÿ“ Sensation Input Form - Describe your experience with structured fields
  • โ€”๐Ÿค– AI-Powered Insights - Get calm, educational explanations using Google Gemini
  • โ€”๐Ÿง Interactive Body Map - Visual highlighting of affected body regions
  • โ€”๐Ÿ“Š Session History - Track past sensations with timestamps
  • โ€”๐ŸŒ™ Dark Mode - Toggle between light and dark themes
  • โ€”๐Ÿ’พ Export Function - Download your wellness insights as markdown
  • โ€”๐Ÿ“ˆ Intensity Trends - Visual chart of intensity over time
  • โ€”๐Ÿง˜ Breathing Exercise - Quick calming exercise widget
  • โ€”๐Ÿ“ฑ Mobile Responsive - Works on all devices
  • โ€”๐Ÿ”’ Safety First - Built-in filters prevent medical claims

๐Ÿ› ๏ธ Tech Stack

  • โ€”Frontend: Streamlit
  • โ€”AI: Google Gemini Flash API
  • โ€”Language: Python 3.9+
  • โ€”Styling: Custom CSS with premium design system

๐Ÿš€ Quick Start

Prerequisites

  • โ€”Python 3.9 or higher
  • โ€”Google API Key (Gemini)

Installation

  1. 1.Clone the repository
bash
   git clone <repository-url>
   cd symptomap_ai
  1. 1.Create a virtual environment
bash
   python -m venv venv
   source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. 1.Install dependencies
bash
   pip install -r requirements.txt
  1. 1.Configure environment variables
bash
   cp .env.example .env
   # Edit .env and add your GOOGLE_API_KEY
  1. 1.Run the application
bash
   streamlit run app.py
  1. 1.Open in browser Navigate to http://localhost:8501

๐Ÿ“ Project Structure

symptomap_ai/
โ”œโ”€โ”€ app.py                 # Main application entry point
โ”œโ”€โ”€ requirements.txt       # Python dependencies
โ”œโ”€โ”€ .env.example          # Environment template
โ”œโ”€โ”€ README.md             # This file
โ”‚
โ”œโ”€โ”€ page_modules/         # Page modules
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ home.py          # Main input/analysis page
โ”‚   โ”œโ”€โ”€ about.py         # About page
โ”‚   โ””โ”€โ”€ safety.py        # Safety & disclaimer page
โ”‚
โ”œโ”€โ”€ utils/                # Utility modules
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ llm_client.py    # Google Gemini API client
โ”‚   โ”œโ”€โ”€ prompts.py       # Prompt templates
โ”‚   โ”œโ”€โ”€ response_safety.py  # Response sanitization
โ”‚   โ”œโ”€โ”€ body_map.py      # Body region management
โ”‚   โ””โ”€โ”€ ui_components.py # Reusable UI components
โ”‚
โ”œโ”€โ”€ assets/              # Static assets
โ”‚   โ””โ”€โ”€ styles.css       # Custom CSS styles
โ”‚
โ””โ”€โ”€ .streamlit/          # Streamlit configuration
    โ””โ”€โ”€ config.toml

๐Ÿ”’ Safety Features

SymptoMap.ai includes multiple layers of safety:

  1. 1.System Prompt Engineering - AI is instructed to never diagnose or use medical terminology
  2. 2.Response Sanitization - Post-processing filters remove:
  3. 3.Medical terms and disease names
  4. 4.Percentages and statistics
  5. 5.Diagnostic phrases
  6. 6.Mandatory Disclaimers - Every response includes safety reminders
  7. 7.Fallback Responses - Safe generic responses if AI fails
  8. 8.Emergency Guidance - Clear (non-diagnostic) emergency information

๐ŸŽจ Customization

Themes

Edit .streamlit/config.toml to customize colors:

toml
[theme]
primaryColor = "#4A90A4"
backgroundColor = "#F8FBFC"
secondaryBackgroundColor = "#EEF5F8"
textColor = "#2C3E50"

Adding Body Regions

Edit utils/body_map.py to add new body regions:

python
BODY_REGIONS["New Region"] = {
    "keywords": ["keyword1", "keyword2"],
    "color": "#HEXCOLOR",
    "icon": "๐Ÿ†•",
    "svg_id": "new_region"
}

๐Ÿ“ API Configuration

Getting a Google API Key

  1. 1.Go to Google AI Studio
  2. 2.Click "Create API Key"
  3. 3.Copy the key and add it to your .env file

Rate Limiting

The application includes built-in rate limiting (1 second minimum between requests) to avoid API quota issues.

๐Ÿงช Development

Running in Development Mode

bash
streamlit run app.py --server.runOnSave true

Code Quality

The codebase follows:

  • โ€”PEP 8 style guidelines
  • โ€”Type hints where appropriate
  • โ€”Comprehensive docstrings
  • โ€”Modular architecture

๐Ÿ“„ License

MIT License - See LICENSE file for details.

๐Ÿค Contributing

Contributions are welcome! Please ensure:

  • โ€”Code follows existing style
  • โ€”Safety features are maintained
  • โ€”No medical claims or diagnostic language
  • โ€”All new features include proper disclaimers

๐Ÿ“ž Support

For questions or issues, please open a GitHub issue.


Remember: SymptoMap.ai is for educational purposes only. Always consult healthcare professionals for medical concerns.

๐ŸŒฟ Understanding your body, one sensation at a time.