0% found this document useful (0 votes)
22 views5 pages

User Auth - Dashboard and Notification-4

The document outlines the workflows for user authentication, profile management, and an admin dashboard, detailing processes such as sign-up, password recovery, and user activity tracking. It also describes a notification system that includes real-time alerts, email notifications, and in-app updates, with a focus on user engagement and cashback management. Additionally, it specifies the tech stack for implementation, including NestJS, MongoDB, and Firebase Cloud Messaging.

Uploaded by

falcogaming2022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views5 pages

User Auth - Dashboard and Notification-4

The document outlines the workflows for user authentication, profile management, and an admin dashboard, detailing processes such as sign-up, password recovery, and user activity tracking. It also describes a notification system that includes real-time alerts, email notifications, and in-app updates, with a focus on user engagement and cashback management. Additionally, it specifies the tech stack for implementation, including NestJS, MongoDB, and Firebase Cloud Messaging.

Uploaded by

falcogaming2022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

OAuth for social logins (Facebook, Google, Instagram, etc.).

Authentication Workflow

1. Sign Up/Sign In:

Options: Email/Password, Mobile, Social Logins (OAuth).

Validations: Ensure unique email/mobile.

Backend verifies credentials and generates JWT tokens.

2. Forgot Password:

User enters email/mobile.

Backend generates a password reset token.

Link sent via email/SMS for resetting the password.

3. Token Management:

JWT tokens issued on login.

Refresh tokens for maintaining sessions.

Logout invalidates the active token.

User Profile Management Workflow

1. Edit Profile:

Users can update details: Name, Country, Profile Pic, Bio, Mobile, etc.

Validations to ensure data integrity.

Data saved in the database.

2. Activity Management:

Tracks user activities (e.g., adding favorite products).

Data retrieved from the activity logs stored in MongoDB.

3. Lists:

Users create lists and add products.

Options to share via WhatsApp, Facebook, or Email.

Data saved in Lists collection in MongoDB.

4. Earnings:

Calculates cashback (earned, pending, rejected).

Data filtered by store, month, or year.

Users can raise tickets for missing cashback.


5. Notifications:

Users set alerts for price changes.

Backend pushes notifications (email/SMS/real-time).

Admin Dashboard Workflow

1. User Management:

View/Edit/Delete user profiles.

Monitor activities like reviews, comments, or earnings.

2. Content Moderation:

Moderate reviews, comments, and replies.

Approve or reject content flagged by users.

Add / Upload / Update / Delete Product data via API / CSV / Scrapper

3. Earnings Overview:

Verify and process pending cashback.

Resolve disputes related to rejected cashback.

4. Reporting:

Generate and see Graphical / Tabular / Stastical reports on user activities, earnings (Received, Pending
and Paid to user and reports of our earning also from Flipkart, Amazon and other sites), and referral
performance, clickthrough (store and date wise where traffic goes maximum and where minimum).

5. Store Performance

Detailed report of Listed stores on our platform.

More will add as the development process goes on.

Logs for admin actions.

Diagram Overview

(1) Authentication Flow

User → Frontend (Next.js) → Backend (NestJS) → MongoDB (User Collection)

(2) User Profile Management Flow

User → Frontend (Next.js) → Backend (NestJS) → MongoDB (User, Lists, Activity Collections)

(3) Notification Flow

Event Trigger (e.g., Price Change) → Backend → Notification Service (Email/SMS) → User
Notification Types
Price Alerts: Notify users of price drops on products they track.

Referral Notifications: Updates about cashback earnings or successful referrals.

Promotional Alerts: Deals, discounts, or new features.

Activity Updates: Comments, replies, or interactions with saved lists.

Cashback Updates: Pending, approved, or rejected cashback status.

System Notifications: Password changes, profile updates, or login from a new device.

Design the Notification System


1. Backend Storage and Model:

Use a database to store notifications. A typical notification table may include:

Notification ID

User ID (recipient)

Type (price alert, cashback, etc.)

Content (message details)

Status (read/unread)

Timestamp

Link to the relevant page (if applicable)

2. Real-Time or Scheduled Delivery:

Use WebSockets for real-time notifications (e.g., "Price dropped by 10%").

Use cron jobs for scheduled notifications (e.g., "Daily cashback summary").

3. Frontend UI/UX:

Design a notification icon (bell) on various places on website.

Include a dropdown showing recent notifications.

Allow a "View All Notifications" page with filters (e.g., unread, date range, type).

3. Set Up Notification Delivery

1. Push Notifications:

Use Firebase Cloud Messaging (FCM) or similar for push notifications to mobile/web.

Users must opt-in for browser/mobile notifications.


2. Email Notifications:

Send important updates via email using services like SendGrid or Postmark.

3. In-App Notifications:

Display alerts within the app using a notification bell or a popup.

4. SMS Notifications (Optional):

For critical alerts like "Your cashback request was processed."

4. Backend Implementation

1. Create APIs for Notifications:

A POST API to create notifications.

A GET API to fetch notifications for a user.

A PATCH API to mark notifications as read.

2. Set Up Event Triggers:

Use event-driven architecture (e.g., RabbitMQ, Kafka, or hooks) to trigger notifications automatically
based on specific actions (e.g., price drop or referral signup).

3. Notification Scheduler:

For recurring or periodic updates, set up a scheduler with cron jobs.

5. Frontend Integration

1. Notification Dropdown:

Fetch notifications from the backend API.

Show the unread count on the notification icon.

Display recent notifications in a dropdown with "Mark All as Read" functionality.

2. Real-Time Updates:

Use WebSockets to push new notifications to users instantly.

3. Notification Settings Page:

Allow users to customize which notifications they want to receive (e.g., enable/disable email or push
alerts).

6. Testing and Deployment

1. Test Notification Delivery:

Simulate different events (price drops, referrals, etc.) to verify notification flow.

2. Monitor for Performance Issues:


Ensure the notification system doesn't slow down the platform.

3. Deploy and Iterate:

Collect user feedback and optimize the system over time.

Tech Stack for Notifications

1. Backend:

Nest and Fastify (Typescript).

Database: MongoDB (with indexes for fast retrieval).

2. Push Notifications:

Firebase Cloud Messaging (FCM) or One Signal.

3. Email Service:

SendGrid, Postmark, or Amazon SES.

4. Real-Time:

WebSocket libraries.

You might also like