elastos / Elastos.Community

Elastos Community Hub and Links
https://www.elastos.org
26 stars 20 forks source link

Change to a facet based social-media structure #242

Open chillalittle opened 5 years ago

chillalittle commented 5 years ago

Dear together,

coming from a big data marketing (golden-record thinking) dev background i propose to use relations instead of the current social media attributes of the Profile. What i mean by that is removing the attributes for each possible social-media type from the Profile (https://github.com/elastos/Elastos.Community/blob/master/ElastosBountyProgram/back-end/src/db/schema/UserSchema.ts) and replacing it by a relation to a SocialMedia entry in an own Social Media Schema.

This has the benefit, that it can steadily grow with new Social-Media types. So the new Schema could be

export const SocialMediaTypes = { name: String "This can be twitter, wechat, facebook. Better would by };

export const SocialMediaProfile = { cr_profile: Profile, social_media_type: SocialMediaTypes, social_media_id: String "This would be the corresponding account on that type };

such a design can grow with future upcoming demands without adjusting the UserSchema in future. Also this could be represented in the CR Profile UI by just showing the filled out SocialMedia Profiles and having a (+) icon to add a new SocialMediaProfile entry to the UserProfile, where the proposals then come from the SocialMediaTypes. With such an architecture also 1:n can be implemented. e.g. if i have two or three twitter accounts (one for business and one for private)

What do you think of that ?

Best regards, chillalittle

ClarenceL commented 5 years ago

Yes, will definitely do this in the near future