Skip to content

Commit bf5a2fd

Browse files
authored
Merge branch 'main' into update
2 parents ec7b6f5 + ced6baf commit bf5a2fd

36 files changed

Lines changed: 13204 additions & 93 deletions

client/src/App.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { AuthProvider, useAuth } from "./context/AuthContext";
55
import ProtectedRoutes from "./routes/ProtectedRoutes";
66
import PublicRoutes from "./routes/PublicRoutes";
77
import ThemeApplier from "./theme/ThemeApplier";
8-
import Mainpage from "./pages/Mainpage";
98

109
function AppRoutes() {
1110
const { user } = useAuth();

client/src/components/Navbar.jsx

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -86,58 +86,14 @@ function Navbar({ showBack }) {
8686
.then((d) => Array.isArray(d) && setNotifs(d));
8787

8888
const socket = getSocket(user.id);
89-
socket.on("new-course", (notif) => {
90-
setNotifs((prev) => [
91-
{
92-
id: notif.id || Date.now(),
93-
message: notif.message,
94-
createdAt: notif.createdAt,
95-
read: false,
96-
},
97-
...prev,
98-
]);
99-
});
100-
socket.on("live-class-scheduled", (data) => {
101-
setNotifs((prev) => [
102-
{
103-
id: `lc_${Date.now()}`,
104-
message: `📹 Live class scheduled: "${data.title}"`,
105-
createdAt: new Date().toISOString(),
106-
read: false,
107-
},
108-
...prev,
109-
]);
110-
});
111-
socket.on("live-class-status", (data) => {
112-
if (data.status === "live") {
113-
setNotifs((prev) => [
114-
{
115-
id: `lcs_${Date.now()}`,
116-
message: `🔴 A live class just started!`,
117-
createdAt: new Date().toISOString(),
118-
read: false,
119-
},
120-
...prev,
121-
]);
122-
}
123-
});
124-
socket.on("student-enrolled", (data) => {
125-
setNotifs((prev) => [
126-
{
127-
id: `enroll_${Date.now()}`,
128-
message: data.message || "A student enrolled in your course",
129-
createdAt: new Date().toISOString(),
130-
read: false,
131-
},
132-
...prev,
133-
]);
89+
90+
// Single unified listener — backend persists to DB before emitting
91+
socket.on("notification:new", (notif) => {
92+
setNotifs((prev) => [{ ...notif, read: false }, ...prev]);
13493
});
13594

13695
return () => {
137-
socket.off("new-course");
138-
socket.off("live-class-scheduled");
139-
socket.off("live-class-status");
140-
socket.off("student-enrolled");
96+
socket.off("notification:new");
14197
};
14298
}, [user?.id, isAuthenticated]);
14399

client/src/pages/About.jsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useContext } from "react";
2+
import { Link } from "react-router-dom";
23
import { ThemeContext } from "../context/ThemeContext";
34
import Navbar from "../components/Navbar";
45
import Footer from "../components/Footer";
@@ -107,6 +108,25 @@ function About() {
107108
</div>
108109
</div>
109110

111+
{/* Tech Architecture CTA */}
112+
<div className="rounded-2xl border border-[var(--border)]/40 bg-[var(--card)] p-8 mb-12 flex flex-col sm:flex-row items-center justify-between gap-6">
113+
<div>
114+
<h2 className="text-xl font-bold text-[var(--text)] mb-1">
115+
How it's built
116+
</h2>
117+
<p className="text-sm text-[var(--muted)]">
118+
Explore the full backend architecture — Express 5, MongoDB,
119+
Socket.IO, Claude AI, and Cloudinary — layer by layer.
120+
</p>
121+
</div>
122+
<Link
123+
to="/about/architecture"
124+
className="shrink-0 px-6 py-3 rounded-xl font-semibold text-sm bg-[var(--accent)] text-white hover:opacity-90 transition-opacity"
125+
>
126+
View Tech Architecture →
127+
</Link>
128+
</div>
129+
110130
{/* Values */}
111131
<h2 className="text-2xl font-bold text-[var(--text)] mb-6 text-center">
112132
What we stand for

0 commit comments

Comments
 (0)