jonasstjerne / iot Goto Github PK
View Code? Open in Web Editor NEWFull Stack Solution for making everyday appliances smart
Full Stack Solution for making everyday appliances smart
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.
Implement a auth service for the websocket connection, to identify and only allow hubs to connect to the socket connection
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
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 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:
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
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
Additionally gateway handle
Forsæt udvikling af BLE connection
Definition of done
On hub websocket connection
On hub disconnect
Hub should be able to sync data over WebSocket when:
Create a global spinner to show that content is loading
Example https://danielk.tech/home/angular-how-to-add-a-loading-spinner
Skriv et afsnit om vores hubs CRUD endpoint. Giv eksempler på hvordan vi sikre at user kan ændre data for hub den er relateret til og hvordan vi ændre databasen gennem services.
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?
All endpoints should of course be authenticated and ownership of the hub for the user should be confirmed.
Implement endpoint to:
Skriv afsnit om auth. Beskriv følgende:
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.
The hub page should contain the workers for that hub.
Get the hub information from GET /hub/{id}
endpoint
Build using components
https://docs.nestjs.com/recipes/router-module
Så workers fx. vil ligge under endpoint root/hub:id/worker/:id
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
ER diagram skal laves med alle de rigtige kolonner fra entities
Skriv afsnit om UI design. Gerne noget wireframe.
Skal skrives ved afsnittet om user flow
When installing new dependencies, it has to be done in the container but also host to get type-safety. This creates problems when having different versions of npm. A better way would have the container mirror the node_modules to the host.
Check 2. answer at: https://stackoverflow.com/questions/51097652/install-node-modules-inside-docker-container-and-synchronize-them-with-host
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.