- Running React Native Frontend
npm install
npx react-native run-ios
npx react-native run-android
- Running backend
docker-compose up
docker ps
docker exec -it <CONTAINER ID> mongo -u root -p 123456
docker exec -it <CONTAINER ID> mongosh -u root -p 123456 // to access the mongoshell
- Create a admin user
POST
http://localhost:8008/user-create
{ "username" : "admin", "password": "admin"}
- Mongodb command operations
show databases;
use md-server-db;
show collections;
- MongoDB Database access
This collecton would list ALL food log records, including the old records about the patient, that has been deleted by admin.
db.foodlogs.find().pretty();
This collection would list ONLY currently active patients for study.
db.patients.find().pretty();
This collection list admin login information.
db.users.find().pretty();
- export data from mongodb
sudo docker exec -i <mongodb-containerid> mongoexport --username root --password 123456 --authenticationDatabase=admin --db md-server-db --collection foodlogs > foodlogs.csv
sudo docker exec -i 994c6241ae5a mongoexport --username root --password 123456 --authenticationDatabase=admin
--db md-server-db --collection foodlogs --fields "patientID","mealType" > foodlogs.txt
sudo docker exec -i 994c6241ae5a mongoexport --username root --password 123456 --authenticationDatabase=admin
--db md-server-db --collection foodlogs --type=csv --fields "patientID","mealType","carbs","timestamp" > foodlogs.csv
(Credit revathyramanan and Ishan Rai)
- Create a virtual environment and activate the virtual environment
virtualenv env
source env/bin/activate
- Install the dependencies
pip install -r requirements.txt
- Start the app
python app.py
- Build a container image using docker build
docker build --tag food-detection-app .
- Start the container
docker run --name food-detection-app -p 8080:8080 food-detection-app
The Swagger UI
can be accessed at http://localhost:8080