This is the project for the assignment of ZJU BS Design in 2023 autumn-winter term
# pull the image
docker pull azily/bs_design
# run one container
docker run -dit -p 15000:5000 -p 19528:9528 --name BS azily/bs_design:latest /bin/sh /start.sh
After waiting for about 15s for the container initializtion, then the server can be used on localhost:19528
.
Also, the API documentary will on
localhost:15000/apidocs
P.S.: remember to use ports are not in usage
-
Run
env.sh
to prepare environment for all service -
Different serivce
-
Backend: this is the backend for console
cd backend . .venv/bin/activate .venv/bin/python app.py
-
Frontend: this is the frontend for console
cd frontend npm run dev
-
Server: this is the mqtt server
cd server . .venv/bin/activate .venv/bin/python server.py # if need mock, run below .venv/bin/python mock/sensor.py .venv/bin/python mock/actuator.py
-
-
By default, backend is running on
:5000
, frontend is running on:9528
, server is depending onbroker.emqx.io:1883
-
Use
localhost:9528
to see the panel
assets
- assets for the projectbackend
- backend code for console, usingpython
with frameflask
frontend
- frontend code for console, usingvue2
with framevue-element-admin
server
- server code for mqtt, usingpython
- Frontend
- Backend
- Server
Th backend api doc can be seen in localhost:5000/apidocs
The init data script is in backend/database/__init__.py
, if you do not want to use the init data, comment them. Remember there need at least a admiin user, or you may not use all function.