Skip to content

Mihai-Tirtara/HypochondriAI

Repository files navigation

HyphochondriaAI - Health Anxiety Specialist

HyphochondriaAI Logo

Build Status Python FastAPI License

Introduction

HyphochondriaAI is a chatbot designed to provide compassionate support and evidence-based information for individuals experiencing health anxiety. Built with modern web technologies and powered by advanced language models, it offers a safe space for users to explore their health concerns while promoting healthy coping mechanisms and encouraging appropriate medical consultation when necessary.

Technology Stack & Features

  • ⚑ FastAPI for the Python backend API

    • 🧰 SQLModel for database interactions (ORM)
    • πŸ” Pydantic for data validation and settings management
    • βœ… Pytest for comprehensive testing
    • πŸ”„ Alembic for database migrations
    • πŸ’Ύ PostgreSQL as the SQL database
    • πŸ”  Ruff and Black for linting and formatting
  • πŸš€ React for the frontend

    • πŸ’ƒ Using TypeScript, hooks, Vite, and other parts of a modern frontend stack.
    • 🎨 TailwindCSS for responsive design
    • πŸ“± An automatically generated frontend client
    • πŸ•β€πŸ¦Ί Husky with ESLint as Git hook
  • πŸ€– LangChain for LLM framework

    • 🌐 LangGraph for agent creation and conversation memory
    • ☁️ AWS Bedrock for AI model access
    • 🦾 Claude as the AI model
  • 🏭 CI/CD pipeline with GitHub Actions.

  • πŸ‹ Docker Compose for development and production.

Main Page

API docs

Conversation Page

API docs

Interactive documentation

API docs

AWS Cloud Architecture

API docs

  • ☁️ ECS with Fargate for serverless container orchestration
    • 🐳 ECR for Docker image registry
    • πŸ” Secrets Manager for secure credential storage
    • πŸ“Š Cloudwatch for monitoring and logging
    • πŸ”„ Auto-scaling and health checks with circuit breaker deployment
  • 🌐 CloudFront global CDN for frontend delivery
    • πŸͺ£ S3 for static website hosting
    • πŸ”’ Origin Access Control (OAC) for secure bucket access
    • ⚑ Custom caching policies for optimal performance
  • πŸ“‘ Amazon VPC - Custom virtual private cloud with public/private subnets
    • πŸ—οΈ ALB for HTTP/HTTPS traffic distribution
    • πŸ”“ VPC Endpoints - Private connectivity to AWS services:
    • πŸ” ACM for SSL/TLS certificates
    • πŸ›‘οΈ Security groups and network isolation
  • πŸ—„οΈ RDS managed database
    • πŸ”„ Multi-AZ deployment for high availability
    • πŸ“ˆ Performance Insights and enhanced monitoring
    • πŸ” Encrypted storage and automated backups
  • πŸ€– Terraform for Infrastructure as Code
    • πŸ“ S3 backend with DynamoDB state locking
    • πŸš€ Automated deployment scripts

ECS Cluster Metrics

API docs

ECS Log Events

API docs

RDS Metrics

API docs

ALB Metrics

API docs

Cloudwatch Alarms

API docs

Installation

Follow these steps to set up and run the application locally:

1. Environment Setup

# Ensure you have Python 3.12+ and Node.js installed
# PostgreSQL database will need to be created beforehand

2. Backend Service (Python FastAPI)

# Navigate to the backend directory
cd backend/app

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows, use: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Set up environment variables in .env file
# Example:
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_REGION=your_aws_region
MODEL_ID=anthropic.claude-3-5-sonnet-20240620-v1:0
DB_USERNAME=your_db_user
DB_PASSWORD=your_db_password
DB_NAME=health_anxiety

# Start the FastAPI server
fastapi dev

3. Frontend (React)

# Navigate to the frontend directory
cd frontend

# Install dependencies
npm install

# Start the development server
npm run start

4. Docker Set-up

# Create a .env file in the root folder with folowing variables
#Example:

# Database Configuration
DB_NAME=your_db_name
DB_USERNAME=your_db_username
DB_PASSWORD=your_db_password
DB_HOST=postgres
DB_PORT=5432

# Superuser Configuration
DB_SUPERUSER_USERNAME=your_superuser_name
DB_SUPERUSER_PASSWORD=your_superuser_password
DB_SUPERUSER_EMAIL=your_superuser_email

# AWS Configuration
AWS_ACCESS_KEY_ID=your_aws_acces_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_acces
AWS_REGION=your_aws_region

# Bedrock Configuration
MODEL_ID=your_model_of_choice
MODEL_PROVIDER=bedrock_converse
MAX_TOKENS=1000
TEMPERATURE=0.3
TOP_P=0.4

# API Configuration
API_HOST=0.0.0.0
API_PORT=8000
LOG_LEVEL=INFO
API_PREFIX=/api/v1

# App settings
APP_NAME=HypochondriAI - Health anxiety specialist
APP_VERSION=0.1.0
APP_DESCRIPTION=AI Agent offering personalized support for people struggling with health anxiety

# The application can now be started locally with a single command
docker compose up --build

License

This project is licensed under the GPL 3.0 License - see the LICENSE file for details.

About

AI-powered health anxiety management app that provides evidence-based information and personalized support

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors