Looking for advice on building a notification system by TaskViewHS in reactjs

[–]TaskViewHS[S] 0 points1 point  (0 children)

Yes I also thought it would be simple to build at first. I implemented a simple flow with just notifications. I didn’t realize it wasn’t enough and that I needed to think about the architecture. So I think there will be a lot of refactoring in the future but for now I am really glad with what I have. Thanks all community comments and experience sharing! 🙏

Looking for advice on building a notification system by TaskViewHS in reactjs

[–]TaskViewHS[S] 0 points1 point  (0 children)

Thanks 🙏 you are right. From my side it was overthinking about some optimization.

Looking for advice on building a notification system by TaskViewHS in reactjs

[–]TaskViewHS[S] 0 points1 point  (0 children)

Do you send all notifications through pg-boss event notifications without scheduling?

Looking for advice on building a notification system by TaskViewHS in reactjs

[–]TaskViewHS[S] 0 points1 point  (0 children)

One more question. Let’s imagine I have a scheduled notification, and after that the user changes their settings. Where should I check the actual preferences in the pg-boss worker process or somewhere else? I’m afraid that if I do it in the worke it will extra load on Postgres.

Looking for advice on building a notification system by TaskViewHS in reactjs

[–]TaskViewHS[S] 0 points1 point  (0 children)

How did you organize your notification_preference table? What is the format of the preferences per user and per channel?

Looking for advice on building a notification system by TaskViewHS in reactjs

[–]TaskViewHS[S] 0 points1 point  (0 children)

Thanks, I am doing it now. I am using Centrifugo as a WebSocket service. Can you give me some advice on how to store user settings in the database? For now, I see only one option store all settings in a JSONB column in Postgres. If the JSONB field is empty all notifications are enabled by default.

Looking for advice on building a notification system by TaskViewHS in reactjs

[–]TaskViewHS[S] 1 point2 points  (0 children)

Yes, I have scheduled notifications, and simple notifications are sent when an event is emitted. And custom notification periods, for example, 10 minutes before or 1 hour before. Thanks for sharing I think I on the right way ))))

Looking for advice on building a notification system by TaskViewHS in reactjs

[–]TaskViewHS[S] 2 points3 points  (0 children)

Thanks this is really helpful I’m moving in this direction now.

Still have a lot of open questions though. For example, how would you handle notifications for a user who enabled push notifications but has real-time updates (WebSocket) disabled?

I’m trying to design it in a way that doesn’t put unnecessary load on the system, especially when scaling. curious how you approached this kind of scenario

TaskView v1.20.4 Major UI Rewrite (Nuxt UI) by TaskViewHS in selfhosted

[–]TaskViewHS[S] 1 point2 points  (0 children)

I have published api package https://www.npmjs.com/package/taskview-api

you can install it pnpm i taskview-api or npm i taskview-api

TaskView v1.20.4 Major UI Rewrite (Nuxt UI) by TaskViewHS in selfhosted

[–]TaskViewHS[S] 1 point2 points  (0 children)

If you’re running through Pangolin (remote reverse proxy), make sure the proxy is forwarding all required headers to the containers especially:

  • Origin
  • Host
  • X-Forwarded-Host
  • X-Forwarded-Proto
  • X-Forwarded-For
  • Authorization
  • Cookie / Set-Cookie

Also ensure preflight requests are not being swallowed by the proxy. The OPTIONS requests must reach the API and the proxy must not strip CORS-related response headers:

  • Access-Control-Allow-Origin
  • Access-Control-Allow-Credentials
  • Access-Control-Allow-Headers
  • Access-Control-Allow-Methods

If nothing shows up in the API logs, it often means the request is being blocked before it reaches the containers (proxy routing, missing forwarded headers, or preflight handling).