- Ensure .env's information is correct from bootstrap for db connection. Follow instructions under "Authentication Service Set Up" to get
ACCESS_TOKEN_SECRET
- Run
./script/bootstrap
. - Make sure you have a MySQL username and password, and make sure the MySQL server is running.
- Ensure a database/config/dev.json file is created with the correct information to connect to your local db. This file is used to run db migrations.
- ONLY IF NOT CREATED PROPERLY: Follow instructions under "Migrations" to set up properly. And then run
db-migrate up --config ./database/config/dev.json
- ONLY IF NOT CREATED PROPERLY: Follow instructions under "Migrations" to set up properly. And then run
- Start the mysql server
mysql start
- Run
npm start
- can be accessed through: http://3.142.235.3/phpmyadmin/index.php
- contact someone on the team to get the proper credentials to access prod db
- if developing in dev, use your own local database so we don't make changes we don't want to on prod
- if you want to connect to the prod database go into your .env and change host to the prod host and the user to the correct user instead which would be: 3.142.235.3
- if not working then you might need to add this line in .env and database/config/dev.json:
"socketPath": "/var/run/mysqld/mysqld.sock"
- Make sure to run new migrations if pulling new code that has any db changes.
- Create a database/config/dev.json file and paste the following:
{
"dev": {
"host": "",
"user": "",
"password": "",
"database": "",
"driver": "mysql",
"multipleStatements": true
}, "sql-file": true
}
- Fill out the necessary information
db-migrate create SQL_ACTION_NAME --config ./database/config/dev.json
to create migration files, this will create a .js file and two .sql files with the date and SQL_ACTION_NAME. The .sql file with the name 'up' should contain the migration that you want to run and the 'down' should contain the reverse to undo the migrations ran. The .js file is the logic that runs everything, this does not need to be changed usually.db-migrate up --config ./database/config/dev.json
to run all migrations in orderdb-migrate down --config./database/config/dev.json
to drop all migrationsmysql -u root -p
to log into mysql
- Download the file
resnet-34_kinetics.onnx
from our Google Drive(https://drive.google.com/drive/folders/14O32x--6oFAjRydepzN3o3ghKVzk1EkU) as GitHub has a file size limit - Place
resnet-34_kinetics.onnx
in the foldercvservice
- Go into the folder
cvservice
by runningcd cvservice
- Run
python3 ./human_activity_reco.py
- You'll likely have to show the webcam a picture of a child crying on your phone for it to detect and trigger a notification
- Use karen.smith@gmail.com with the password "pw" to login to a generic account.
For authentication, we use jwt to create an access token. For dev purposes, each dev will need to set up their own ACCESS_TOKEN_SECRET in their .env file. To do so:
- run
node
- run
require("crypto").randomBytes(64).toString("hex")
- paste the results in .env file under ACCESS_TOKEN_SECRET Note that each dev's token will be different since it's random. To debug, you can use jwt's website to do so.
- If any issues with connection to your database try adding:
"socketPath": "/var/run/mysqld/mysqld.sock"
under dev.json
To start or stop the server from running:
sudo systemctl start YourAppName.service
to start the serversudo systemctl stop YourAppName.service
to stop the server
-
Use karen.smith@gmail.com with the password "pw" to login to a generic account.
-
For demo purposes, clicking on the returning user "Karen" will automatically log in without needing to input password.