gateway icon indicating copy to clipboard operation
gateway copied to clipboard

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

Open truonghoangduy opened this issue 4 years ago • 7 comments

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

truonghoangduy avatar Feb 12 '22 14:02 truonghoangduy

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

Sequence diagram

DangCao1999 avatar Feb 13 '22 10:02 DangCao1999

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

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

truonghoangduy avatar Feb 13 '22 11:02 truonghoangduy

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

  • [x] Backend provide device access key (device-id) for mobile app.
  • [x] (One device-id per mobile app)

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.

truonghoangduy avatar Feb 16 '22 11:02 truonghoangduy

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.

Kaigagi avatar Feb 16 '22 12:02 Kaigagi

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

truonghoangduy avatar Feb 16 '22 13:02 truonghoangduy

Sum up

image

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

DangCao1999 avatar Feb 19 '22 02:02 DangCao1999

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.

truonghoangduy avatar Feb 19 '22 02:02 truonghoangduy