Skip to content

Aziily/BS_design_2023_autumn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZJU B/S Design 2023 autumn

Summary

This is the project for the assignment of ZJU BS Design in 2023 autumn-winter term

Quick Start

Docker

# 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

Local

  1. Run env.sh to prepare environment for all service

  2. Different serivce

    1. Backend: this is the backend for console

      cd backend
      . .venv/bin/activate
      .venv/bin/python app.py
    2. Frontend: this is the frontend for console

      cd frontend
      npm run dev
    3. 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
  3. By default, backend is running on :5000, frontend is running on :9528, server is depending on broker.emqx.io:1883

  4. Use localhost:9528 to see the panel

Organization

  • assets - assets for the project
  • backend - backend code for console, using python with frame flask
  • frontend- frontend code for console, using vue2 with frame vue-element-admin
  • server - server code for mqtt, using python

Inference

P.S.

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.

About

The project of ZJU BS design in autumn 2023

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published