| 📊 Health Dashboard | 🎙️ AI Voice Check |
![]() |
![]() |
| 🗺️ Environmental AQI Map | 🏋️ Lung Gym |
![]() |
![]() |
Record a 6-second vowel sound to receive a Lung Voice Score — a non-invasive respiratory health metric powered by machine learning (Librosa + Scikit-learn).
A real-time overview of your respiratory health, featuring an AI-driven Digital Twin Forecast that predicts attack risks based on your history and environment.
Interactive maps providing real-time AQI (Air Quality Index) data and personalized health predictions correlated with your local triggers.
Guided breathing exercises and the microphone-controlled Dragon Breather game to help improve lung capacity and adherence to breathing techniques.
┌─────────────────────────────────────────────────────────┐
│ BreatheSync Platform │
│ │
│ ┌───────────────────┐ ┌───────────────────────┐ │
│ │ React Frontend │◄──────►│ FastAPI Backend │ │
│ │ (Vite + TS) │ │ (Python 3.11) │ │
│ │ │ │ │ │
│ │ • Dashboard │ │ • /voice/analyze │ │
│ │ • Voice Check │ │ • /environment/aqi │ │
│ │ • Trigger Map │ │ • /chat │ │
│ │ • Lung Gym │ │ • /health │ │
│ │ • Sleep Mode │ │ │ │
│ │ • Gut Health │ │ ML Engine: │ │
│ └────────┬──────────┘ │ • Librosa (Audio) │ │
│ │ │ • Scikit-learn (ML) │ │
│ │ └──────────┬────────────┘ │
│ │ │ │
│ ┌────────▼──────────┐ ┌──────────▼────────────┐ │
│ │ Supabase │ │ External APIs │ │
│ │ (Auth + DB) │ │ • AQICN (Global AQI) │ │
│ │ PostgreSQL │ │ • OpenWeatherMap │ │
│ └───────────────────┘ └───────────────────────┘ │
└─────────────────────────────────────────────────────────┘
| Layer | Technology |
|---|---|
| Frontend | React 18, Vite, TypeScript, TailwindCSS, Shadcn/UI, Framer Motion |
| Maps | Leaflet.js |
| Data Visualization | Recharts |
| Backend | FastAPI, Python 3.11, Uvicorn |
| Machine Learning | Scikit-learn, Librosa, NumPy, SciPy |
| Database & Auth | Supabase (PostgreSQL + GoTrue) |
| Containerization | Docker |
| Frontend Deploy | Vercel |
| Backend Deploy | Hugging Face Spaces |
- Node.js 18+ and npm
- Python 3.11+
- A Supabase project with Auth enabled
- API keys for AQICN and OpenWeatherMap
git clone https://github.com/Shashwatology/BreatheSync.git
cd BreatheSynccd backend/breathesync-backend
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment variables
cp .env.example .env
# Edit .env with your API keys.env file:
AQICN_API_TOKEN=your_aqicn_token_here
OPENWEATHERMAP_API_KEY=your_owm_key_here
SUPABASE_URL=your_supabase_url_here
SUPABASE_KEY=your_supabase_key_here# Start the backend server
python main.py
# API available at: http://localhost:8000
# Docs available at: http://localhost:8000/docscd frontend/breathe-better-app
# Install dependencies
npm install
# Configure environment variables
cp .env.example .env
# Set VITE_SUPABASE_URL, VITE_SUPABASE_ANON_KEY, VITE_API_URL# Start the frontend dev server
npm run dev
# App available at: http://localhost:5173| Service | Platform | Cost |
|---|---|---|
| Frontend | Vercel | Free (Hobby) |
| Backend | Hugging Face Spaces (Docker) | Free |
| Database & Auth | Supabase | Free Tier |
- Go to vercel.com → Add New Project → Import this repo
- Set Root Directory to
frontend/breathe-better-app - Add your environment variables in Vercel settings
- Deploy ✅
- Create a new Docker Space at huggingface.co/new-space
- Push the
backend/breathesync-backendfolder to the Space's Git repo - Add your
.envvariables in Space Settings → Secrets - The Space auto-builds from the Dockerfile and exposes port
7860✅
BreatheSync/
├── backend/
│ └── breathesync-backend/
│ ├── main.py # FastAPI application entry point
│ ├── requirements.txt # Python dependencies
│ ├── Dockerfile # Docker config for Hugging Face Spaces
│ ├── routes/
│ │ ├── voice.py # Voice analysis endpoints
│ │ ├── environment.py # AQI & weather endpoints
│ │ ├── chat.py # AI chat (Travel Safe) endpoints
│ │ └── health.py # Health check endpoint
│ ├── services/
│ │ └── audio_processor.py # ML audio feature extraction
│ └── models/ # Trained ML model artifacts
└── frontend/
└── breathe-better-app/
├── src/
│ ├── pages/ # Route-level page components
│ ├── components/ # Reusable UI components
│ └── ...
├── vercel.json # Vercel SPA routing config
└── supabase/ # DB migrations & edge functions
Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change.
This project is licensed under the MIT License.
Breathe Better. Live Better. 🫁
Made with ❤️ by Shashwat Upadhyay



