The project provides MoWA back-end framework and front-end framework services
🌎 README.md in English
🇰🇷 README.md in Korean
-
Clone the project repository
git https://github.com/oss-inc/mowa-backend-flask
-
Python Virtual Environment Setup
conda create -n mowa-backend-flask python=3.8
-
Installing the Flask Server
pip install -r requirements.txt
-
Run
app.py
for Flask Server(Back-end)python -m flask run
-
Run
app.services.dashboard.py
for Management page (Front-end)python -m app.services.dashboard run
-
Database setting with
app/databases/db_info.json
{ "Database": { "host": "DATABASE_IP", "user": "USER_NAME", "password": "USER_PASSWORD!", "database": "DATABASE_NAME" } }
-
Server Host and Port setting in
__init__.py
if __name__ == '__main__': app.run(debug=True, host='0.0.0.0', port=8000)
You can change host IP and port number
The IP default is0.0.0.0
and the port default is8000
. -
Web page Host and Port setting in
app.services.dashboard.py
if __name__ == '__main__': server.run(debug=True, host="0.0.0.0", port=8050)
You can change host IP and port number
The IP default is0.0.0.0
and the port default is8050
. -
Database setting with mysql query
SQL Code
create table users ( id int auto_increment primary key, name varchar(255) not null, email varchar(255) not null, password varchar(255) not null, constraint email unique (email) ); create table activity ( id int not null, email varchar(255) not null, date date not null, warning_count int null, activity_count int null, fall_count int null, primary key (id, date, email), constraint activity_ibfk_1 foreign key (id) references users (id) on update cascade on delete cascade, constraint activity_ibfk_2 foreign key (email) references users (email) on update cascade on delete cascade ); create table profile ( id int not null primary key, email varchar(255) null, src varchar(255) null, constraint profile_ibfk_1 foreign key (id) references users (id) on update cascade on delete cascade, constraint profile_ibfk_2 foreign key (email) references users (email) on update cascade on delete cascade );
-
Change Request URL in
app.services.controller.callback.py
if tab == 'user-tab-1': response = requests.get("http://{ServerIP}:{ServerPort}/user/users") return response.json()
If you are going to use the dashboard, you should change to
server IP and server port
.
This project is licensed under the MIT License - see the LICENSE.md file for details