├── src ├── app │ ├── teams │ │ ├── page_new.tsx │ │ ├── utils │ │ │ ├── timeExample.ts │ │ │ └── timeUtils.ts │ │ ├── components │ │ │ ├── VipFilters.tsx │ │ │ ├── VipFilters_new.tsx │ │ │ ├── VipHeader_new.tsx │ │ │ ├── index.ts │ │ │ ├── TeamGrid.tsx │ │ │ ├── LoadMore.tsx │ │ │ └── AccessDenied.tsx │ │ ├── teams.component.tsx │ │ ├── teams.types.tsx │ │ └── teams.constants.tsx │ ├── progress │ │ ├── progress.buttons.tsx │ │ └── progress.types.tsx │ ├── page.tsx │ ├── api │ │ ├── logout │ │ │ └── route.ts │ │ ├── auth │ │ │ ├── type.auth.ts │ │ │ ├── verify │ │ │ │ └── route.ts │ │ │ └── route.ts │ │ ├── notifications │ │ │ ├── notifications.types.ts │ │ │ ├── mark-seen │ │ │ │ └── route.ts │ │ │ ├── route.ts │ │ │ └── create │ │ │ │ └── route.ts │ │ ├── progress │ │ │ └── progress.types.ts │ │ ├── database │ │ │ ├── chat_reactions.sql │ │ │ ├── chat.sql │ │ │ ├── notifications.sql │ │ │ ├── instructions.sql │ │ │ └── chat_moderation.sql │ │ ├── projects │ │ │ └── route.ts │ │ ├── user-badges │ │ │ └── route.ts │ │ ├── check-admin │ │ │ └── route.ts │ │ ├── feedback │ │ │ ├── rateLimit.ts │ │ │ └── feedback.types.ts │ │ ├── rate-limit-stats │ │ │ └── route.ts │ │ ├── slots │ │ │ └── slots.types.ts │ │ ├── check-creator │ │ │ └── route.ts │ │ ├── vip-users │ │ │ └── route.ts │ │ ├── rate-limit-bans │ │ │ └── route.ts │ │ ├── cv-maker │ │ │ └── route.ts │ │ ├── chat │ │ │ └── route.ts │ │ └── who │ │ │ └── route.ts │ ├── dashboard │ │ ├── feedback-reviews │ │ │ └── feedback-reviews.types.ts │ │ └── page.tsx │ ├── layout.tsx │ ├── globals.css │ └── evaluations │ │ └── evaluations.types.ts ├── component │ ├── dashboard │ │ ├── dashboard.imports.tsx │ │ ├── dashboard.types.tsx │ │ └── FeedbackPopup.types.ts │ ├── navbar │ │ ├── navbar.imports.tsx │ │ ├── navbar.buttons.tsx │ │ └── navbar.types.tsx │ ├── context │ │ ├── context.tsx │ │ └── context.types.tsx │ ├── hooks │ │ └── useRateLimitHandler.ts │ ├── feedback │ │ └── GlobalFeedbackButton.tsx │ ├── layout │ │ └── layout.tsx │ ├── RateLimitPopup.tsx │ ├── badges │ │ └── UserBadges.tsx │ ├── landing │ │ ├── landing.tsx │ │ └── particels.tsx │ └── BannedUsersPopup.tsx ├── middleware.ts └── utils │ ├── profileCache.ts │ └── moderationUtils.ts ├── public ├── cat.png ├── muh.png ├── nopic.jpg ├── vercel.svg ├── window.svg ├── file.svg ├── globe.svg ├── next.svg ├── test-auth.html └── socket-test.html ├── postcss.config.mjs ├── next-env.d.ts ├── pages └── api │ └── socket.types.ts ├── eslint.config.mjs ├── next.config.ts ├── restart-server.sh ├── .gitignore ├── tsconfig.json ├── scripts ├── insert-initial-notifications.sh ├── clean-bad-words.js ├── test-moderation.js ├── insert-notifications-api.js ├── debug-words.js ├── insert-notifications.sql ├── quick-test.js ├── migrate-reactions.js └── migrate-moderation.js ├── SETUP_REACTIONS.sql ├── setup-chat-db.sh ├── package.json ├── apiText ├── RATE_LIMITING.md ├── diagnose-socket.sh ├── diagnose-socketio.sh └── secure-chat-server.js /src/app/teams/page_new.tsx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/progress/progress.buttons.tsx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/teams/utils/timeExample.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/teams/components/VipFilters.tsx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/teams/components/VipFilters_new.tsx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/teams/components/VipHeader_new.tsx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/component/dashboard/dashboard.imports.tsx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Official-New-Leets/HEAD/public/cat.png -------------------------------------------------------------------------------- /public/muh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Official-New-Leets/HEAD/public/muh.png -------------------------------------------------------------------------------- /public/nopic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Official-New-Leets/HEAD/public/nopic.jpg -------------------------------------------------------------------------------- /postcss.config.mjs: -------------------------------------------------------------------------------- 1 | const config = { 2 | plugins: ["@tailwindcss/postcss"], 3 | }; 4 | export default config; 5 | -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/page.tsx: -------------------------------------------------------------------------------- 1 | import { LandingComponent } from "@/component/landing/landing"; 2 | 3 | export default function Home() { 4 | return ( 5 |
Loading teams...
16 |This may take a few seconds due to 42 API response time
17 |{title}
21 |37 | Try adjusting your filters or search in a different campus. 38 |
39 |29 | You've reached the end of the team list. 30 |
31 |Click a button to test...42 | 43 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /diagnose-socketio.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "🔍 Socket.IO Diagnostic Test" 4 | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 5 | echo "" 6 | 7 | # Check if server is running 8 | echo "1️⃣ Checking if Next.js server is running..." 9 | if pgrep -f "next dev" > /dev/null; then 10 | echo " ✅ Server is running (PID: $(pgrep -f "next dev" | head -1))" 11 | else 12 | echo " ❌ Server is NOT running!" 13 | echo " Run: npm run dev" 14 | exit 1 15 | fi 16 | echo "" 17 | 18 | # Check if Socket.IO endpoint responds 19 | echo "2️⃣ Testing Socket.IO endpoint..." 20 | HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:3000/api/socket) 21 | if [ "$HTTP_CODE" = "200" ] || [ "$HTTP_CODE" = "400" ]; then 22 | echo " ✅ Socket.IO endpoint responding (HTTP $HTTP_CODE)" 23 | else 24 | echo " ❌ Socket.IO endpoint not responding (HTTP $HTTP_CODE)" 25 | fi 26 | echo "" 27 | 28 | # Check if auth endpoint works 29 | echo "3️⃣ Testing auth verification endpoint..." 30 | AUTH_CODE=$(curl -s -w "%{http_code}" http://localhost:3000/api/auth/verify) 31 | if echo "$AUTH_CODE" | grep -q "200"; then 32 | echo " ✅ Auth endpoint working" 33 | elif echo "$AUTH_CODE" | grep -q "401"; then 34 | echo " ⚠️ Auth endpoint working but not logged in (expected)" 35 | else 36 | echo " ❌ Auth endpoint error" 37 | fi 38 | echo "" 39 | 40 | # Check for next.config.ts 41 | echo "4️⃣ Checking next.config.ts..." 42 | if grep -q "webpack" next.config.ts; then 43 | echo " ✅ Webpack config found in next.config.ts" 44 | else 45 | echo " ❌ Webpack config missing in next.config.ts" 46 | echo " This might cause Socket.IO issues!" 47 | fi 48 | echo "" 49 | 50 | # Check for socket.io packages 51 | echo "5️⃣ Checking Socket.IO packages..." 52 | if npm list socket.io > /dev/null 2>&1; then 53 | echo " ✅ socket.io installed" 54 | else 55 | echo " ❌ socket.io NOT installed!" 56 | fi 57 | 58 | if npm list socket.io-client > /dev/null 2>&1; then 59 | echo " ✅ socket.io-client installed" 60 | else 61 | echo " ❌ socket.io-client NOT installed!" 62 | fi 63 | echo "" 64 | 65 | # Check if .next directory exists (build) 66 | echo "6️⃣ Checking build status..." 67 | if [ -d ".next" ]; then 68 | echo " ✅ .next directory exists" 69 | BUILD_TIME=$(stat -c %y .next 2>/dev/null || stat -f "%Sm" .next 2>/dev/null) 70 | echo " Last built: $BUILD_TIME" 71 | else 72 | echo " ❌ .next directory missing (not built)" 73 | fi 74 | echo "" 75 | 76 | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 77 | echo "" 78 | echo "📋 Recommendations:" 79 | echo "" 80 | 81 | if ! grep -q "webpack" next.config.ts; then 82 | echo "⚠️ CRITICAL: Webpack config missing!" 83 | echo " → This will cause Socket.IO event handling to fail" 84 | echo "" 85 | fi 86 | 87 | echo "🔄 To fix Socket.IO issues, restart the server:" 88 | echo " 1. Press Ctrl+C in the terminal running npm run dev" 89 | echo " 2. Run: npm run dev" 90 | echo " 3. Or use: ./restart-server.sh" 91 | echo "" 92 | echo "After restart:" 93 | echo " • Go to http://localhost:3000/chat" 94 | echo " • Send a message" 95 | echo " • Check server terminal for: 📩 Received sendMessage event" 96 | -------------------------------------------------------------------------------- /src/component/feedback/GlobalFeedbackButton.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | import React, { useState, useEffect, useContext } from "react"; 3 | import { usePathname } from "next/navigation"; 4 | import { IoRocketOutline } from "react-icons/io5"; 5 | import FeedbackPopup from "@/component/dashboard/FeedbackPopup"; 6 | import { ContextCreator } from "@/component/context/context"; 7 | 8 | const GlobalFeedbackButton: React.FC = () => { 9 | const pathname = usePathname(); 10 | const context = useContext(ContextCreator); 11 | const [showFeedbackPopup, setShowFeedbackPopup] = useState(false); 12 | const [showButton, setShowButton] = useState(false); 13 | 14 | useEffect(() => { 15 | // Don't show on landing page 16 | if (pathname === "/") { 17 | setShowButton(false); 18 | return; 19 | } 20 | 21 | // Show button after a short delay to avoid flash on page load 22 | const timer = setTimeout(() => { 23 | setShowButton(true); 24 | }, 1000); 25 | 26 | return () => clearTimeout(timer); 27 | }, [pathname]); 28 | 29 | const handleCloseFeedbackPopup = () => { 30 | setShowFeedbackPopup(false); 31 | localStorage.setItem("hasSeenFeedbackPopup", "true"); 32 | }; 33 | 34 | const handleOpenFeedbackPopup = () => { 35 | setShowFeedbackPopup(true); 36 | }; 37 | 38 | if (!showButton) return null; 39 | 40 | return ( 41 | <> 42 | {/* Floating Feedback Button */} 43 | {!showFeedbackPopup && ( 44 | 66 | )} 67 | 68 | {/* Feedback Popup */} 69 | {showFeedbackPopup && ( 70 |
72 | You're making too many requests. Please slow down and try again in a moment. 73 |
74 | 75 | {/* Countdown */} 76 |21 | Elite School Ranking 22 |
23 |28 | Access your academic dashboard 29 |
30 |100 | Not feeling good with the update? 101 |
102 |103 | Classic interface available 104 |
105 |87 | {bannedUsers.length} user{bannedUsers.length !== 1 ? "s" : ""} currently banned 88 |
89 |{error}
108 |No users are currently banned
113 |All users are behaving well!
114 |145 | Banned {new Date(user.lastBlockTime).toLocaleString()} 146 |
147 |153 | {formatTime(user.remainingSeconds)} 154 |
155 |156 | remaining 157 |
158 |160 | {user.banDuration} ban 161 |
162 |