Coder Social home page Coder Social logo

iot's People

Contributors

frederikkefm avatar jonasstjerne avatar

Watchers

 avatar

iot's Issues

Diskussion

  • bluetooth parring (Frederikke)
  • Udviklingsprocess lave feature gennem hele stack vs isoleret komponenter (Jonas laver mundlort)
  • Brugerinddragelse manglede det? (frederikke)
  • Sikkerhed mellem worker og hub (Vi bruger kun ID fra worker) Asger vil have vi diskuterer dette (Jonas)
  • Test, sikre sig vs. tiden, vi er kun 2, er tiden givet godt ud, ingen delivery, man kunne have haft lav coverage, nogle gange også nok at tænke hvordan man vil teste (Frederikke)

Frontend

  • Interceptors http error
  • Http kald
  • Guards
  • Redirect tilbage ved sendt til loginscreen

Hub schedule actions for worker

Efter hub er connected til backend, skal den sende en "connectedWorkers" besked over socket forbindelse.

Det skal den gøre for at backend kan opdatere relationen mellem workers og hubs og for at hub'en kan få retuneret actions for de workers den har forbindelse til.

  • Send array of workerID to backend
  • Recieve Worker's actions
  • Schedule/ decide how to handle actions

Superuser & auth

There should be a super user type.
There should be an auth guard to check for this user type and it should be applied to create and delete for hubs.

Use enum for role type with numbers and edit the normal auth to check if auth level is equal to or higher than the normal user type

Error on building frontend image

Because the frontend depends on the backend API specs for generating services it errors on image build.

Do we need the services to get generated on build? They should already be present from the development step where _api is copied from host to container
Possbile solution - remove "npm run ng-openapi-gen --input /shared/openapi-spec.json --output dist/_api &&" from package.json

Other resources for shared volume at build:
https://stackoverflow.com/questions/26050899/how-to-mount-host-volumes-into-docker-containers-in-dockerfile-during-build
https://vsupalov.com/cache-docker-build-dependencies-without-volume-mounting/

Implement CRUD for worker

Implement CRUD operations for workers. All endpoints should be authenticated and only allow users who are connected to the hub owning the workers to get the results.

Implement:

  • Endpoint to rename worker
  • Endpoint to get all actions of a worker

Inject enn variables at build time in angular

When building the docker image of the frontend. The env variables that the frontend needs, should be injected from the .env file instead of the environments folder located in the frontend

Websocket push info to hubs

When the web client adds/edits/deletes actions it should be emitted to the hub via the websocket connection.

This should be done by subscribers notifying a service on updates to the actions table. TypeORM have built in observable functionality.

On action change

  • Get socket client id of hub - if found (connected) continue
  • Emit the type of event (new action, edit, delete) and the new information

Additionally gateway handle

  • on Worker connect
  • on Worker disconnect
  • emit Worker data
  • on Batterydata

BLE connection further

Forsæt udvikling af BLE connection

Definition of done

  • Create services & Characteristics for functionality
  • Hub can send command for worker to push
  • Worker able to receive action to push and log it
  • Worker able to send back that it did push or error
  • Worker able to send battery level (with timestamp?)

Websocket dis- and connect functionality

On hub websocket connection

  • Send all actions for the hubs workers
  • Get connected workers and their state
  • Add socket id to lookup table for later use
  • Set hub status to online

On hub disconnect

  • Remove socket client id from lookup table
  • Set hub state to offline

Hub handle websocket messages

Hub should be able to sync data over WebSocket when:

  • Worker disconnects from Bluetooth
  • Worker connects over Bluetooth
  • Action added
  • Action deleted
  • Action edited
  • Battery level change

Connection hub, worker, action

  • BL Connection mellem Hub og worker
  • Hvem har ansvaret
  • Model over hub (scheduling, web socket og Bl) - scheduling og websocket er et andet afsnit
  • Teori om arduino
  • Hvad skal en action gøre

Make a lookup table for socketclient id and hub id

Make a lookup table for the connected socket ids and the respective hub id.
This should be used to emit messages directly to a specific hub.

Consider if there should be used redis or MySQL for this?

Implement CRUD for actions

All endpoints should of course be authenticated and ownership of the hub for the user should be confirmed.

Implement endpoint to:

  • Create a new action for a worker
  • Delete a action for a worker
  • Edit a action for a worker

Hub page further

  • Create new action for worker - time - duration - repeat pattern
  • See actions for worker
  • Delete actions for worker
  • Edit actions for worker

Serialization for DTO's is bricked

The incoming DTO request is not handled correctly when receiving a request on the hub/register endpoint. When the DTO object is handle by the interceptor and reach the controller it is empty. If one sets the IsNotEmtpy() on the entity, it will be handled correctly. But this should not be needed as all fields should be required by default.
In the the DTO for register PickType.

Testing would be nice:)

Nogle basale test af vores backend endpoint kunne være nice.
Derved kunne vi være sikre på at når vi adder nye features breaker vores gamle kode ikke.

Alle endpoint skulle blandt andet testes. Og der skulle tjekkes for om auth virker og validation, serillization og for sikkerhed i forhold til kun at se/edit/selette sine egne data

UI design

Skriv afsnit om UI design. Gerne noget wireframe.
Skal skrives ved afsnittet om user flow

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.