Repository: SkidGod4444/indexflow
Pull request #31: Added communities page and Threads section
Author: login: rxhul18
Created: 2025-04-06T20:50:29Z | Merged: 2025-04-06T21:51:16Z

This pull request introduces significant changes to the `apps/web` application, focusing on the communities feature, search functionality, and user interface enhancements. The most important changes include the addition of a communities page, updates to the search component to include servers, and the removal of an unused user profile dialog component.

### Added the Threads Section into home page
<img width="379" alt="image" src="https://github.com/user-attachments/assets/47e88c93-2853-4b7c-b2dd-8f2960ddef86" />

### Created communities page for all community with filteration
<img width="1440" alt="image" src="https://github.com/user-attachments/assets/c06024aa-9a11-4a0b-a812-319b17188613" />


Diff:
diff --git a/apps/web/app/(routes)/communities/page.tsx b/apps/web/app/(routes)/communities/page.tsx
new file mode 100644
index 0000000..49161f2
--- /dev/null
+++ b/apps/web/app/(routes)/communities/page.tsx
@@ -0,0 +1,74 @@
+"use client";
+
+import { Input } from "@/components/ui/input";
+import { Search } from "lucide-react";
+import { useState, useMemo, Suspense, useEffect } from "react";
+import CommunityGrid from "../../../components/custom/community/communities.card";
+import { useServersStore } from "@/lib/zustand";
+import { useSearchParams, useRouter } from "next/navigation";
+
+export default function CommunitiesPage() {
+  const [searchQuery, setSearchQuery] = useState("");
+  const { servers } = useServersStore();
+  const searchParams = useSearchParams();
+  const router = useRouter();
+
+  // Get server name from URL params and set it as initial search query
+  useEffect(() => {
+    const serverName = searchParams.get("server");
+    if (serverName) {
+      setSearchQuery(serverName);
+    }
+  }, [searchParams]);
+
+  const filteredServers = useMemo(() => {
+    if (!searchQuery) {
+      return servers;
+    }
+
+    const normalizedSearch = searchQuery.trim().toLowerCase();
+    return servers.filter((server) => {
+      const serverName = server.name?.trim().toLowerCase() || '';
+      return serverName.includes(normalizedSearch);
+    });
+  }, [searchQuery, servers]);
+
+  const handleSearchChange = (e: React.ChangeEvent<HTMLInputElement>) => {
+    const value = e.target.value;
+    setSearchQuery(value);
+
+    // Update URL with search parameter
+    const params = new URLSearchParams(searchParams.toString());
+    if (value) {
+      params.set("server", value.trim().toLowerCase());
+    } else {
+      params.delete("server");
+    }
+    router.push(`?${params.toString()}`);
+  };
+
+  return (
+    <div className="flex w-full justify-center h-[calc(100vh-120px)] overflow-hidden py-5">
+      <div className="flex flex-col min-w-[90%] md:container w-full px-4">
+        <div className="flex flex-col md:flex-row min-w-full justify-between items-start mb-6 gap-4">
+          <div className="relative w-full md:w-full flex flex-1">
+            <Search className="absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground h-4 w-4" />
+            <Input
+              placeholder="Filter by community..."
+              className="pl-10 border-muted"
+              value={searchQuery}
+              onChange={handleSearchChange}
+            />
+          </div>
+          <div>
+          </div>
+        </div>
+        <div className="overflow-y-auto h-full overflow-x-hidden [&::-webkit-scrollbar]:hidden [-ms-overflow-style:'none'] [scrollbar-width:'none']">
+          <Suspense fallback={<div className="text-center py-4">Loading communities...</div>}>
+            <CommunityGrid filteredServers={filteredServers} />
+          </Suspense>
+        </div>
+      </div>
+    </div>
+  );
+}
\ No newline at end of file
diff --git a/apps/web/app/(routes)/page.tsx b/apps/web/app/(routes)/page.tsx
index bc05148..e9f8b3a 100644
--- a/apps/web/app/(routes)/page.tsx
+++ b/apps/web/app/(routes)/page.tsx
@@ -6,12 +6,17 @@ import { Suspense, useState } from "react";
 import { JoinCommunityBtn } from "@/components/custom/join.community.btn";
 import { useServersStore, useTagsStore } from "@/lib/zustand";
 import { useContent } from "@/context/content.context";
-
+import { Button } from "@/components/ui/button";
+import { useRouter } from "next/navigation";
+import { Clock, MessageSquare } from "lucide-react"
+import Link from "next/link"
+import { Threads } from "@/json/dummy"
 export default function Home() {
   const [selectedTag, setSelectedTag] = useState("");
   const { servers } = useServersStore();
   const { tags } = useTagsStore();
   const { contentLoading } = useContent();
+  const router = useRouter();
 
   return (
     <div className="flex w-full justify-center py-8">
@@ -38,6 +43,39 @@ export default function Home() {
 
           {/* Community Form */}
           <aside className="w-full lg:w-[350px] py-10 space-y-6 sticky lg:top-[100px] h-fit flex-shrink-0">
+            <div className="rounded-lg border p-4">
+              <div className="mb-4 flex items-center">
+                <div className="relative flex size-2.5 mr-2">
+                  <div className="absolute inline-flex size-full animate-ping rounded-full bg-green-400 opacity-75"></div>
+                  <div className="relative inline-flex size-full rounded-full bg-green-500"></div>
+                </div>
+                <h2 className="text-xl font-bold">Active Threads</h2>
+              </div>
+              <div className="space-y-3 overflow-y-auto h-[calc(100vh-55vh)] overflow-x-hidden scrollbar-none [&::-webkit-scrollbar]:hidden [-ms-overflow-style:'none'] [scrollbar-width:'none']">
+                {Threads.map((thread) => (
+                  <div
+                    key={thread.id}
+                    className="rounded-md border bg-background p-3 transition-colors"
+                  >
+                    <Link href={`/thread/${thread.id}`} className="block">
+                      <h3 className="font-medium ">{thread.title}</h3>
+                      <p className="mt-1 text-sm text-muted-foreground line-clamp-2">{thread.description}</p>
+
+                      <div className="mt-2 flex items-center gap-4 text-xs text-gray-500 dark:text-gray-400">
+                        <div className="flex items-center gap-1">
+                          <Clock className="h-3.5 w-3.5" />
+                          <span>{thread.lastActive}</span>
+                        </div>
+                        <div className="flex items-center gap-1">
+                          <MessageSquare className="h-3.5 w-3.5" />
+                          <span>{thread.replies} replies</span>
+                        </div>
+                      </div>
+                    </Link>
+                  </div>
+                ))}
+              </div>
+            </div>
             <div className="rounded-lg border p-4">
               <h2 className="text-xl font-semibold mb-4">Communities</h2>
               <p className="text-muted-foreground mb-4">
@@ -75,6 +113,15 @@ export default function Home() {
                   ))}
                 </div>
               )}
+              <Button
+                variant="outline"
+                className="w-full mt-4"
+                onClick={() => {
+                  router.push("/communities");
+                }}
+              >
+                More Communities
+              </Button>
             </div>
           </aside>
         </div>
diff --git a/apps/web/components/custom/all-questions.tsx b/apps/web/components/custom/all-questions.tsx
index a0695d9..a91cffc 100644
--- a/apps/web/components/custom/all-questions.tsx
+++ b/apps/web/components/custom/all-questions.tsx
@@ -94,7 +94,7 @@ export default function QuestionsList({
   };
 
   return (
-    <div className="flex-1 relative h-[calc(100vh-120px)] overflow-x-hidden py-5">
+    <div className="flex-1 relative h-[100vh] overflow-x-hidden py-5">
       <div className="flex flex-col justify-between items-start mb-6 gap-4 sticky top-0 bg-background z-10">
         <h1 className="text-3xl font-bold">
           {filter === "newest"
diff --git a/apps/web/components/custom/community/communities.card.tsx b/apps/web/components/custom/community/communities.card.tsx
new file mode 100644
index 0000000..d9de636
--- /dev/null
+++ b/apps/web/components/custom/community/communities.card.tsx
@@ -0,0 +1,95 @@
+"use client";
+
+import { Badge } from "@/components/ui/badge";
+import { Card, CardContent } from "@/components/ui/card";
+import {  Mails, Users } from "lucide-react";
+import Image from "next/image";
+import type { ServerType } from "@iflow/types";
+import { Button } from "@/components/ui/button";
+
+export default function CommunityGrid({
+    filteredServers = [],
+}: {
+    filteredServers?: ServerType[];
+}) {    
+
+    const renderLogo = (server: ServerType, size = 56) => (
+        server.logo ? (
+            <Image
+                src={server.logo}
+                alt={server.name || "Server"}
+                width={size}
+                height={size}
+                className="object-cover w-full h-full rounded-full"
+            />
+        ) : (
+            <div className="flex items-center justify-center w-full h-full text-lg font-semibold bg-secondary">
+                {server.name?.[0] || "S"}
+            </div>
+        )
+    );
+
+    return (
+        <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-1 gap-4">
+            {filteredServers.length > 0 ? (
+                filteredServers.map((server) => (
+                    <Card
+                        key={server.id}
+                        className="overflow-hidden transition-all duration-200 hover:shadow-md group py-1 cursor-pointer"
+                    >
+                        <CardContent className="p-3">
+                            <div className="flex items-start gap-3">
+                                <div className="relative flex-shrink-0 w-14 h-14 rounded-full bg-secondary border overflow-hidden">
+                                    {renderLogo(server)}
+                                </div>
+                                <div className="flex flex-col min-w-0 flex-1">
+                                    <div className="flex flex-col lg:flex-row justify-between md:items-center mb-2">
+                                        <div className="flex items-center">
+                                            <span className="font-medium text-primary truncate text-base">
+                                                {server.name}
+                                            </span>
+                                            {/* {server.is_config && ( */}
+                                            <Badge variant="secondary" className="text-xs ml-3 h-5">
+                                                Configured
+                                            </Badge>
+                                        </div>
+                                        <Button className="w-full lg:w-auto mt-2 md:mt-0" onClick={() => {
+                                            if (server.invite_url) {
+                                                window.open(server.invite_url);
+                                            }
+                                        }}>
+                                            Join community
+                                        </Button>
+                                    </div>
+
+                                    <div className="flex flex-col lg:flex-row">
+                                        {server.invite_url && (
+                                            <div className="flex items-center text-muted-foreground text-sm gap-1 md:mr-3">
+                                                <Mails className="size-4 text-primary" />
+                                                <span>100 posts</span>
+                                            </div>
+                                        )}
+                                        <div className="flex items-center text-muted-foreground text-sm gap-1">
+                                            <Users className="size-4 text-primary" />
+                                            <span>Owner ID: {server.owner_id}</span>
+                                        </div>
+                                    </div>
+
+                                    <p className="text-muted-foreground text-sm mt-2">
+                                        This server is a community for the server. It is a place where you can find other people who are interested in the server.
+                                    </p>
+                                </div>
+                            </div>
+                        </CardContent>
+                    </Card>
+                ))
+            ) : (
+                <div className="col-span-full flex flex-col items-center justify-center py-12 text-center">
+                    <div className="text-4xl mb-3">🔍</div>
+                    <h3 className="text-lg font-medium mb-1">No communities found</h3>
+                    <p className="text-muted-foreground text-sm">Try adjusting your search or filter criteria</p>
+                </div>
+            )}
+        </div>
+    );
+} 
\ No newline at end of file
diff --git a/apps/web/components/custom/navbar/header.tsx b/apps/web/components/custom/navbar/header.tsx
index 1f636cc..95bf44d 100644
--- a/apps/web/components/custom/navbar/header.tsx
+++ b/apps/web/components/custom/navbar/header.tsx
@@ -40,6 +40,12 @@ export default function Header() {
             >
               Users
             </Link>
+            <Link
+              href="/communities"
+              className="font-medium transition-colors hover:text-primary"
+            >
+              Communities
+            </Link>
             <Link
               href="/support"
               className="font-medium transition-colors hover:text-primary"
@@ -115,6 +121,13 @@ export default function Header() {
               >
                 Users
               </Link>
+              <Link
+                href="/communities"
+                className="font-medium transition-colors hover:text-primary"
+                onClick={() => setIsMenuOpen(false)}
+              >
+                Communities
+              </Link>
               <Link
                 href="/about"
                 className="font-medium transition-colors hover:text-primary"
diff --git a/apps/web/components/custom/navbar/search.comp.tsx b/apps/web/components/custom/navbar/search.comp.tsx
index 7274991..4dc79f1 100644
--- a/apps/web/components/custom/navbar/search.comp.tsx
+++ b/apps/web/components/custom/navbar/search.comp.tsx
@@ -10,47 +10,55 @@ import {
   CommandGroup,
   CommandItem,
 } from "@/components/ui/command";
-import { useTagsStore, useUsersStore } from "@/lib/zustand";
+import { useTagsStore, useUsersStore, useServersStore } from "@/lib/zustand";
 import { questions } from "@/json/dummy";
 import { useRouter } from "next/navigation";
-import { TagType, UserType } from "@iflow/types";
+import { TagType, UserType, ServerType } from "@iflow/types";
 
 export default function SearchInputCommand() {
   const [commandOpen, setCommandOpen] = useState(false);
   const { users } = useUsersStore();
   const { tags } = useTagsStore();
+  const { servers } = useServersStore();
   const router = useRouter();
   const [searchQuery, setSearchQuery] = useState("");
   const [searchResults, setSearchResults] = useState<{
     users: UserType[];
     tags: TagType[];
+    servers: ServerType[];
+    // eslint-disable-next-line @typescript-eslint/no-explicit-any
     questions: any[];
-  }>({ users: [], tags: [], questions: [] });
+  }>({ users: [], tags: [], servers: [], questions: [] });
 
   useEffect(() => {
     if (searchQuery.trim() === "") {
-      setSearchResults({ users: [], tags: [], questions: [] });
+      setSearchResults({ users: [], tags: [], servers: [], questions: [] });
       return;
     }
 
+    const normalizedSearch = searchQuery.trim().toLowerCase();
     const filteredUsers = users.filter((user) =>
-      user.name.toLowerCase().includes(searchQuery.toLowerCase()),
+      user.name.toLowerCase().includes(normalizedSearch),
     );
     const filteredTags = tags.filter((tag) =>
-      tag.name.toLowerCase().includes(searchQuery.toLowerCase()),
+      tag.name.toLowerCase().includes(normalizedSearch),
+    );
+    const filteredServers = servers.filter((server) =>
+      server.name?.trim().toLowerCase().includes(normalizedSearch),
     );
     const filteredQuestions = questions.filter(
       (q) =>
-        q.title.toLowerCase().includes(searchQuery.toLowerCase()) ||
-        q.content.toLowerCase().includes(searchQuery.toLowerCase()),
+        q.title.toLowerCase().includes(normalizedSearch) ||
+        q.content.toLowerCase().includes(normalizedSearch),
     );
 
     setSearchResults({
       users: filteredUsers,
       tags: filteredTags,
+      servers: filteredServers,
       questions: filteredQuestions,
     });
-  }, [searchQuery, users, tags, questions]);
+  }, [searchQuery, users, tags, servers, questions]);
 
   useEffect(() => {
     const down = (e: KeyboardEvent) => {
@@ -59,15 +67,17 @@ export default function SearchInputCommand() {
         setCommandOpen((open) => !open);
       }
     };
-    console.log({
-      tags: tags,
-      users: users,
-      questions: questions,
-    });
+
     document.addEventListener("keydown", down);
     return () => document.removeEventListener("keydown", down);
   }, []);
 
+  const handleServerSelect = (server: ServerType) => {
+    const serverName = server.name?.trim().toLowerCase().replace(/\s+/g, '+') || '';
+    router.push(`/communities?server=${serverName}`);
+    setCommandOpen(false);
+  };
+
   return (
     <div className="hidden md:flex md:items-center md:gap-3 flex-1 px-2 pl-6">
       <div className="relative w-full flex-1 items-center flex">
@@ -97,6 +107,20 @@ export default function SearchInputCommand() {
             <CommandList>
               <CommandEmpty>No results found.</CommandEmpty>
 
+              {searchResults.servers.length > 0 && (
+                <CommandGroup heading="Servers">
+                  {searchResults.servers.map((server) => (
+                    <CommandItem
+                      key={server.id}
+                      className="cursor-pointer"
+                      onSelect={() => handleServerSelect(server)}
+                    >
+                      {server.name}
+                    </CommandItem>
+                  ))}
+                </CommandGroup>
+              )}
+
               {searchResults.users.length > 0 && (
                 <CommandGroup heading="Users">
                   {searchResults.users.map((user) => (
@@ -104,7 +128,6 @@ export default function SearchInputCommand() {
                       key={user.id}
                       className="cursor-pointer"
                       onSelect={() => {
-                        // Use onSelect instead of onClick for better CommandItem handling
                         router.push(`/users`);
                         setCommandOpen(false);
                       }}
diff --git a/apps/web/components/custom/user/profile-dialog.tsx b/apps/web/components/custom/user/profile-dialog.tsx
deleted file mode 100644
index 00b9507..0000000
--- a/apps/web/components/custom/user/profile-dialog.tsx
+++ /dev/null
@@ -1,79 +0,0 @@
-"use client";
-
-import { useEffect, useState } from "react";
-import { useRouter, useSearchParams } from "next/navigation";
-import {
-  Dialog,
-  DialogContent,
-  DialogHeader,
-  DialogTitle,
-} from "@/components/ui/dialog";
-import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
-
-interface UserProfileDialogProps {
-  username: string;
-  isOpen: boolean;
-  onOpenChange: (open: boolean) => void;
-}
-
-export function UserProfileDialog({
-  username,
-  isOpen,
-  onOpenChange,
-}: UserProfileDialogProps) {
-  const router = useRouter();
-  const searchParams = useSearchParams();
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
-  const [userData, setUserData] = useState<any>(null);
-
-  useEffect(() => {
-    if (isOpen && username) {
-      // Fetch user data here
-      // This is a placeholder - you'll need to implement the actual API call
-      fetchUserData(username).then((data) => {
-        setUserData(data);
-      });
-    }
-  }, [isOpen, username]);
-
-  const handleOpenChange = (open: boolean) => {
-    onOpenChange(open);
-    if (!open) {
-      // Remove username from URL when dialog closes
-      const params = new URLSearchParams(searchParams.toString());
-      params.delete("username");
-      router.push(`?${params.toString()}`);
-    }
-  };
-
-  return (
-    <Dialog open={isOpen} onOpenChange={handleOpenChange}>
-      <DialogContent className="sm:max-w-md">
-        <DialogHeader>
-          <DialogTitle>User Profile</DialogTitle>
-        </DialogHeader>
-        {userData && (
-          <div className="flex flex-col items-center gap-4 py-4">
-            <Avatar className="h-20 w-20">
-              <AvatarImage src={userData.avatar} alt={username} />
-              <AvatarFallback>{username[0]}</AvatarFallback>
-            </Avatar>
-            <div className="text-center">
-              <h3 className="text-lg font-semibold">{username}</h3>
-              {/* Add more user information here */}
-            </div>
-          </div>
-        )}
-      </DialogContent>
-    </Dialog>
-  );
-}
-
-// Placeholder function - implement your actual API call
-async function fetchUserData(username: string) {
-  // Implement your API call here
-  return {
-    avatar: `https://avatar.vercel.sh/${username}`,
-    // Add other user data
-  };
-} 
\ No newline at end of file
diff --git a/apps/web/json/dummy.ts b/apps/web/json/dummy.ts
index fc176bf..eabcdec 100644
--- a/apps/web/json/dummy.ts
+++ b/apps/web/json/dummy.ts
@@ -235,267 +235,59 @@ export const questions = [
   },
 ];
 
-// export const popularTags = [
-//   { name: "javascript", count: 1254 },
-//   { name: "react", count: 982 },
-//   { name: "next.js", count: 753 },
-//   { name: "node.js", count: 621 },
-//   { name: "typescript", count: 587 },
-//   { name: "css", count: 432 },
-//   { name: "tailwind", count: 398 },
-//   { name: "api", count: 321 },
-//   { name: "database", count: 287 },
-//   { name: "authentication", count: 254 },
-// ];
-
-// export const communities = [
-//   {
-//     id: "1",
-//     name: "React Devs",
-//     description: "A community for React developers.",
-//     img: "https://avatar.vercel.sh/jane",
-//   },
-//   {
-//     id: "2",
-//     name: "Next.js Enthusiasts",
-//     description: "All about Next.js.",
-//     img: "https://avatar.vercel.sh/jack",
-//   },
-//   {
-//     id: "3",
-//     name: "Tailwind CSS Wizards",
-//     description: "Mastering Tailwind CSS.",
-//     img: "https://avatar.vercel.sh/jill",
-//   },
-//   {
-//     id: "4",
-//     name: "React Devs",
-//     description: "A community for React developers.",
-//     img: "https://avatar.vercel.sh/jane",
-//   },
-//   {
-//     id: "5",
-//     name: "Next.js Enthusiasts",
-//     description: "All about Next.js.",
-//     img: "https://avatar.vercel.sh/jack",
-//   },
-//   {
-//     id: "6",
-//     name: "Tailwind CSS Wizards",
-//     description: "Mastering Tailwind CSS.",
-//     img: "https://avatar.vercel.sh/jill",
-//   },
-//   {
-//     id: "7",
-//     name: "React Devs",
-//     description: "A community for React developers.",
-//     img: "https://avatar.vercel.sh/jane",
-//   },
-//   {
-//     id: "8",
-//     name: "Next.js Enthusiasts",
-//     description: "All about Next.js.",
-//     img: "https://avatar.vercel.sh/jack",
-//   },
-//   {
-//     id: "9",
-//     name: "Tailwind CSS Wizards",
-//     description: "Mastering Tailwind CSS.",
-//     img: "https://avatar.vercel.sh/jill",
-//   },
-//   {
-//     id: "10",
-//     name: "React Devs",
-//     description: "A community for React developers.",
-//     img: "https://avatar.vercel.sh/jane",
-//   },
-//   {
-//     id: "11",
-//     name: "Next.js Enthusiasts",
-//     description: "All about Next.js.",
-//     img: "https://avatar.vercel.sh/jack",
-//   },
-//   {
-//     id: "12",
-//     name: "Tailwind CSS Wizards",
-//     description: "Mastering Tailwind CSS.",
-//     img: "https://avatar.vercel.sh/jill",
-//   },
-// ];
-
-// export const users = [
-//   {
-//     id: 17,
-//     name: "Cloud Coder",
-//     location: "Australia",
-//     reputation: "110",
-//     tags: ["aws", "devops", "kubernetes"],
-//     avatarBg: "bg-green-200",
-//     lastActive: "2025-03-06T16:00:00Z", // Within last 7 days
-//     createdAt: "2025-03-01T12:30:00Z", // Within last 7 days
-//   },
-//   {
-//     id: 1,
-//     name: "VonC",
-//     location: "France",
-//     reputation: "320",
-//     tags: ["git", "github", "docker"],
-//     avatar: "/placeholder.svg?height=48&width=48",
-//     avatarBg: "bg-blue-100",
-//     lastActive: "2024-03-09T12:15:00Z", // Within last 7 days
-//     createdAt: "2023-07-10T09:00:00Z",
-//   },
-//   {
-//     id: 11,
-//     name: "rozsazoltan",
-//     location: "Hungary",
-//     reputation: "140",
-//     tags: ["tailwind-css", "javascript", "css"],
-//     avatar: "/placeholder.svg?height=48&width=48",
-//     avatarBg: "bg-gray-100",
-//     lastActive: "2024-03-03T07:15:00Z",
-//     createdAt: "2023-12-15T09:30:00Z",
-//   },
-//   {
-//     id: 2,
-//     name: "Halo",
-//     location: "USA",
-//     reputation: "280",
-//     tags: ["three.js", "javascript", "css"],
-//     avatarBg: "bg-purple-100",
-//     lastActive: "2024-03-07T18:45:00Z", // Within last 7 days
-//     createdAt: "2024-03-06T14:30:00Z", // Within last 7 days
-//   },
-//   {
-//     id: 3,
-//     name: "Sweeper",
-//     location: "UK",
-//     reputation: "246",
-//     tags: ["swift", "java", "c#"],
-//     avatarBg: "bg-gray-100",
-//     lastActive: "2024-01-10T16:10:00Z",
-//     createdAt: "2023-11-15T08:00:00Z",
-//   },
-//   {
-//     id: 4,
-//     name: "Jon Skeet",
-//     location: "Reading, United Kingdom",
-//     reputation: "230",
-//     tags: ["c#", "java", ".net"],
-//     avatar: "/placeholder.svg?height=48&width=48",
-//     avatarBg: "bg-gray-100",
-//     lastActive: "2024-03-05T10:20:00Z",
-//     createdAt: "2023-06-30T07:45:00Z",
-//   },
-//   {
-//     id: 5,
-//     name: "Yus",
-//     location: "",
-//     reputation: "200",
-//     tags: ["html", "css", "python-3.x"],
-//     avatarBg: "bg-pink-100",
-//     lastActive: "2024-03-08T22:30:00Z", // Within last 7 days
-//     createdAt: "2024-03-04T11:50:00Z", // Within last 7 days
-//   },
-//   {
-//     id: 15,
-//     name: "AI Whisperer",
-//     location: "Canada",
-//     reputation: "118",
-//     tags: ["machine-learning", "python", "tensorflow"],
-//     avatarBg: "bg-indigo-100",
-//     lastActive: "2025-03-10T08:45:00Z", // Within last 7 days
-//     createdAt: "2025-03-05T14:00:00Z", // Within last 7 days
-//   },
-//   {
-//     id: 6,
-//     name: "BmyGuest",
-//     location: "",
-//     reputation: "160",
-//     tags: ["dm-script", "c++", "mfc"],
-//     avatarBg: "bg-gray-100",
-//     lastActive: "2024-02-15T14:00:00Z",
-//     createdAt: "2023-07-20T13:15:00Z",
-//   },
-//   {
-//     id: 7,
-//     name: "Ahmed AEK",
-//     location: "",
-//     reputation: "159",
-//     tags: ["python", "c++", "multithreading"],
-//     avatarBg: "bg-green-100",
-//     lastActive: "2024-03-09T09:40:00Z", // Within last 7 days
-//     createdAt: "2023-09-10T17:25:00Z",
-//   },
-//   {
-//     id: 8,
-//     name: "Naren Murali",
-//     location: "Chennai, Tamil Nadu, India",
-//     reputation: "158",
-//     tags: ["angular", "javascript", "typescript"],
-//     avatarBg: "bg-pink-100",
-//     lastActive: "2024-03-08T21:15:00Z", // Within last 7 days
-//     createdAt: "2023-12-01T10:10:00Z",
-//   },
-//   {
-//     id: 9,
-//     name: "AmerlicA",
-//     location: "Shāhi, Māzandarān Province, Iran",
-//     reputation: "145",
-//     tags: ["javascript", "reactjs", "react-native"],
-//     avatar: "/placeholder.svg?height=48&width=48",
-//     avatarBg: "bg-gray-100",
-//     lastActive: "2024-02-22T13:30:00Z",
-//     createdAt: "2023-09-15T12:00:00Z",
-//   },
-//   {
-//     id: 10,
-//     name: "dbush",
-//     location: "New Jersey",
-//     reputation: "143",
-//     tags: ["c", "pointers", "c++"],
-//     avatarBg: "bg-yellow-100",
-//     lastActive: "2024-01-28T16:50:00Z",
-//     createdAt: "2023-10-10T08:40:00Z",
-//   },
-//   {
-//     id: 12,
-//     name: "Sebastian Redl",
-//     location: "",
-//     reputation: "135",
-//     tags: ["c++", "c++11", "rust"],
-//     avatarBg: "bg-teal-100",
-//     lastActive: "2024-01-15T14:20:00Z",
-//     createdAt: "2023-12-05T11:55:00Z",
-//   },
-//   {
-//     id: 13,
-//     name: "Lara Dev",
-//     location: "Germany",
-//     reputation: "125",
-//     tags: ["laravel", "php", "mysql"],
-//     avatarBg: "bg-orange-100",
-//     lastActive: "2025-03-09T14:10:00Z", // Within last 7 days
-//     createdAt: "2025-03-04T09:30:00Z", // Within last 7 days
-//   },
-//   {
-//     id: 14,
-//     name: "Xavier Code",
-//     location: "Spain",
-//     reputation: "122",
-//     tags: ["vue.js", "nuxt", "javascript"],
-//     avatarBg: "bg-red-100",
-//     lastActive: "2025-03-08T17:20:00Z", // Within last 7 days
-//     createdAt: "2024-03-03T07:15:00Z",
-//   },
-//   {
-//     id: 16,
-//     name: "React Wizard",
-//     location: "India",
-//     reputation: "115",
-//     tags: ["react", "next.js", "redux"],
-//     avatarBg: "bg-blue-200",
-//     lastActive: "2025-03-07T20:30:00Z", // Within last 7 days
-//     createdAt: "2024-03-03T07:15:00Z",
-//   },
-// ];
+export const Threads = [
+  {
+    id: "1",
+    title: "Best practices for Tailwind CSS purging",
+    description:
+      "I'm trying to optimize my production build and need advice on the most effective purging strategies for Tailwind CSS.",
+    activity: 95,
+    lastActive: "10 min ago",
+    replies: 7,
+  },
+  {
+    id: "2",
+    title: "Webpack optimization for large Next.js projects",
+    description:
+      "My build times are getting longer as my project grows. Looking for webpack configuration tips to speed things up.",
+    activity: 87,
+    lastActive: "32 min ago",
+    replies: 12,
+  },
+  {
+    id: "3",
+    title: "Migrating from CSS Modules to Tailwind",
+    description:
+      "Has anyone successfully migrated a large codebase from CSS Modules to Tailwind? What was your approach?",
+    activity: 76,
+    lastActive: "1 hour ago",
+    replies: 5,
+  },
+  {
+    id: "4",
+    title: "Best practices for Tailwind CSS purging",
+    description:
+      "I'm trying to optimize my production build and need advice on the most effective purging strategies for Tailwind CSS.",
+    activity: 95,
+    lastActive: "10 min ago",
+    replies: 7,
+  },
+  {
+    id: "5",
+    title: "Best practices for Tailwind CSS purging",
+    description:
+      "I'm trying to optimize my production build and need advice on the most effective purging strategies for Tailwind CSS.",
+    activity: 95,
+    lastActive: "10 min ago",
+    replies: 7,
+  },
+  {
+    id: "6",
+    title: "Best practices for Tailwind CSS purging",
+    description:
+      "I'm trying to optimize my production build and need advice on the most effective purging strategies for Tailwind CSS.",
+    activity: 95,
+    lastActive: "10 min ago",
+    replies: 7,
+  },
+];


Reviews:
user: login: coderabbitai[bot]
body: **Actionable comments posted: 6**

<details>
<summary>🧹 Nitpick comments (10)</summary><blockquote>

<details>
<summary>apps/web/json/dummy.ts (1)</summary><blockquote>

`238-293`: **Fix duplicate thread entries in dummy data**

There are several duplicate thread entries (IDs 1, 4, 5, and 6) with identical content. While this is dummy data, having unique entries would be more realistic for testing purposes and better demonstrate the feature's functionality.


Consider updating entries 4, 5, and 6 with unique titles, descriptions, and varying activity levels to provide more diverse test data:

```diff
  {
    id: "4",
-   title: "Best practices for Tailwind CSS purging",
-   description:
-     "I'm trying to optimize my production build and need advice on the most effective purging strategies for Tailwind CSS.",
-   activity: 95,
-   lastActive: "10 min ago",
+   title: "Server-side rendering with React 18",
+   description:
+     "What's the recommended approach for SSR with React 18's new features? Looking for examples with Suspense.",
+   activity: 82,
+   lastActive: "25 min ago",
    replies: 7,
  },
  {
    id: "5",
-   title: "Best practices for Tailwind CSS purging",
-   description:
-     "I'm trying to optimize my production build and need advice on the most effective purging strategies for Tailwind CSS.",
-   activity: 95,
-   lastActive: "10 min ago",
+   title: "TypeScript type challenges",
+   description:
+     "Working through advanced TypeScript typing and running into issues with conditional types. Any TypeScript experts here?",
+   activity: 63,
+   lastActive: "2 hours ago",
    replies: 7,
  },
  {
    id: "6",
-   title: "Best practices for Tailwind CSS purging",
-   description:
-     "I'm trying to optimize my production build and need advice on the most effective purging strategies for Tailwind CSS.",
-   activity: 95,
-   lastActive: "10 min ago",
+   title: "State management alternatives to Redux",
+   description:
+     "Looking for lighter-weight alternatives to Redux for a medium-sized React application. What's worked well for your projects?",
+   activity: 78,
+   lastActive: "45 min ago",
    replies: 7,
  },
```

</blockquote></details>
<details>
<summary>apps/web/app/(routes)/communities/page.tsx (2)</summary><blockquote>

`63-65`: **Remove or utilize empty div**

There's an empty div that isn't serving any purpose. Either remove it or add the intended content.


```diff
-<div>
-</div>
```

---

`66-70`: **Add error handling for community data fetching**

The component uses Suspense for loading states but doesn't include error handling for potential API failures when fetching community data.


Consider adding error boundaries or error state handling to gracefully handle potential API errors:

```diff
<div className="overflow-y-auto h-full overflow-x-hidden [&::-webkit-scrollbar]:hidden [-ms-overflow-style:'none'] [scrollbar-width:'none']">
-  <Suspense fallback={<div className="text-center py-4">Loading communities...</div>}>
+  <Suspense fallback={<div className="text-center py-4">Loading communities...</div>}>
+    {servers.length === 0 && !searchQuery ? (
+      <div className="text-center py-12">
+        <h3 className="text-lg font-medium mb-1">No communities available</h3>
+        <p className="text-muted-foreground text-sm">Check back later for community updates</p>
+      </div>
+    ) : (
      <CommunityGrid filteredServers={filteredServers} />
+    )}
  </Suspense>
</div>
```

</blockquote></details>
<details>
<summary>apps/web/components/custom/community/communities.card.tsx (3)</summary><blockquote>

`51-55`: **Remove commented-out code or implement the feature.**

The commented out condition `{/* {server.is_config && ( */}` suggests incomplete or abandoned functionality. Either implement this feature properly or remove the commented code. Currently, the "Configured" badge is always displayed regardless of the server's configuration status.


```diff
-                                            {/* {server.is_config && ( */}
                                             <Badge variant="secondary" className="text-xs ml-3 h-5">
                                                 Configured
                                             </Badge>
+                                            {/* )} */}
```

---

`56-62`: **Add feedback when joining a community.**

The join button doesn't provide any feedback to users when clicked. Consider adding a loading state and error handling for better user experience.


```diff
-                                        <Button className="w-full lg:w-auto mt-2 md:mt-0" onClick={() => {
+                                        <Button 
+                                            className="w-full lg:w-auto mt-2 md:mt-0"
+                                            onClick={() => {
                                                if (server.invite_url) {
-                                                    window.open(server.invite_url);
+                                                    window.open(server.invite_url, '_blank', 'noopener,noreferrer');
+                                                } else {
+                                                    // Consider showing a toast notification
+                                                    console.error("No invite URL available");
                                                }
                                            }}>
                                            Join community
                                        </Button>
```

---

`33-33`: **Improve grid responsiveness for larger screens.**

The current grid has a maximum of 2 columns, which may not be optimal for larger screens. Consider adding more responsive breakpoints for better space utilization.


```diff
-        <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-1 gap-4">
+        <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-1 xl:grid-cols-2 2xl:grid-cols-3 gap-4">
```

</blockquote></details>
<details>
<summary>apps/web/app/(routes)/page.tsx (2)</summary><blockquote>

`54-54`: **Improve responsive height calculation for thread container.**

The fixed height calculation `h-[calc(100vh-55vh)]` may not work well across different screen sizes and devices. Consider using a more flexible approach.


```diff
-              <div className="space-y-3 overflow-y-auto h-[calc(100vh-55vh)] overflow-x-hidden scrollbar-none [&::-webkit-scrollbar]:hidden [-ms-overflow-style:'none'] [scrollbar-width:'none']">
+              <div className="space-y-3 overflow-y-auto max-h-[350px] lg:max-h-[400px] overflow-x-hidden scrollbar-none [&::-webkit-scrollbar]:hidden [-ms-overflow-style:'none'] [scrollbar-width:'none']">
```

---

`116-124`: **Enhance the "More Communities" button with visual feedback.**

The button lacks visual feedback when loading or transitioning to the communities page. Consider adding a loading state to improve user experience.


```diff
+              const [isNavigating, setIsNavigating] = useState(false);

               <Button
                 variant="outline"
                 className="w-full mt-4"
+                disabled={isNavigating}
                 onClick={() => {
+                   setIsNavigating(true);
                   router.push("/communities");
                 }}
               >
-                More Communities
+                {isNavigating ? "Loading..." : "More Communities"}
               </Button>
```

</blockquote></details>
<details>
<summary>apps/web/components/custom/navbar/search.comp.tsx (2)</summary><blockquote>

`33-61`: **Implement search input debouncing for better performance.**

The search functionality updates results on every keystroke, which can cause performance issues with large datasets. Implementing debouncing would improve user experience.


Add a debounce function and use it for the search:

```diff
+  const debounce = (fn: Function, ms = 300) => {
+    let timeoutId: ReturnType<typeof setTimeout>;
+    return function (this: any, ...args: any[]) {
+      clearTimeout(timeoutId);
+      timeoutId = setTimeout(() => fn.apply(this, args), ms);
+    };
+  };

+  const debouncedSetSearchQuery = debounce(setSearchQuery, 300);

   // Later in the CommandInput component:
   <CommandInput
     placeholder="Type a command or search..."
-    onValueChange={setSearchQuery}
+    onValueChange={debouncedSetSearchQuery}
   />
```

---

`110-122`: **Add server icons to improve visual identification in search results.**

Server items in the search results only show text, while they could benefit from visual cues like icons or avatars, similar to how servers are displayed elsewhere.


```diff
                  {searchResults.servers.map((server) => (
                    <CommandItem
                      key={server.id}
                      className="cursor-pointer"
                      onSelect={() => handleServerSelect(server)}
                    >
+                     <div className="flex items-center gap-2">
+                       <div className="w-5 h-5 rounded-full overflow-hidden bg-secondary flex items-center justify-center">
+                         {server.logo ? (
+                           <img src={server.logo} alt={server.name || "Server"} className="w-full h-full object-cover" />
+                         ) : (
+                           <span className="text-xs font-medium">{server.name?.[0] || "S"}</span>
+                         )}
+                       </div>
                      {server.name}
+                     </div>
                    </CommandItem>
                  ))}
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between b7d338d8c7d2a4dcaf3b9ccfccda6117534901e5 and 66d13c0a5fb6de70761550ea54b67fba71212563.

</details>

<details>
<summary>📒 Files selected for processing (8)</summary>

* `apps/web/app/(routes)/communities/page.tsx` (1 hunks)
* `apps/web/app/(routes)/page.tsx` (3 hunks)
* `apps/web/components/custom/all-questions.tsx` (1 hunks)
* `apps/web/components/custom/community/communities.card.tsx` (1 hunks)
* `apps/web/components/custom/navbar/header.tsx` (2 hunks)
* `apps/web/components/custom/navbar/search.comp.tsx` (3 hunks)
* `apps/web/components/custom/user/profile-dialog.tsx` (0 hunks)
* `apps/web/json/dummy.ts` (1 hunks)

</details>

<details>
<summary>💤 Files with no reviewable changes (1)</summary>

* apps/web/components/custom/user/profile-dialog.tsx

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Definitions (2)</summary>

<details>
<summary>apps/web/app/(routes)/page.tsx (4)</summary><blockquote>

<details>
<summary>apps/web/lib/zustand.ts (2)</summary>

* `useServersStore` (74-74)
* `useTagsStore` (74-74)

</details>
<details>
<summary>apps/web/context/content.context.tsx (1)</summary>

* `useContent` (115-121)

</details>
<details>
<summary>apps/web/json/dummy.ts (1)</summary>

* `Threads` (238-293)

</details>
<details>
<summary>apps/web/components/ui/button.tsx (1)</summary>

* `Button` (61-61)

</details>

</blockquote></details>
<details>
<summary>apps/web/app/(routes)/communities/page.tsx (1)</summary><blockquote>

<details>
<summary>apps/web/components/custom/community/communities.card.tsx (1)</summary>

* `CommunityGrid` (10-95)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>🔇 Additional comments (5)</summary><blockquote>

<details>
<summary>apps/web/components/custom/all-questions.tsx (1)</summary>

`97-97`: **Consider compatibility with fixed elements in page layout**

The height change from `calc(100vh - 120px)` to `100vh` will make this container take up the full viewport height. This could potentially cause layout issues if there are fixed elements like headers or footers that need space, as content might now extend underneath them.


The current implementation assumes the container should take the full viewport height. Check if this causes any overflow issues with other elements on the page, particularly with fixed headers or footers.

</details>
<details>
<summary>apps/web/components/custom/navbar/header.tsx (2)</summary>

`43-48`: **LGTM! Good addition of Communities navigation link**

The Communities navigation link is properly implemented with consistent styling and appropriate href. This matches the PR objective of adding a dedicated Communities page.

---

`124-130`: **LGTM! Mobile navigation properly implemented**

The Communities link is correctly added to the mobile menu with proper onClick handler to close the menu when clicked, maintaining consistency with other navigation items.

</details>
<details>
<summary>apps/web/app/(routes)/communities/page.tsx (1)</summary>

`1-74`: **LGTM! Well-structured Communities page implementation**

The Communities page implementation is well-structured overall. It correctly uses React hooks for state management, implements search functionality, updates URL parameters appropriately, and renders a responsive layout. This aligns perfectly with the PR objective of adding a dedicated communities page.

</details>
<details>
<summary>apps/web/components/custom/community/communities.card.tsx (1)</summary>

`78-80`: <details>
<summary>❓ Verification inconclusive</summary>

**Use server-specific descriptions instead of generic text.**

The description is identical for all servers rather than using server-specific information. This creates a confusing user experience where all communities appear to have the same purpose.


```diff
                                    <p className="text-muted-foreground text-sm mt-2">
-                                        This server is a community for the server. It is a place where you can find other people who are interested in the server.
+                                        {server.description || "Join this community to connect with other members and participate in discussions."}
                                    </p>
```

---

🏁 Script executed:

```shell
#!/bin/bash
# Check if ServerType has description property

fd "ServerType" --exec cat {} | grep -A 20 "ServerType" | grep "description"
```

Length of output: 74

---



</details>

**Action Required: Verify Server Description Usage**

The current code uses a generic static description for all servers. It should instead display a server-specific description by leveraging `server.description`—with a fallback text if the property isn’t available. However, our initial verification for a `description` property in the `ServerType` definition did not return any results. **Please manually verify whether the `ServerType` interface (or equivalent type) includes a `description` property.** If it does not, you may need to add it (or adjust the implementation accordingly) to support server-specific descriptions.

**Refactoring Diff Suggestion:**
```diff
<p className="text-muted-foreground text-sm mt-2">
-    This server is a community for the server. It is a place where you can find other people who are interested in the server.
+    {server.description || "Join this community to connect with other members and participate in discussions."}
</p>
```

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-06T20:54:33Z

Review comments:
diff_hunk: @@ -0,0 +1,74 @@
+"use client";
+
+import { Input } from "@/components/ui/input";
+import { Search } from "lucide-react";
+import { useState, useMemo, Suspense, useEffect } from "react";
+import CommunityGrid from "../../../components/custom/community/communities.card";
+import { useServersStore } from "@/lib/zustand";
+import { useSearchParams, useRouter } from "next/navigation";
+
+export default function CommunitiesPage() {
+  const [searchQuery, setSearchQuery] = useState("");
+  const { servers } = useServersStore();
+  const searchParams = useSearchParams();
+  const router = useRouter();
+
+  // Get server name from URL params and set it as initial search query
+  useEffect(() => {
+    const serverName = searchParams.get("server");
+    if (serverName) {
+      setSearchQuery(serverName);
+    }
+  }, [searchParams]);
+
+  const filteredServers = useMemo(() => {
+    if (!searchQuery) {
+      return servers;
+    }
+
+    const normalizedSearch = searchQuery.trim().toLowerCase();
+    return servers.filter((server) => {
+      const serverName = server.name?.trim().toLowerCase() || '';
+      return serverName.includes(normalizedSearch);
+    });
path: apps/web/app/(routes)/communities/page.tsx
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add null check for more robust server filtering**

The server filtering logic doesn't handle potential null or undefined server names, which could cause errors if the server data is incomplete.


Add null checks to prevent potential runtime errors:

```diff
return servers.filter((server) => {
-  const serverName = server.name?.trim().toLowerCase() || '';
+  const serverName = (server.name || '').trim().toLowerCase();
  return serverName.includes(normalizedSearch);
});
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
    return servers.filter((server) => {
      const serverName = (server.name || '').trim().toLowerCase();
      return serverName.includes(normalizedSearch);
    });
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-06T20:54:32Z
author_association: NONE
diff_hunk: @@ -0,0 +1,95 @@
+"use client";
+
+import { Badge } from "@/components/ui/badge";
+import { Card, CardContent } from "@/components/ui/card";
+import {  Mails, Users } from "lucide-react";
+import Image from "next/image";
+import type { ServerType } from "@iflow/types";
+import { Button } from "@/components/ui/button";
+
+export default function CommunityGrid({
+    filteredServers = [],
+}: {
+    filteredServers?: ServerType[];
+}) {    
+
+    const renderLogo = (server: ServerType, size = 56) => (
+        server.logo ? (
+            <Image
+                src={server.logo}
+                alt={server.name || "Server"}
+                width={size}
+                height={size}
+                className="object-cover w-full h-full rounded-full"
+            />
+        ) : (
+            <div className="flex items-center justify-center w-full h-full text-lg font-semibold bg-secondary">
+                {server.name?.[0] || "S"}
+            </div>
+        )
+    );
+
+    return (
+        <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-1 gap-4">
+            {filteredServers.length > 0 ? (
+                filteredServers.map((server) => (
+                    <Card
+                        key={server.id}
+                        className="overflow-hidden transition-all duration-200 hover:shadow-md group py-1 cursor-pointer"
+                    >
+                        <CardContent className="p-3">
+                            <div className="flex items-start gap-3">
+                                <div className="relative flex-shrink-0 w-14 h-14 rounded-full bg-secondary border overflow-hidden">
+                                    {renderLogo(server)}
+                                </div>
+                                <div className="flex flex-col min-w-0 flex-1">
+                                    <div className="flex flex-col lg:flex-row justify-between md:items-center mb-2">
+                                        <div className="flex items-center">
+                                            <span className="font-medium text-primary truncate text-base">
+                                                {server.name}
+                                            </span>
+                                            {/* {server.is_config && ( */}
+                                            <Badge variant="secondary" className="text-xs ml-3 h-5">
+                                                Configured
+                                            </Badge>
+                                        </div>
+                                        <Button className="w-full lg:w-auto mt-2 md:mt-0" onClick={() => {
+                                            if (server.invite_url) {
+                                                window.open(server.invite_url);
+                                            }
+                                        }}>
+                                            Join community
+                                        </Button>
+                                    </div>
+
+                                    <div className="flex flex-col lg:flex-row">
+                                        {server.invite_url && (
+                                            <div className="flex items-center text-muted-foreground text-sm gap-1 md:mr-3">
+                                                <Mails className="size-4 text-primary" />
+                                                <span>100 posts</span>
+                                            </div>
path: apps/web/components/custom/community/communities.card.tsx
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

<details>
<summary>❓ Verification inconclusive</summary>

**Replace hardcoded post count with dynamic data.**

The "100 posts" text appears to be hardcoded instead of using actual data from the server object.


```diff
                                                <Mails className="size-4 text-primary" />
-                                                <span>100 posts</span>
+                                                <span>{server.post_count || 0} posts</span>
```

---

🏁 Script executed:

```shell
#!/bin/bash
# Check if ServerType has post_count property in the types definition

fd "ServerType" --exec cat {} | grep -A 20 "ServerType" | grep "post_count"
```

Length of output: 73

---



</details>

**Manual Verification Required: Dynamic Post Count**

- In file **apps/web/components/custom/community/communities.card.tsx** (lines 69–70), the diff replaces the hardcoded `"100 posts"` with dynamic data using `{server.post_count || 0}`.
- However, the verification command did not locate a `post_count` property in the `ServerType` definitions. Please manually verify that `ServerType` includes a `post_count` property (or is configured to include post-count data) and update the dynamic reference accordingly if needed.


```diff
    <Mails className="size-4 text-primary" />
-   <span>100 posts</span>
+   <span>{server.post_count || 0} posts</span>
```



<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
                                                <Mails className="size-4 text-primary" />
                                                <span>{server.post_count || 0} posts</span>
                                            </div>
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-06T20:54:32Z
author_association: NONE
diff_hunk: @@ -6,12 +6,17 @@ import { Suspense, useState } from "react";
 import { JoinCommunityBtn } from "@/components/custom/join.community.btn";
 import { useServersStore, useTagsStore } from "@/lib/zustand";
 import { useContent } from "@/context/content.context";
-
+import { Button } from "@/components/ui/button";
+import { useRouter } from "next/navigation";
+import { Clock, MessageSquare } from "lucide-react"
+import Link from "next/link"
+import { Threads } from "@/json/dummy"
path: apps/web/app/(routes)/page.tsx
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Use real-time data instead of static dummy data.**

The component imports `Threads` from `@/json/dummy`, which contains static data. For a production application, consider fetching real-time data from an API.


Consider implementing a data fetching mechanism for threads:

```typescript
const [threads, setThreads] = useState(Threads); // Initialize with dummy data
const { isLoading, error } = useThreads(); // Custom hook to fetch real threads

useEffect(() => {
  // Replace with actual API call in production
  async function fetchThreads() {
    try {
      const response = await fetch('/api/threads');
      const data = await response.json();
      setThreads(data);
    } catch (err) {
      console.error('Failed to fetch threads:', err);
    }
  }
  
  fetchThreads();
}, []);
```

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-06T20:54:32Z
author_association: NONE
diff_hunk: @@ -38,6 +43,39 @@ export default function Home() {
 
           {/* Community Form */}
           <aside className="w-full lg:w-[350px] py-10 space-y-6 sticky lg:top-[100px] h-fit flex-shrink-0">
+            <div className="rounded-lg border p-4">
+              <div className="mb-4 flex items-center">
+                <div className="relative flex size-2.5 mr-2">
+                  <div className="absolute inline-flex size-full animate-ping rounded-full bg-green-400 opacity-75"></div>
+                  <div className="relative inline-flex size-full rounded-full bg-green-500"></div>
+                </div>
+                <h2 className="text-xl font-bold">Active Threads</h2>
+              </div>
+              <div className="space-y-3 overflow-y-auto h-[calc(100vh-55vh)] overflow-x-hidden scrollbar-none [&::-webkit-scrollbar]:hidden [-ms-overflow-style:'none'] [scrollbar-width:'none']">
+                {Threads.map((thread) => (
+                  <div
+                    key={thread.id}
+                    className="rounded-md border bg-background p-3 transition-colors"
+                  >
+                    <Link href={`/thread/${thread.id}`} className="block">
+                      <h3 className="font-medium ">{thread.title}</h3>
+                      <p className="mt-1 text-sm text-muted-foreground line-clamp-2">{thread.description}</p>
+
+                      <div className="mt-2 flex items-center gap-4 text-xs text-gray-500 dark:text-gray-400">
+                        <div className="flex items-center gap-1">
+                          <Clock className="h-3.5 w-3.5" />
+                          <span>{thread.lastActive}</span>
+                        </div>
+                        <div className="flex items-center gap-1">
+                          <MessageSquare className="h-3.5 w-3.5" />
+                          <span>{thread.replies} replies</span>
+                        </div>
+                      </div>
+                    </Link>
+                  </div>
+                ))}
path: apps/web/app/(routes)/page.tsx
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add loading and error states for the Threads section.**

The Threads section doesn't have loading or error states, unlike the Communities section below it. This inconsistency could lead to a confusing user experience.


```diff
+              {contentLoading ? (
+                <div className="space-y-3">
+                  {[1, 2, 3].map((i) => (
+                    <div key={i} className="rounded-md border bg-background p-3">
+                      <div className="h-5 bg-primary/60 rounded animate-pulse w-3/4 mb-2" />
+                      <div className="h-4 bg-primary/40 rounded animate-pulse w-full mb-2" />
+                      <div className="flex justify-between mt-2">
+                        <div className="h-3 bg-primary/30 rounded animate-pulse w-1/4" />
+                        <div className="h-3 bg-primary/30 rounded animate-pulse w-1/4" />
+                      </div>
+                    </div>
+                  ))}
+                </div>
+              ) : (
                {Threads.map((thread) => (
                  <div
                    key={thread.id}
                    className="rounded-md border bg-background p-3 transition-colors"
                  >
                    <Link href={`/thread/${thread.id}`} className="block">
                      <h3 className="font-medium ">{thread.title}</h3>
                      <p className="mt-1 text-sm text-muted-foreground line-clamp-2">{thread.description}</p>

                      <div className="mt-2 flex items-center gap-4 text-xs text-gray-500 dark:text-gray-400">
                        <div className="flex items-center gap-1">
                          <Clock className="h-3.5 w-3.5" />
                          <span>{thread.lastActive}</span>
                        </div>
                        <div className="flex items-center gap-1">
                          <MessageSquare className="h-3.5 w-3.5" />
                          <span>{thread.replies} replies</span>
                        </div>
                      </div>
                    </Link>
                  </div>
                ))}
+              )}
```


> Committable suggestion skipped: line range outside the PR's diff.

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-06T20:54:32Z
author_association: NONE
diff_hunk: @@ -59,15 +67,17 @@ export default function SearchInputCommand() {
         setCommandOpen((open) => !open);
       }
     };
-    console.log({
-      tags: tags,
-      users: users,
-      questions: questions,
-    });
+
     document.addEventListener("keydown", down);
     return () => document.removeEventListener("keydown", down);
   }, []);
 
+  const handleServerSelect = (server: ServerType) => {
+    const serverName = server.name?.trim().toLowerCase().replace(/\s+/g, '+') || '';
+    router.push(`/communities?server=${serverName}`);
path: apps/web/components/custom/navbar/search.comp.tsx
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Improve server URL construction for better handling of special characters.**

The current approach to creating a server URL might not handle all special characters correctly. Use `encodeURIComponent` for safer URL parameter construction.


```diff
-    const serverName = server.name?.trim().toLowerCase().replace(/\s+/g, '+') || '';
-    router.push(`/communities?server=${serverName}`);
+    const serverName = server.name?.trim() || '';
+    router.push(`/communities?server=${encodeURIComponent(serverName)}`);
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
    const serverName = server.name?.trim() || '';
    router.push(`/communities?server=${encodeURIComponent(serverName)}`);
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-06T20:54:32Z
author_association: NONE
diff_hunk: @@ -10,47 +10,55 @@ import {
   CommandGroup,
   CommandItem,
 } from "@/components/ui/command";
-import { useTagsStore, useUsersStore } from "@/lib/zustand";
+import { useTagsStore, useUsersStore, useServersStore } from "@/lib/zustand";
 import { questions } from "@/json/dummy";
 import { useRouter } from "next/navigation";
-import { TagType, UserType } from "@iflow/types";
+import { TagType, UserType, ServerType } from "@iflow/types";
 
 export default function SearchInputCommand() {
   const [commandOpen, setCommandOpen] = useState(false);
   const { users } = useUsersStore();
   const { tags } = useTagsStore();
+  const { servers } = useServersStore();
   const router = useRouter();
   const [searchQuery, setSearchQuery] = useState("");
   const [searchResults, setSearchResults] = useState<{
     users: UserType[];
     tags: TagType[];
+    servers: ServerType[];
+    // eslint-disable-next-line @typescript-eslint/no-explicit-any
     questions: any[];
-  }>({ users: [], tags: [], questions: [] });
+  }>({ users: [], tags: [], servers: [], questions: [] });
 
   useEffect(() => {
     if (searchQuery.trim() === "") {
-      setSearchResults({ users: [], tags: [], questions: [] });
+      setSearchResults({ users: [], tags: [], servers: [], questions: [] });
       return;
     }
 
+    const normalizedSearch = searchQuery.trim().toLowerCase();
     const filteredUsers = users.filter((user) =>
-      user.name.toLowerCase().includes(searchQuery.toLowerCase()),
+      user.name.toLowerCase().includes(normalizedSearch),
     );
     const filteredTags = tags.filter((tag) =>
-      tag.name.toLowerCase().includes(searchQuery.toLowerCase()),
+      tag.name.toLowerCase().includes(normalizedSearch),
+    );
+    const filteredServers = servers.filter((server) =>
+      server.name?.trim().toLowerCase().includes(normalizedSearch),
     );
path: apps/web/components/custom/navbar/search.comp.tsx
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Add null check for server name to prevent potential errors.**

The server name is being accessed without proper null checking, which could cause errors if the server object is malformed.


```diff
     const filteredServers = servers.filter((server) =>
-      server.name?.trim().toLowerCase().includes(normalizedSearch),
+      server.name?.trim().toLowerCase().includes(normalizedSearch) ?? false,
     );
```


> Committable suggestion skipped: line range outside the PR's diff.

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-06T20:54:32Z
author_association: NONE

PR comments:
user: login: vercel[bot]
created_at: 2025-04-06T20:50:33Z
body: @rxhul18 is attempting to deploy a commit to the **BlueFinZ** Team on [Vercel](https://vercel.com).

A member of the Team first needs to [authorize it](https://vercel.com/git/authorize?team=BlueFinZ&type=github&job=%7B%22headInfo%22%3A%7B%22sha%22%3A%2266d13c0a5fb6de70761550ea54b67fba71212563%22%7D%2C%22id%22%3A%22QmNWDXnZG79Z4Gb2qtFDuKFWeRYw67gAzpko2GPms5yvpS%22%2C%22org%22%3A%22SkidGod4444%22%2C%22prId%22%3A31%2C%22repo%22%3A%22indexflow%22%7D).


author_association: NONE
user: login: coderabbitai[bot]
created_at: 2025-04-06T20:50:35Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

## Walkthrough
This pull request introduces several community-related features and layout adjustments across the application. A new `CommunitiesPage` component is added to display and filter community servers, with its UI powered by a corresponding `CommunityGrid` component. The Home component now includes an Active Threads section and a “More Communities” button for navigation. The search functionality in the navbar has been extended to support server lookups, and a new navigation link for communities is added. Additionally, a layout change fixes a component’s height, an obsolete profile dialog is removed, and dummy data is updated to feature Threads.

## Changes

| File(s) | Summary of Changes |
|---------|--------------------|
| `apps/web/app/(routes)/communities/page.tsx`, <br> `apps/web/components/custom/community/communities.card.tsx` | Introduced new components: `CommunitiesPage` displays a list of community servers with search functionality, and `CommunityGrid` renders a responsive grid of community cards with join buttons and placeholder content when no servers are found. |
| `apps/web/app/(routes)/page.tsx` | Enhanced the Home component by adding imports for UI elements and a new Active Threads section sourced from a Threads JSON. A "More Communities" button utilizing router navigation was also introduced. |
| `apps/web/components/custom/all-questions.tsx` | Modified a div's height from a dynamic value (`calc(100vh - 120px)`) to a fixed `100vh`, affecting the vertical layout. |
| `apps/web/components/custom/navbar/header.tsx` | Added a new "Communities" link in both the desktop and mobile navigation menus, including an onClick handler in the mobile view to close the menu. |
| `apps/web/components/custom/navbar/search.comp.tsx` | Extended the `SearchInputCommand` component to include server search functionality by integrating `useServersStore`, updating the state to include servers, and adding a handler (`handleServerSelect`) for navigating based on server selection. |
| `apps/web/components/custom/user/profile-dialog.tsx` | Removed the `UserProfileDialog` component along with its associated data fetching logic and state management. |
| `apps/web/json/dummy.ts` | Removed commented-out arrays for popularTags, communities, and users, and added a new `Threads` export containing discussion thread data. |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
  participant User
  participant CP as CommunitiesPage
  participant Router as URL Params
  participant Grid as CommunityGrid

  User->>CP: Load Page with URL Parameters
  CP->>Router: Retrieve search query (useEffect)
  CP->>CP: Initialize search state (useState)
  User->>CP: Types search query
  CP->>CP: handleSearchChange updates state & URL
  CP->>CP: Filters servers using useMemo
  CP->>Grid: Pass filtered servers wrapped in Suspense
  Grid-->>User: Display community cards
```

```mermaid
sequenceDiagram
  participant User
  participant SIC as SearchInputCommand
  participant Store as useServersStore
  participant Nav as Router Navigation

  User->>SIC: Enter search query
  SIC->>Store: Retrieve server data
  SIC->>SIC: Filter search results (users, tags, servers, questions)
  alt Server selected
      SIC->>SIC: handleServerSelect triggers selection
      SIC->>Nav: Navigate to communities page with server identifier
  end
```

## Possibly related PRs
- **SkidGod4444/indexflow#7**: Adds a `JoinCommunity` component enhancing community joining functionality, directly complementing the new community display features.
- **SkidGod4444/indexflow#11**: Enhances the Community component to fetch channels via an API. Works in tandem with the new communities page and grid components.
- **SkidGod4444/indexflow#19**: Involves modifications with `useServersStore` for managing server data, which aligns with the extended server search functionality in the navbar.

## Poem
> I'm a rabbit with a code-filled heart,  
> Hopping through components with a joyful start.  
> Communities blossom in grids so neat,  
> Threads and searches come together in a beat.  
> With every line, my ears twitch with delight,  
> Celebrating changes from morning 'til night! 🐰💻

<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpADK2VmgqyjcVN2wAbb5AokAI7Y0rgANJAYTgKUdJAAzACM6Bj0iNgCzOo09HKQ2IiU/gAesD6JABwR8Bi4FIrYDNKQiPBEGPAAZvAMmLj53LTUzQSQuLAkkAAGaNzciAD0AO4kAlPoc9491PD4GBGI3KJd277yZLCYDDVEYxMKrNgd4s2dJNTYAQfvFAywkJ0nmJdhg0FtcLIIph6AUijUaBROmgmhpIABpEjyP6YUjIGoMbzYJR3SZoWi0dQg/iddCQJQU3o5B7MJ6U5rcNCkCJLBB/dDwZjIUYC3j4KT5Qp8MhETkkNi1FL0eHKYF7SBLdQILDjUmbbbiPaoowAQXJlL2YO8kJJLR+fKYzG4e3YkEuMhIZAGQyZwowBKJk0lUgoiAiOoCeRIxQ5qRuKFwyEBfoNoPB8mhkGYaAA1nH1Jn8AEHrwSBMMK1xZ1CxLKIhUQAxT7h5iFkhh+5eXz+IIhRD9GoSfDeKRC+4BFsSMHUlL5KKFGGSnj1breSYUsH4W4Op3kWoHOrvZhbDoYW46mt8ZWI5Gk1I8fA0WrwS3yEX1CRxo6IwtZv0kDQmhgD4THwQG4Coq6QBcVxyi6qDnvC9S0I0KbTmgMCwAEZL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k4q8BvS46njWjm6QfIlehVbAyv+TkOEQ271ifvl616KYavlMcVIfGV4ZRXTQ5V/ynFiGFM0w8us60D7obMtQ/lnMY1+aoxBs5brQLZ048xVvUDV9K7zvXtbvtZyA/vW7Z6vigf0gV68AQxZqfvbGqJmufv96uA5aT6of0wv6Ww0gZ7PdyfHDuf40FbIhLIpyLfkE7Aq8nCb1iAxEHyS/7ocYyEf6jIM53i1w5TxBTkUCD6d4TpjW/wi/MsV5xTgnySYgqSYta4UHLMJmXQebFq6EVYVu/A2oQrEQKvZfhmFabBk8kP/NUBJCtwyRuYw6bsJvQHiK8DI2JITCaTfQAB1VYPQTDiwlxAWQXiLVx1pwUFulWSXk7RQpLM0KTWc2tIU+Tbdq2E4b7hxUoH59+gcvCfBpSV6QAwovUAXrQCF54BKoO2QmAwMR7x8jmdpHqlwJ4FHo+BiKQQVAGEGs0QUYg2SO7ElAcNuB20XgfwNwDyDOMsuFQeWH6Dj90eQsMnhTw1wYpsURPW6PNAqTNRWo7UFOltFYDsBdoaAfaGnTRgnQmAZ0FQGoEuizQboBgOwb1HUAAB9MHIgHCEBAQCdAcIYnB6x1QQhDUSAAADY0htARIPEAYCN40AAAVk6ACBMhJAAAOyN5ShaQxIPkPyGN53g+QrKMUNKFFC0ApQzvJ3nyFpD4g10WwakLCG4BIhNaGISQDiG0BwhTUHoUAA=== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details>
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=SkidGod4444/indexflow&utm_content=31):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai plan` to trigger planning for file edits and PR creation.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: NONE