Betarena / scores

We are building the first open-source live results and statistics platform with community involvement features for data insertion. The project includes a blockchain component that will allow participants to receive rewards based on their participation and also to stake the future Token of the platform.
GNU General Public License v3.0
18 stars 5 forks source link

[FEATURE]: Crisp chat user registration / login integration #1670

Closed jonsnowpt closed 12 months ago

jonsnowpt commented 1 year ago

Does a duplicate issue exist?

πŸ€” Is feature request related to a problem? Please describe the problem.

No response

πŸ“ Feature Request Description

Since we must contact users to welcome them to the platform and inform them about essential features, we must integrate Crisp chat to gather the most relevant user data.

DATA TO BE ADDED TO CRIP USERS:

The data is added on registration and updated in every login.

βž• Further context and resources (cumulative)

We need to add the number of competition participations into the Firestore user profile:

[
  "lang",
  "profile_photo",
  "register_date",
  "competitions",
  "registration_type",
  0,
  "username"
]

This data can be gathered from the Hasura db:

competitions/data

How to add users and integrate custom data:

https://help.crisp.chat/en/article/how-can-i-automatically-set-custom-data-1xh7pqk/

https://docs.crisp.chat/references/rest-api/v1/#add-a-people-event

[22/09/2023]

Upon testing, it was noticed that the initial data for endpoint .../website/:website_id/people/events/:people_id does not update the correct segment of custom data as expected. Instead, the use of the .../v1/website/{website_id}/people/data/{people_id} and/or .../v1/website/:website_id/people/data/:people_id endpoints.

Important Before being able to update data for a target user on CRIPS, it must be first created, it if does not exist, and relate it to a target Betarena Firebase (Firestore) UID. Otherwise, error of "reason": "people_not_found", will be returned.

migbash commented 12 months ago

Note Created offspring task ➀ #6. Created offspring task ➀ #245.

migbash commented 12 months ago

Note Already addressed as part of issue ➀ #6 . Implemented, awaiting πŸš€ deployment.

migbash commented 12 months ago

Note Testing on DEV was a success, with _my_ account having the data on Firestore and CRISP updated correctly, as an increment was visible from competitions_number: 10 to 11 and so did CRISP Associated Profile data.

migbash commented 12 months ago

Important Currently, due to the nature of the data from competitions using nested JSON data for participants, all data for all competitions are retrieved, analysed, and updated for each participant present in a competition. This is because it's quicker and simpler to search by simply retrieving all competitions data, rather than query by JSON as a nested format.

Because of this, upon each user login, each competition participant will have their competition_number updated on Firestore, but not on CRISP. As the CRISP is limited to the supplied uid's. So if a user logs in, it will only update their CRISP Profile data.

jonsnowpt commented 12 months ago

@migbash Update on last active

migbash commented 12 months ago

Note Re-opened offspring task ➀ #6. Re-opened offspring task ➀ #245.

Applied data overhead reduction as part of sub-task, as well as, addition of user last active state, triggered both user presence on frontend.

Note Implemented, awaiting πŸš€ deployment.

Note Live on dev from v852.