Skip to main content

Prerequisites

Before setting up your development environment, ensure you have:

Python 3.12+

Required for running the application

Docker & Docker Compose

For running PostgreSQL and Redis

Git

For version control

Code Editor

VS Code, PyCharm, or your preferred IDE

Quick Setup

1

Clone the repository

git clone https://github.com/thetahealth/mirobody-health.git
cd mirobody-health
2

Create virtual environment

python3.12 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
3

Install dependencies

pip install -r requirements.txt
pip install -e .  # Install in development mode
4

Start services

docker-compose up -d postgres redis
5

Configure

cp config.example.yaml config.yaml
# Edit config.yaml with your settings
6

Run the application

python main.py
Server should start on http://localhost:18080

Development Tools

.vscode/extensions.json
{
  "recommendations": [
    "ms-python.python",
    "ms-python.vscode-pylance",
    "ms-python.black-formatter",
    "charliermarsh.ruff",
    "tamasfe.even-better-toml",
    "redhat.vscode-yaml"
  ]
}

Code Formatting

# Install development dependencies
pip install black ruff pytest pytest-asyncio

# Format code
black .

# Lint code
ruff check .

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=connect --cov-report=html

# Run specific test file
pytest tests/test_provider_garmin.py

# Run integration tests
pytest -m integration

Project Structure

mirobody-health/
├── connect/                 # Provider integrations
│   └── theta/
│       ├── mirobody_garmin_connect/
│       └── mirobody_whoop/
├── tests/                   # Test files
├── config.yaml             # Configuration
├── main.py                 # Application entry point
├── requirements.txt        # Dependencies
└── setup.py               # Package setup

Next Steps