code100x / cms

https://app.100xdevs.com/
665 stars 869 forks source link

feature: Certificate for users in 0-1 #483

Closed hkirat closed 2 months ago

hkirat commented 3 months ago

We want to allow users to be able to create publically available certs They should also be allowed to put it on twitter/linkedin

hkirat commented 3 months ago

Needs to have an id as well that employers can verify with

dhruvilmehta commented 3 months ago

It should be downloadable as a PNG file? or a pdf file? Also, what should be the template of the certificate?

hkirat commented 3 months ago

pdf, can use some standard design like courseras

VaibhavArora314 commented 3 months ago

hey @hkirat , I am thinking of adding a Certification model and we can use id of Certification model for verification purposes of any certificate

model User {
 // existing fields

  certifications Certification[]
}

model Certification {
  id                String    @id @default(cuid())
  user              User      @relation(fields: [userId], references: [id])
  userId            String
  course            Course    @relation(fields: [courseId], references: [id])
  courseId          Int
  certificationDate DateTime

  @@unique([userId, courseId])
}

Also do you want to generate the certificates once the course has been completed or purchased? As upon inspection I don't see any way of tracking user progress of the course.

In case we want to generate this once course has been completed, then we can modify schema as below and automatically generate a certification once user purchases and make it accessible to the user once course has been completed on the course page.

model User {
 // existing fields

  certifications Certification[] // to store all certificates in one place
}

model Course {
 // existing fields

  completed Boolean         @default(false)
}

model Certification {
  id                String    @id @default(cuid())
  user              User      @relation(fields: [userId], references: [id])
  userId            String
  course            Course    @relation(fields: [courseId], references: [id])
  courseId          Int
  certificationDate DateTime

  @@unique([userId, courseId])
}
dhruvilmehta commented 3 months ago

I am not getting a way to share the certificate image on Twitter and LinkedIn directly. I think we can only share links and not images. Images can only be uploaded by the user manually. Do you know any other way to do so? I tried these two ways: For twitter: https://twitter.com/intent/tweet For LinkedIn: https://www.linkedin.com/sharing/share-offsite/?url={url}

If direct sharing is not possible, we can give the users the option to download both PDF and PNG files since PDF sharing is also not possible on LinkedIn/Twitter. Users can download PNG files and post on LinkedIn/Twitter.

SujithThirumalaisamy commented 2 months ago

Can you add some more video like reference. To see how things work?

SujithThirumalaisamy commented 2 months ago

I am not getting a way to share the certificate image on Twitter and LinkedIn directly. I think we can only share links and not images. Images can only be uploaded by the user manually. Do you know any other way to do so? I tried these two ways: For twitter: https://twitter.com/intent/tweet For LinkedIn: https://www.linkedin.com/sharing/share-offsite/?url={url}

If direct sharing is not possible, we can give the users the option to download both PDF and PNG files since PDF sharing is also not possible on LinkedIn/Twitter. Users can download PNG files and post on LinkedIn/Twitter.

I think that should be possible. I remember sharing some W3 certs comewhere in linkedin and also shared some coursera certs it twitter. I think most probabbly we can get both the things done.

dhruvilmehta commented 2 months ago

This is how it is currently working. LinkedIn sharing is not working. The download is working fine both for PDF and PNG. https://github.com/code100x/cms/assets/68022411/429026b3-d35f-43b4-bb2b-7e066b15f9ba