VitalFlow is a health monitoring system that integrates health data from Android devices using Flutter and Kotlin, processes it through a Flask-based backend, and stores insights in a MongoDB database. This backend handles API endpoints for health metrics like steps, heart rate, sleep, hydration, stress levels, and daily performance.
- User Authentication (Signup/Login with bcrypt password hashing)
- Health Data Syncing from Health Connect (Steps, Heart Rate, Sleep, etc.)
- Water Intake Logging (Manual and estimated via NLP)
- Stress Detection (Text-based and calculated from vitals)
- Sleep Monitoring using bedtime schedule
- Performance & Insights Engine combining metrics
- Data Visualization Support for graphs and trends (via API)
| Layer | Tech |
|---|---|
| Backend | Python, Flask |
| Database | MongoDB |
| Auth | Bcrypt, JWT (optional) |
| API Design | RESTful |
| NLP Model | Scikit-learn / SpaCy / Custom ML |
| Platform | Android (Flutter & Kotlin) |
vitalflow_backend/
β
βββ app/
β βββ __init__.py
β βββ routes/
β β βββ auth.py
β β βββ health_data.py
β β βββ water_log.py
β β βββ stress_log.py
β β βββ insights.py
β βββ models/
β β βββ user.py
β β βββ health.py
β β βββ utils.py
β βββ nlp/
β βββ water_parser.py
β βββ stress_analyzer.py
β
βββ config.py
βββ requirements.txt
βββ run.py
βββ README.md
git clone https://github.com/B-Acharekar/vitalflow_backend.git
cd vitalflow_backendpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the root directory with the following content:
MONGO_URI=mongodb://localhost:27017/vitalflow
SECRET_KEY=your-secret-key
python run.pyServer runs at http://localhost:5000/
| Method | Endpoint | Description |
|---|---|---|
| POST | /signup |
Register a new user |
| POST | /login |
Authenticate user |
| POST | /health/steps |
Log step data |
| POST | /health/heart-rate |
Log heart rate |
| POST | /health/sleep |
Log sleep duration |
| POST | /water/log |
Log water intake |
| POST | /stress/analyze |
Log and analyze stress input |
| GET | /insights/day |
Get daily performance insights |
- Water Intake Parsing: Converts phrases like "drank a glass of water" into estimated ml values.
- Stress Detection: Based on sentiment analysis or derived from heart rate and sleep data.
- Add unit and integration tests
- Add Swagger/OpenAPI documentation
- Dockerize for containerized deployment
- Implement CI/CD pipeline