GDSC-HSU / gateway

[Top 3] 2022 Solution Challenge an IoT apporch include Flutter & embedded devices, network protocol, solving/helping covid-19 situation
MIT License
23 stars 9 forks source link

[DevOps] HMW DESIGN AN ARCHITECTURE ALLOW USER SELFT-HOST OURS OPEN-SOURCE #11

Open truonghoangduy opened 2 years ago

truonghoangduy commented 2 years ago

HMW DESIGN AN ARCHITECTURE ALLOW USER SELFT-HOST OURS OPEN-SOURCE

Base on the discussion we're having ours (architecture)solution will enable user self-host ours open source architecture with an GCP

Requirements

  1. Mobile app able to find the self-host backend. (Links, QR)
  2. Backend are able to located the Mobile app wanted to connect to it.
  3. Backend provide device access key (device-id) for mobile app.
  4. (One device-id per mobile app)
  5. Open-source(web, backend) in the picture down bellow are able to be provision in their gcp account. via terraform

=> After Mobile app successful find the backend self-host, and establish with backend device access key (device-id). The mobile app(device) will belong to the backend self-hosted (organization).

Img image

DangCao1999 commented 2 years ago

Mobile app able to find the self-host backend. (Links, QR)

Sequence diagram

truonghoangduy commented 2 years ago

Mobile app able to find the self-host backend. (Links, QR)

Sequence diagram

Nice with those diagram we could solve those (correct me if i wrong)

Requirements

truonghoangduy commented 2 years ago

@DangCao1999 @Zeroska @Kaigagi Checkout this solution we're having guys, we are solving 2 dot on top, and these dot bellow still not clear

I have a write down in #12, in there it has a section say "How device claim work" I think it could be resolve those dot.

Kaigagi commented 2 years ago

I suggest using a node package called keygenerator ( here is the reference: https://www.npmjs.com/package/keygenerator ) to generate a key. Then we can check whether or not it is unique later by using some comparison.

Or we just use numbers to organize it ? - It easier to compare.

truonghoangduy commented 2 years ago

I suggest using a node package called keygenerator ( here is the reference: https://www.npmjs.com/package/keygenerator ) to generate a key. Then we can check whether or not it is unique later by using some comparison.

Or we just use numbers to organize it ? - It easier to compare.

"some comparison" you mean like we has to query the db for it right. Yes we could use that package for generate key and do comparison. Recommend this lib over your https://www.npmjs.com/package/shortid. Or we could use auto-generated id by database

DangCao1999 commented 2 years ago

Sum up

image

Device Model: Device id with uuid generate default by firestore. Access key generate by package https://www.npmjs.com/package/shortid.

truonghoangduy commented 2 years ago

Sum up

Device Model:

Device id with uuid generate default by firestore.

Access key generate by package https://www.npmjs.com/package/shortid.

Okiee @Kaigagi you take note and add those library in package log and make those to our backend dependency.