+ {/* ACTIVITY */}
+
+
-
- Recent activity
-
-
Whatβs happening
+
Activity
+
+ Recent Updates
+
-
- Live updates
-
+
-
- {activity.map((item) => (
-
- {item}
+ {/* Timeline style */}
+
+ {activity.map((item, i) => (
+
+
+
+
{item.text}
+
{item.time}
+
))}
-
+
- Open team chat
+ Go to chat
+
+
+
+
+ {/* EXTRA SECTION (NEW) */}
+
+
+
+
+ Boost your team productivity π
+
+
+ Plan better sprints and collaborate smarter with your team.
+
+
+
+
+ Start Planning
);
-}
+}
\ No newline at end of file
From 9a3e00dc7939bd96e616250deaa6edce675b5091 Mon Sep 17 00:00:00 2001
From: Dipanita45 <132455672+Dipanita45@users.noreply.github.com>
Date: Sun, 3 May 2026 11:07:27 +0530
Subject: [PATCH 2/3] Updated
---
.../controllers/notification.controller.js | 21 ++++++++++++++++
backend/models/notification.model.js | 16 +++++++++++++
backend/routes/notification.routes.js | 7 ++++++
backend/services/socket.js | 23 ++++++++++++++++++
.../app/components/NotificationListener.tsx | 17 +++++++++++++
frontend/app/components/NotificationPanel.tsx | 24 +++++++++++++++++++
frontend/src/api/notification.ts | 7 ++++++
frontend/src/context/SocketContext.tsx | 19 +++++++++++++++
8 files changed, 134 insertions(+)
create mode 100644 backend/controllers/notification.controller.js
create mode 100644 backend/models/notification.model.js
create mode 100644 backend/routes/notification.routes.js
create mode 100644 backend/services/socket.js
create mode 100644 frontend/app/components/NotificationListener.tsx
create mode 100644 frontend/app/components/NotificationPanel.tsx
create mode 100644 frontend/src/api/notification.ts
create mode 100644 frontend/src/context/SocketContext.tsx
diff --git a/backend/controllers/notification.controller.js b/backend/controllers/notification.controller.js
new file mode 100644
index 0000000..a778174
--- /dev/null
+++ b/backend/controllers/notification.controller.js
@@ -0,0 +1,21 @@
+const Notification = require("../models/notification.model");
+
+exports.getNotifications = async (req, res) => {
+ try {
+ const { userId } = req.params;
+ const notifications = await Notification.find({ userId }).sort({ createdAt: -1 });
+ res.json(notifications);
+ } catch (err) {
+ res.status(500).json({ error: err.message });
+ }
+};
+
+exports.markAsRead = async (req, res) => {
+ try {
+ const { id } = req.params;
+ await Notification.findByIdAndUpdate(id, { isRead: true });
+ res.json({ success: true });
+ } catch (err) {
+ res.status(500).json({ error: err.message });
+ }
+};
\ No newline at end of file
diff --git a/backend/models/notification.model.js b/backend/models/notification.model.js
new file mode 100644
index 0000000..05d55c0
--- /dev/null
+++ b/backend/models/notification.model.js
@@ -0,0 +1,16 @@
+const mongoose = require("mongoose");
+
+const notificationSchema = new mongoose.Schema(
+ {
+ userId: { type: String, required: true },
+ type: {
+ type: String,
+ enum: ["message", "like", "comment", "request", "system"],
+ },
+ content: String,
+ isRead: { type: Boolean, default: false },
+ },
+ { timestamps: true }
+);
+
+module.exports = mongoose.model("Notification", notificationSchema);
\ No newline at end of file
diff --git a/backend/routes/notification.routes.js b/backend/routes/notification.routes.js
new file mode 100644
index 0000000..f55fde6
--- /dev/null
+++ b/backend/routes/notification.routes.js
@@ -0,0 +1,7 @@
+const router = require("express").Router();
+const controller = require("../controllers/notification.controller");
+
+router.get("/:userId", controller.getNotifications);
+router.patch("/:id/read", controller.markAsRead);
+
+module.exports = router;
\ No newline at end of file
diff --git a/backend/services/socket.js b/backend/services/socket.js
new file mode 100644
index 0000000..254980a
--- /dev/null
+++ b/backend/services/socket.js
@@ -0,0 +1,23 @@
+const { Server } = require("socket.io");
+
+let io;
+
+const initSocket = (server) => {
+ io = new Server(server, {
+ cors: { origin: "*" },
+ });
+
+ io.on("connection", (socket) => {
+ console.log("User connected:", socket.id);
+
+ socket.on("join", (userId) => {
+ socket.join(userId);
+ });
+ });
+};
+
+const sendNotification = (userId, notification) => {
+ io.to(userId).emit("new_notification", notification);
+};
+
+module.exports = { initSocket, sendNotification };
\ No newline at end of file
diff --git a/frontend/app/components/NotificationListener.tsx b/frontend/app/components/NotificationListener.tsx
new file mode 100644
index 0000000..10b6bc7
--- /dev/null
+++ b/frontend/app/components/NotificationListener.tsx
@@ -0,0 +1,17 @@
+import { useEffect, useContext } from "react";
+import toast from "react-hot-toast";
+import { SocketContext } from "../context/SocketContext";
+
+export default function NotificationListener() {
+ const socket = useContext(SocketContext);
+
+ useEffect(() => {
+ socket.on("new_notification", (data: any) => {
+ toast.success(data.content);
+ });
+
+ return () => socket.off("new_notification");
+ }, []);
+
+ return null;
+}
\ No newline at end of file
diff --git a/frontend/app/components/NotificationPanel.tsx b/frontend/app/components/NotificationPanel.tsx
new file mode 100644
index 0000000..2a08370
--- /dev/null
+++ b/frontend/app/components/NotificationPanel.tsx
@@ -0,0 +1,24 @@
+import { markAsRead } from "../api/notification";
+
+export default function NotificationPanel({ notifications, refresh }: any) {
+ const handleRead = async (id: string) => {
+ await markAsRead(id);
+ refresh();
+ };
+
+ return (
+
+ {notifications.map((n: any) => (
+
handleRead(n._id)}
+ >
+ {n.content}
+
+ ))}
+
+ );
+}
\ No newline at end of file
diff --git a/frontend/src/api/notification.ts b/frontend/src/api/notification.ts
new file mode 100644
index 0000000..a41bd4e
--- /dev/null
+++ b/frontend/src/api/notification.ts
@@ -0,0 +1,7 @@
+import axios from "axios";
+
+export const getNotifications = (userId: string) =>
+ axios.get(`/api/notifications/${userId}`);
+
+export const markAsRead = (id: string) =>
+ axios.patch(`/api/notifications/${id}/read`);
\ No newline at end of file
diff --git a/frontend/src/context/SocketContext.tsx b/frontend/src/context/SocketContext.tsx
new file mode 100644
index 0000000..618791e
--- /dev/null
+++ b/frontend/src/context/SocketContext.tsx
@@ -0,0 +1,19 @@
+import { createContext, useEffect } from "react";
+import { io } from "socket.io-client";
+
+const socket = io("http://localhost:5000");
+
+export const SocketContext = createContext(socket);
+
+export const SocketProvider = ({ children }: any) => {
+ useEffect(() => {
+ const userId = localStorage.getItem("userId");
+ if (userId) socket.emit("join", userId);
+ }, []);
+
+ return (
+
+ {children}
+
+ );
+};
\ No newline at end of file
From bace6412b636161c0c44c2af3ae748ef37d60512 Mon Sep 17 00:00:00 2001
From: Dipanita45 <132455672+Dipanita45@users.noreply.github.com>
Date: Tue, 5 May 2026 20:36:20 +0530
Subject: [PATCH 3/3] Updated
---
frontend/app/chat/page.tsx | 297 ++++++++++++++++++
.../app/components/NotificationListener.tsx | 17 -
frontend/app/components/NotificationPanel.tsx | 24 --
frontend/src/api/notification.ts | 7 -
frontend/src/context/SocketContext.tsx | 19 --
5 files changed, 297 insertions(+), 67 deletions(-)
delete mode 100644 frontend/app/components/NotificationListener.tsx
delete mode 100644 frontend/app/components/NotificationPanel.tsx
delete mode 100644 frontend/src/api/notification.ts
delete mode 100644 frontend/src/context/SocketContext.tsx
diff --git a/frontend/app/chat/page.tsx b/frontend/app/chat/page.tsx
index 6921153..35bbb5e 100644
--- a/frontend/app/chat/page.tsx
+++ b/frontend/app/chat/page.tsx
@@ -263,4 +263,301 @@ socket.on("newMessage", (msg) => {