GithubHelp home page GithubHelp logo

bs_design_2023_autumn's Introduction

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.

bs_design_2023_autumn's People

Contributors

aziily avatar

Stargazers

chkhu avatar  avatar Katie avatar OldVan avatar hpsk avatar Jiaxing Liu avatar

Watchers

 avatar

Forkers

trumpool

bs_design_2023_autumn's Issues

About creating the database and the tables

Is there a separate file like create.sql in this project? Or the job is done by backend/database/models.py? If so, how?

When I was trying to replicate this project on my local machine, I stumbled through running backend and frontend as instructed. When it comes to the mqtt server, it gave errors like

pymysql.err.OperationalError: (1049, "Unknown database 'bs_iot_db'")

(bs_iot_db is the name i chose for the database, I have edited it accordingly in two config.yaml files)

I suppose it's because the database and the tables have not been created as expected (so, obviously the backend and frontend weren't functioning properly either).

I wonder which part of this project is responsible for creating the database, so that I can work on it from that point.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.