To run this (Only runnable in local if you have the .env.local file):
- git clone
- pnpm install
- pnpm run dev
- Go to localhost
- Click signup then youll be redirect through Kinde's auth, then redirected to the homepage.
- If you try to return back to localhost:3000, youll be redirected back to localhost:3000/home
Todo:
-
Anon tweeting?
-
Ensure Users can only post twice or whatever amount of days. I think user model needs a
dateOfFirstPost
-
Use Pusher
- Use Pusher to subscribe the posts and update the display
- Use Pushed to subsribe the posts and delete if needed
Maybe:
useEffect(() => {
channel.bind('post-created', function(data) {
setPosts((prevPosts) => [...prevPosts, data.post]);
});
channel.bind('post-expired', function(data) {
setPosts((prevPosts) => prevPosts.filter(post => post.id !== data.postId));
});
// Cleanup
return () => {
channel.unbind_all();
channel.unsubscribe();
};
})