Skip to content

Commit a5674a1

Browse files
fix: add chromadb dependency and health endpoint
- Add chromadb==0.5.23 to requirements.txt - Implement /health endpoint in app.py - Update Setup.md with backend setup instructions - Add Quick Start in README.md with cd Backend Fixes #100
1 parent 8be2c7f commit a5674a1

File tree

4 files changed

+41
-15
lines changed

4 files changed

+41
-15
lines changed

Backend/app.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,14 @@ def index():
182182
task_db = get_tasks()
183183
return appointment_db
184184

185+
@app.route('/health')
186+
def health():
187+
return jsonify({
188+
'status': 'ok',
189+
'agent_initialized': agent is not None
190+
})
191+
185192
if __name__ == '__main__':
186-
app.run(host='0.0.0.0', port=5000, debug=True)
193+
app.run(host='0.0.0.0', port=5000, debug=False)
187194

188195

Backend/requirements.txt

36 Bytes
Binary file not shown.

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828
- **AI & NLP**: Python, LangChain
2929
- **Database**: SQLite
3030

31+
## Quick Start
32+
33+
1. Clone the repository and navigate to the project directory.
34+
2. For frontend: `cd Frontend && npm install && npx react-native run-android` (or `run-ios`).
35+
3. For backend: `cd Backend && python -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt && python app.py`.
36+
37+
For detailed setup instructions, see [Setup.md](Setup.md).
38+
3139
## Usage
3240

3341
- Open the mobile app on an emulator or device.

Setup.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,26 +119,37 @@ npx react-native run-ios
119119

120120
## Backend Setup (Offline Flask API)
121121

122-
BabyNest includes an offline backend using Flask
123-
124-
### 6) Install Python Dependencies
125-
126-
```sh
127-
cd Backend
128-
python3 -m venv .venv
129-
source .venv/bin/activate
130-
pip install -r requirements.txt
122+
BabyNest includes an offline backend using Flask with ChromaDB for vector search.
123+
124+
### Prerequisites
125+
- Python 3.12+
126+
- Virtual environment (venv)
127+
128+
### Installation
129+
1. Navigate to the Backend directory:
130+
```
131+
cd Backend
132+
```
133+
2. Create and activate a virtual environment:
134+
```
135+
python -m venv .venv
136+
source .venv/bin/activate
137+
```
138+
3. Install dependencies:
139+
```
140+
pip install -r requirements.txt
141+
```
142+
143+
### Running the Backend
144+
Start the server with:
131145
```
132-
133-
### 7) Run the Backend Locally
134-
135-
```sh
136-
cd Backend
137146
python app.py
138147
```
139148

140149
This will start the API locally.
141150

151+
The server will run on http://127.0.0.1:5000. Check `/health` for status.
152+
142153
---
143154

144155
## Handling Vector Search (ChromaDB)

0 commit comments

Comments
 (0)