Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifications regarding content popularity (eg. you have x upvotes/comment on your post) #87

Open
2 of 3 tasks
Tracked by #78
gao-ti opened this issue Oct 3, 2022 · 4 comments
Open
2 of 3 tasks
Tracked by #78
Assignees

Comments

@gao-ti
Copy link
Contributor

gao-ti commented Oct 3, 2022

  • 1. Frontend: need a button, two states (you have notification/ you have no notification)
  • 2. (optional) Drop down after clicking, and a button view all
  • 3. Backend: new table, Server-sent events
@gao-ti
Copy link
Contributor Author

gao-ti commented Oct 6, 2022

my suggestion for db table

model Notification {
    id          Int     @id
    userId      String  // who are we notifying
    user        User    @relation(fields: [userId], references: [id], onDelete: Cascade)
    content     String  // you have a new like from user <name>
    status      Int     @default(0) // 1: checked, 0: unchecked
    lastUpdated  DateTime   @updatedAt
}

we can optimize in the future

Once a user is logged in, there should be a background process to update whether there are new notifications every 1 minute

@gao-ti gao-ti assigned gao-ti and unassigned davidfortuoso-ti Oct 7, 2022
@gao-ti
Copy link
Contributor Author

gao-ti commented Oct 7, 2022

For backend, we plan to use server sent events to push to the frontend
vercel/next.js#9965

@arsen-ti
Copy link
Contributor

arsen-ti commented Oct 7, 2022

Front end for notification is done. The PR is merged into master -> #107

@gao-ti
Copy link
Contributor Author

gao-ti commented Oct 8, 2022

#115

PR raised

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants