Skip to content

Improve Home page UI/UX and readability#190

Open
ankitkr104 wants to merge 1 commit intoAOSSIE-Org:mainfrom
ankitkr104:ui-redesign-home
Open

Improve Home page UI/UX and readability#190
ankitkr104 wants to merge 1 commit intoAOSSIE-Org:mainfrom
ankitkr104:ui-redesign-home

Conversation

@ankitkr104
Copy link

@ankitkr104 ankitkr104 commented Jan 10, 2026

Summary

This PR improves the UI/UX of the Home / Start Debate page while keeping all existing content, theme, icons, and functionality unchanged.

What changed

  • Improved visual hierarchy, spacing, and alignment
  • Increased text size and readability (especially headings)
  • Clearer emphasis on primary call-to-action
  • More balanced and modern hero layout
  • Maintained responsiveness across screen sizes and browsers

What did NOT change

  • No new features added
  • No content changes
  • No logic or backend changes

Screenshots

Before

Screenshot 2026-01-09 213013

After

Screenshot 2026-01-09 223439

Related Issue

Closes #185

Summary by CodeRabbit

Release Notes

  • New Features

    • Added dark/light theme toggle in user menu
    • Redesigned header with comprehensive navigation menu (Start Debate, Tournaments, Team Debates, Leaderboard, Community, About)
    • Improved user profile and notification controls in header
  • UI/Styling

    • Enhanced home and debate pages with larger, bolder typography and improved visual hierarchy
    • Redesigned buttons with improved shadows and hover effects
    • Added text shadow effects for better readability across the app
    • Streamlined app layout with updated navigation structure

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 10, 2026

📝 Walkthrough

Walkthrough

This PR adds backend CLI tools for user management (adduser, updateuser), modifies the signup flow to auto-verify users in development mode while maintaining email verification in production, and comprehensively redesigns the frontend with improved typography, spacing, header navigation with theming support, and custom Tailwind utilities for text shadows.

Changes

Cohort / File(s) Summary
Backend CLI User Tools
backend/cmd/adduser/main.go, backend/cmd/updateuser/main.go
New standalone CLI tools for user management; adduser creates new MongoDB users with hashed passwords and default fields; updateuser modifies password and/or verification status with conditional updates
Auth Controller Signup Flow
backend/controllers/auth.go
Adds conditional logic: when SMTP is configured, sends verification email as before; when SMTP is absent (development), auto-verifies user, generates JWT, and returns accessToken with user payload for immediate login
Frontend Page UI Redesign
frontend/src/Pages/Home.tsx, frontend/src/Pages/StartDebate.tsx
Shifts layout from centered to start-aligned with top padding; dramatically scales typography (headings to 6xl-7xl); enhances button styling with rounded corners, shadows, hover effects, and increased icon sizes; improves visual hierarchy and readability
Header Component & Navigation
frontend/src/components/Header.tsx
Major redesign introducing left logo, center NavLink navigation bar (Start Debate, Tournaments, Team Debates, Leaderboard, Community, About), right user controls with notification popover and avatar menu; adds theming support (Light/Dark with Sun/Moon icons); extends styling for dark mode and drawer (mobile) menu
Layout & Sidebar Restructuring
frontend/src/components/Layout.tsx, frontend/src/components/Sidebar.tsx
Removes Sidebar from Layout, simplifying to single-column design with Header above Outlet; updates Sidebar with shadow/background styling, increases typography sizes (text-xl → text-2xl), and standardizes icon sizing via cloned elements
Tailwind Configuration
frontend/tailwind.config.js
Adds textShadow theme extension with predefined values (sm, DEFAULT, md, lg, xl, 2xl, none); registers custom plugin that provides text-shadow utility group

Sequence Diagrams

sequenceDiagram
    participant User
    participant SignupFlow as Auth Controller
    participant Config as Configuration
    participant DB as MongoDB
    participant Mailer as SMTP Service

    User->>SignupFlow: POST /signup (email, password, name)
    SignupFlow->>Config: Check SMTP configuration
    
    alt SMTP Configured (Production)
        SignupFlow->>DB: Hash password & create user
        SignupFlow->>DB: Generate verification code
        SignupFlow->>Mailer: Send verification email
        SignupFlow-->>User: Return success message
    else SMTP Not Configured (Development)
        SignupFlow->>DB: Hash password & create user
        SignupFlow->>DB: Set isVerified = true
        SignupFlow->>SignupFlow: Generate JWT token
        SignupFlow-->>User: Return accessToken + user data
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Suggested reviewers

  • bhavik-mangla

Poem

🐰 Hops of joy through code so bright,
New users born with CLI might,
Headers dance with themes and shade,
Typography in grand parade,
Dev mode whispers: "skip the mail,"
Let the redesigned UI tell the tale!

🚥 Pre-merge checks | ✅ 2 | ❌ 3
❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning PR implements all key requirements from issue #185: modernized layout, improved typography/readability, prominent CTA, better spacing/alignment, and maintained responsiveness. Backend changes (adduser, updateuser commands) and Header redesign are out of scope for issue #185. Verify these changes align with separate issues or remove them from this PR.
Out of Scope Changes check ⚠️ Warning PR includes unrelated backend CLI tools (adduser, updateuser) and extensive Header redesign beyond the Home/StartDebate page UI scope stated in issue #185. Remove backend CLI changes and Header redesign from this PR, or create separate PRs for those changes with corresponding issues. Keep only Home.tsx and StartDebate.tsx UI updates plus necessary tailwind.config.js changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main focus of the PR: visual/UI improvements to the Home page with emphasis on readability.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/src/components/Header.tsx (1)

258-311: Missing dark mode styling in notification popover content.

The notification popover uses hardcoded light theme colors (text-gray-900, bg-gray-50, border-gray-100, etc.) without dark: variants, causing poor visibility in dark mode.

🎨 Add dark mode variants

Key lines to update:

- <div className="flex items-center justify-between p-4 border-b border-gray-100">
-   <h4 className="font-semibold text-gray-900">Notifications</h4>
+ <div className="flex items-center justify-between p-4 border-b border-gray-100 dark:border-gray-700">
+   <h4 className="font-semibold text-gray-900 dark:text-white">Notifications</h4>

- <div className="divide-y divide-gray-100">
+ <div className="divide-y divide-gray-100 dark:divide-gray-700">

- className={`p-4 hover:bg-gray-50 cursor-pointer transition-colors relative group ${!notification.isRead ? 'bg-blue-50/50' : ''}`}
+ className={`p-4 hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer transition-colors relative group ${!notification.isRead ? 'bg-blue-50/50 dark:bg-blue-900/30' : ''}`}

- <p className="text-sm font-medium leading-none text-gray-900">
+ <p className="text-sm font-medium leading-none text-gray-900 dark:text-white">
🤖 Fix all issues with AI agents
In @backend/cmd/adduser/main.go:
- Around line 66-85: The CLI user creation sets Rating: 1500.0 on the newUser
struct; change it to match the SignUp controller's production default of Rating:
1200.0 (or add a clear comment documenting why the CLI would intentionally use
1500.0). Update the Rating field in the newUser literal in
backend/cmd/adduser/main.go to 1200.0 (or add a comment next to Rating
explaining the deliberate deviation).
- Around line 19-33: The main() function currently sets configPath to
"config/config.prod.yml" which risks accidental production use; change the
default to a development config (e.g., "config/config.dev.yml") or make the flag
required by setting configPath := flag.String("config", "", "Path to config
file") and adding a validation check similar to the email/password/name check
that prints usage and exits if *configPath == ""; update any help text
accordingly to reference the dev default if you choose the default-change
option.

In @backend/cmd/updateuser/main.go:
- Around line 19-33: The default configPath in main currently uses
"config/config.prod.yml", risking accidental production updates; change its
default to a development config (e.g., "config/config.dev.yml") or make the flag
required by setting default to "" and adding a validation that prints an error
and exits if *configPath == ""; update the flag declaration (configPath
variable) and the validation block in main to enforce the new
default/requirement and ensure the help text reflects the change.

In @frontend/src/components/Sidebar.tsx:
- Around line 18-23: The Sidebar component uses hardcoded light-theme classes
and unsafe icon cloning: replace instances of 'bg-white' and 'border-gray-200'
in the Sidebar JSX with the app's design tokens (e.g., 'bg-background' and
'border-border') so the component respects dark mode, and make icon rendering
safe by checking React.isValidElement(icon) before calling
React.cloneElement(icon as ReactElement, ...) — if the check fails, render a
fallback/null; update the same fix for the other occurrence noted around the
cloneElement use (the one at lines ~90-92).

In @frontend/src/Pages/Home.tsx:
- Around line 59-67: The heading h3 uses a span with className
"whitespace-nowrap" which causes overflow inside the right column (container
with md:w-1/3) at md/lg font sizes; fix by making the no-wrap behavior
responsive or adjusting sizing—either remove "whitespace-nowrap" from the span,
replace it with "md:whitespace-normal" (or "whitespace-normal
md:whitespace-nowrap" depending on desired breakpoints), or alternatively reduce
the heading font at md/lg (change md:text-6xl/lg:text-7xl to smaller classes) or
increase the column width (e.g., change md:w-1/3 to md:w-1/2); pick one approach
and update the h3/span className and/or the parent div className accordingly.
🧹 Nitpick comments (10)
backend/cmd/adduser/main.go (1)

41-45: Handle the disconnect error.

The deferred Disconnect call should check for errors to ensure proper cleanup logging.

♻️ Suggested improvement
-	defer db.MongoClient.Disconnect(context.Background())
+	defer func() {
+		if err := db.MongoClient.Disconnect(context.Background()); err != nil {
+			log.Printf("Warning: failed to disconnect from MongoDB: %v", err)
+		}
+	}()
backend/cmd/updateuser/main.go (1)

41-45: Handle the disconnect error.

The deferred Disconnect call should check for errors to ensure proper cleanup logging.

♻️ Suggested improvement
-	defer db.MongoClient.Disconnect(context.Background())
+	defer func() {
+		if err := db.MongoClient.Disconnect(context.Background()); err != nil {
+			log.Printf("Warning: failed to disconnect from MongoDB: %v", err)
+		}
+	}()
backend/controllers/auth.go (1)

190-227: Consider explicit environment detection for the signup flow.

The current implementation uses SMTP credential presence to determine whether to auto-verify users (lines 191-201 for production vs. 201-227 for development). While functional, this approach is implicit and could be fragile if SMTP credentials are temporarily misconfigured.

Consider using an explicit environment variable for clearer intent:

♻️ Suggested improvement
+	isDevelopment := os.Getenv("ENV") == "development" || os.Getenv("ENV") == "dev"
+	
 	// Send verification email (skip in development if SMTP not configured)
-	if cfg.SMTP.Username != "" && cfg.SMTP.Password != "" {
+	if !isDevelopment && cfg.SMTP.Username != "" && cfg.SMTP.Password != "" {
 		err = utils.SendVerificationEmail(request.Email, verificationCode)
 		if err != nil {
 			ctx.JSON(500, gin.H{"error": "Failed to send verification email", "message": err.Error()})
 			return
 		}
 		// Return success response - email verification required
 		ctx.JSON(200, gin.H{
 			"message": "Sign-up successful. Please verify your email.",
 		})
-	} else {
+	} else if isDevelopment {
 		// Development mode: auto-verify user

This makes the environment mode explicit and prevents unintended auto-verification if SMTP is simply misconfigured in production.

frontend/tailwind.config.js (1)

74-83: Verify Tailwind plugin API + consider using tailwindcss/plugin for clarity/compatibility.

matchUtilities is correct here, but this is Tailwind-version-sensitive; please confirm the project’s tailwindcss version supports this usage and that the config loader accepts it as written.

Proposed refactor (more idiomatic plugin wrapper)
+import plugin from 'tailwindcss/plugin'
+
 export default {
   darkMode: ["class"],
   content: [
     "./index.html",
     "./src/**/*.{js,ts,jsx,tsx}",
   ],
   theme: {
     extend: {
@@
     },
   },
   plugins: [
     require("tailwindcss-animate"),
     require("tailwind-scrollbar-hide"),
-    function({ matchUtilities, theme }) {
-      matchUtilities(
-        {
-          'text-shadow': (value) => ({
-            textShadow: value,
-          }),
-        },
-        { values: theme('textShadow') }
-      )
-    },
+    plugin(function ({ matchUtilities, theme }) {
+      matchUtilities(
+        { 'text-shadow': (value) => ({ textShadow: value }) },
+        { values: theme('textShadow') }
+      )
+    }),
   ],
 }
frontend/src/Pages/Home.tsx (1)

65-91: Reduce inline style duplication + verify “Practice with Bot” route/wording matches PR objective.

  • The repeated style={{ textShadow: ... }} / style={{ boxShadow: ... }} blocks are hard to maintain; consider using the new text-shadow-* utilities + Tailwind shadows (or extract shared constants/components).
  • Also please confirm the “no content change” constraint (button labels/headline copy appear updated), and that the Bot CTA navigates to the intended flow (its label now reads “Practice with Bot”).
frontend/src/Pages/StartDebate.tsx (1)

34-77: Consider extracting a shared “Hero + CTA stack” component to avoid Home/StartDebate drift.

These sections are nearly identical (heading + two CTA buttons + shadows). A shared component (and/or shared style tokens using text-shadow-*) will reduce duplication and keep the redesign consistent.

frontend/src/components/Header.tsx (4)

61-66: Inefficient theme switching via repeated toggleTheme calls.

Calling toggleTheme() in a loop causes multiple state updates and potential re-renders. This approach also assumes the toggle cycles themes in a specific order.

Consider extending ThemeContext to expose a direct setTheme(theme: ThemeOptions) method instead of computing clicks and toggling repeatedly.

♻️ Suggested approach

If modifying the context is feasible:

// In theme-provider.tsx, expose setTheme directly
const setTheme = (targetTheme: ThemeOptions) => {
  // directly set the theme state
};

// Then in Header.tsx, simply:
const { theme, setTheme } = useContext(ThemeContext);
// ...
onClick={() => setTheme(option.id)}

If you must keep the current context API, at minimum batch the updates or use a ref to avoid cascading renders.


76-81: Consider memoizing fetchNotifications or adding to deps.

The fetchNotifications function is defined inside the component but not included in the dependency array. While functionally correct here (since user is the key dependency), ESLint's exhaustive-deps rule may warn.

♻️ Option: wrap with useCallback
+ const fetchNotifications = useCallback(async () => {
+   if (user) {
+     const data = await getNotifications();
+     setNotifications(data);
+     setUnreadCount(data.filter(n => !n.isRead).length);
+   }
+ }, [user]);

  useEffect(() => {
    fetchNotifications();
    const interval = setInterval(fetchNotifications, 60000);
    return () => clearInterval(interval);
- }, [user]);
+ }, [fetchNotifications]);

154-154: Redundant shadow styling - inline style overrides Tailwind class.

The inline style={{ boxShadow: '...' }} overrides the Tailwind shadow-2xl class, making it ineffective. Consider using only one approach for consistency.

♻️ Remove redundant class
- <header className="flex items-center justify-between h-20 px-6 border-b border-gray-200 dark:border-gray-700 shadow-2xl bg-white dark:bg-gray-900" style={{ boxShadow: '0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1)' }}>
+ <header className="flex items-center justify-between h-20 px-6 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900" style={{ boxShadow: '0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1)' }}>

Or define a custom shadow utility in Tailwind config to avoid inline styles entirely.


166-245: Consider extracting navigation items to reduce duplication.

The six NavLink components share identical className logic. A data-driven approach would improve maintainability.

♻️ Suggested refactor
const navItems = [
  { to: "/startDebate", icon: MessageSquare, label: "Start Debate" },
  { to: "/tournaments", icon: Trophy, label: "Tournaments" },
  { to: "/team-builder", icon: Users, label: "Team Debates" },
  { to: "/leaderboard", icon: BarChart, label: "Leaderboard" },
  { to: "/community", icon: MessageCircle, label: "Community" },
  { to: "/about", icon: Info, label: "About" },
];

const navLinkClass = ({ isActive }: { isActive: boolean }) =>
  `flex items-center gap-2 px-4 py-3 text-lg font-medium rounded-md transition-colors ${
    isActive
      ? "bg-secondary text-secondary-foreground"
      : "text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white"
  }`;

// In JSX:
<nav className="hidden lg:flex items-center justify-center space-x-8 flex-1">
  {navItems.map(({ to, icon: Icon, label }) => (
    <NavLink key={to} to={to} className={navLinkClass}>
      <Icon className="h-5 w-5" />
      {label}
    </NavLink>
  ))}
</nav>
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cb07eaf and 6f67aad.

⛔ Files ignored due to path filters (1)
  • frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (9)
  • backend/cmd/adduser/main.go
  • backend/cmd/updateuser/main.go
  • backend/controllers/auth.go
  • frontend/src/Pages/Home.tsx
  • frontend/src/Pages/StartDebate.tsx
  • frontend/src/components/Header.tsx
  • frontend/src/components/Layout.tsx
  • frontend/src/components/Sidebar.tsx
  • frontend/tailwind.config.js
🧰 Additional context used
🧬 Code graph analysis (5)
frontend/src/Pages/StartDebate.tsx (1)
frontend/src/components/ui/button.tsx (1)
  • Button (57-57)
frontend/src/components/Header.tsx (2)
frontend/src/context/theme-provider.tsx (1)
  • ThemeContext (18-18)
frontend/src/components/ui/popover.tsx (3)
  • Popover (31-31)
  • PopoverTrigger (31-31)
  • PopoverContent (31-31)
backend/controllers/auth.go (2)
backend/utils/email.go (1)
  • SendVerificationEmail (29-55)
backend/db/db.go (1)
  • MongoDatabase (18-18)
backend/cmd/adduser/main.go (2)
backend/config/config.go (1)
  • LoadConfig (60-92)
backend/db/db.go (3)
  • ConnectMongoDB (40-61)
  • MongoClient (17-17)
  • MongoDatabase (18-18)
frontend/src/Pages/Home.tsx (1)
frontend/src/components/ui/button.tsx (1)
  • Button (57-57)
🔇 Additional comments (8)
backend/cmd/updateuser/main.go (1)

60-77: LGTM: Clean conditional update logic.

The update document construction correctly handles optional fields—only updating password when provided and only setting verification status when the flag is true. The mandatory updatedAt timestamp ensures audit trail consistency.

backend/controllers/auth.go (1)

203-218: LGTM: Proper error handling in development mode auto-verification.

The implementation correctly handles potential failures in both the database update (lines 203-211) and JWT generation (lines 213-218), returning appropriate error responses to the client.

frontend/tailwind.config.js (1)

13-21: Nice addition: centralized textShadow tokens.

This is a clean way to standardize shadow depth across pages/components (especially since the PR aims for consistent hierarchy/readability).

frontend/src/components/Layout.tsx (1)

7-11: Potential UX/regression risk: h-screen overflow-hidden + inner scroll container.

Please verify overlays (dialogs/popups/toasts) and mobile Safari viewport behavior still work as expected when the page scroll is confined to <main>.

frontend/src/components/Header.tsx (4)

3-23: LGTM!

Imports are well-organized and all appear to be utilized in the component.


411-421: Potential overflow in mobile drawer header.

The drawer is w-64 (256px) but contains text-3xl branding text plus a logo image. This may cause horizontal overflow or cramped layout on smaller screens.

Consider using smaller text (text-xl or text-2xl) in the drawer header, or verify the layout renders correctly across device widths.


350-390: LGTM!

Theme selection UI is well-implemented with proper dark mode support and clear visual indicators for the current theme selection.


488-505: LGTM!

The NavItem component is well-structured with proper TypeScript typing and comprehensive dark mode support.

Comment on lines +19 to +33
func main() {
// Parse command line flags
email := flag.String("email", "", "User email (required)")
password := flag.String("password", "", "User password (required)")
name := flag.String("name", "", "User display name (required)")
configPath := flag.String("config", "config/config.prod.yml", "Path to config file")
flag.Parse()

// Validate required fields
if *email == "" || *password == "" || *name == "" {
fmt.Println("Error: email, password, and name are required")
fmt.Println("\nUsage:")
flag.PrintDefaults()
os.Exit(1)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Reconsider the default config path for a development tool.

The tool defaults to config/config.prod.yml (line 24) but the comment on line 79 indicates this is for development use ("Auto-verify for development"). Consider defaulting to a development config or making the config flag required to prevent accidental operations against production databases.

🔧 Suggested fix
-	configPath := flag.String("config", "config/config.prod.yml", "Path to config file")
+	configPath := flag.String("config", "config/config.dev.yml", "Path to config file")

Or make it required:

 	configPath := flag.String("config", "config/config.prod.yml", "Path to config file")
 	flag.Parse()

 	// Validate required fields
-	if *email == "" || *password == "" || *name == "" {
-		fmt.Println("Error: email, password, and name are required")
+	if *email == "" || *password == "" || *name == "" || *configPath == "config/config.prod.yml" {
+		fmt.Println("Error: email, password, name, and config are required")
 		fmt.Println("\nUsage:")
 		flag.PrintDefaults()
 		os.Exit(1)
 	}
📝 Committable suggestion

‼️ 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.

Suggested change
func main() {
// Parse command line flags
email := flag.String("email", "", "User email (required)")
password := flag.String("password", "", "User password (required)")
name := flag.String("name", "", "User display name (required)")
configPath := flag.String("config", "config/config.prod.yml", "Path to config file")
flag.Parse()
// Validate required fields
if *email == "" || *password == "" || *name == "" {
fmt.Println("Error: email, password, and name are required")
fmt.Println("\nUsage:")
flag.PrintDefaults()
os.Exit(1)
}
func main() {
// Parse command line flags
email := flag.String("email", "", "User email (required)")
password := flag.String("password", "", "User password (required)")
name := flag.String("name", "", "User display name (required)")
configPath := flag.String("config", "config/config.dev.yml", "Path to config file")
flag.Parse()
// Validate required fields
if *email == "" || *password == "" || *name == "" {
fmt.Println("Error: email, password, and name are required")
fmt.Println("\nUsage:")
flag.PrintDefaults()
os.Exit(1)
}
🤖 Prompt for AI Agents
In @backend/cmd/adduser/main.go around lines 19 - 33, The main() function
currently sets configPath to "config/config.prod.yml" which risks accidental
production use; change the default to a development config (e.g.,
"config/config.dev.yml") or make the flag required by setting configPath :=
flag.String("config", "", "Path to config file") and adding a validation check
similar to the email/password/name check that prints usage and exits if
*configPath == ""; update any help text accordingly to reference the dev default
if you choose the default-change option.

Comment on lines +66 to +85
// Create new user
now := time.Now()
newUser := models.User{
Email: *email,
Password: string(hashedPassword),
DisplayName: *name,
Nickname: *name,
Bio: "Test user account",
Rating: 1500.0,
RD: 350.0,
Volatility: 0.06,
LastRatingUpdate: now,
AvatarURL: "https://avatar.iran.liara.run/public/10",
IsVerified: true, // Auto-verify for development
Score: 0,
Badges: []string{},
CurrentStreak: 0,
CreatedAt: now,
UpdatedAt: now,
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for all Rating initializations in Go files
rg -n 'Rating:\s*[0-9]+' --type=go -C 2

Repository: AOSSIE-Org/DebateAI

Length of output: 8539


🏁 Script executed:

#!/bin/bash
# Also search with decimal notation
rg -n 'Rating:\s*[0-9]+\.[0-9]+' --type=go -C 2

Repository: AOSSIE-Org/DebateAI

Length of output: 995


🏁 Script executed:

#!/bin/bash
# Check the auth.go file specifically around line 167
if [ -f "backend/controllers/auth.go" ]; then
  sed -n '160,175p' backend/controllers/auth.go
fi

Repository: AOSSIE-Org/DebateAI

Length of output: 625


🏁 Script executed:

#!/bin/bash
# Get a broader view of the file to understand the structure
fd 'auth.go' --type=f | head -5

Repository: AOSSIE-Org/DebateAI

Length of output: 187


Align user creation defaults across CLI and signup controller.

The CLI tool (backend/cmd/adduser/main.go line 74) sets Rating: 1500.0, while the SignUp controller (backend/controllers/auth.go lines 82 and 167) consistently uses Rating: 1200.0. The signup flow is the production standard; the CLI should use the same default value for consistency. If the higher rating in the CLI is intentional for development purposes, it should be documented.

🤖 Prompt for AI Agents
In @backend/cmd/adduser/main.go around lines 66 - 85, The CLI user creation sets
Rating: 1500.0 on the newUser struct; change it to match the SignUp controller's
production default of Rating: 1200.0 (or add a clear comment documenting why the
CLI would intentionally use 1500.0). Update the Rating field in the newUser
literal in backend/cmd/adduser/main.go to 1200.0 (or add a comment next to
Rating explaining the deliberate deviation).

Comment on lines +19 to +33
func main() {
// Parse command line flags
email := flag.String("email", "", "User email (required)")
password := flag.String("password", "", "New password (optional)")
verify := flag.Bool("verify", false, "Set user as verified")
configPath := flag.String("config", "config/config.prod.yml", "Path to config file")
flag.Parse()

// Validate required fields
if *email == "" {
fmt.Println("Error: email is required")
fmt.Println("\nUsage:")
flag.PrintDefaults()
os.Exit(1)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Reconsider the default config path for a development tool.

Similar to the adduser tool, this defaults to config/config.prod.yml (line 24), which poses a risk of unintended updates to production data. Consider using a development config by default or requiring the config flag explicitly.

🔧 Suggested fix
-	configPath := flag.String("config", "config/config.prod.yml", "Path to config file")
+	configPath := flag.String("config", "config/config.dev.yml", "Path to config file")
📝 Committable suggestion

‼️ 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.

Suggested change
func main() {
// Parse command line flags
email := flag.String("email", "", "User email (required)")
password := flag.String("password", "", "New password (optional)")
verify := flag.Bool("verify", false, "Set user as verified")
configPath := flag.String("config", "config/config.prod.yml", "Path to config file")
flag.Parse()
// Validate required fields
if *email == "" {
fmt.Println("Error: email is required")
fmt.Println("\nUsage:")
flag.PrintDefaults()
os.Exit(1)
}
func main() {
// Parse command line flags
email := flag.String("email", "", "User email (required)")
password := flag.String("password", "", "New password (optional)")
verify := flag.Bool("verify", false, "Set user as verified")
configPath := flag.String("config", "config/config.dev.yml", "Path to config file")
flag.Parse()
// Validate required fields
if *email == "" {
fmt.Println("Error: email is required")
fmt.Println("\nUsage:")
flag.PrintDefaults()
os.Exit(1)
}
🤖 Prompt for AI Agents
In @backend/cmd/updateuser/main.go around lines 19 - 33, The default configPath
in main currently uses "config/config.prod.yml", risking accidental production
updates; change its default to a development config (e.g.,
"config/config.dev.yml") or make the flag required by setting default to "" and
adding a validation that prints an error and exits if *configPath == ""; update
the flag declaration (configPath variable) and the validation block in main to
enforce the new default/requirement and ensure the help text reflects the
change.

Comment on lines +18 to 23
<aside className='hidden md:flex flex-col w-64 border-r border-gray-200 shadow-md bg-white'>
{/* Logo / Brand */}
<div className='flex items-center h-16 px-4 border-b border-gray-200'>
<div className='flex items-center h-16 px-4 border-b border-gray-200 shadow-sm bg-white'>
<div className='flex items-center gap-2'>
<span className='text-xl font-bold'>DebateAI by</span>
<span className='text-2xl font-bold'>DebateAI by</span>
<img
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix dark-mode theming + make icon rendering safe (current cloneElement can throw).

  1. bg-white/border-gray-200 will look wrong in dark mode; prefer the app’s tokenized colors (e.g., bg-background, border-border).
  2. React.cloneElement(icon as React.ReactElement, ...) will crash if icon is ever omitted or not a valid element (and icon is currently optional).
Suggested patch (theme tokens + guarded icon cloning)
 function Sidebar() {
   return (
-    <aside className='hidden md:flex flex-col w-64 border-r border-gray-200 shadow-md bg-white'>
+    <aside className='hidden md:flex flex-col w-64 border-r border-border shadow-md bg-background'>
       {/* Logo / Brand */}
-      <div className='flex items-center h-16 px-4 border-b border-gray-200 shadow-sm bg-white'>
+      <div className='flex items-center h-16 px-4 border-b border-border shadow-sm bg-background'>
         <div className='flex items-center gap-2'>
-          <span className='text-2xl font-bold'>DebateAI by</span>
+          <span className='text-2xl font-bold text-foreground'>DebateAI by</span>
@@
 interface NavItemProps {
   to: string;
   label: string;
-  icon?: React.ReactNode;
+  icon?: React.ReactElement;
 }
 
 function NavItem({ to, label, icon }: NavItemProps) {
   return (
@@
-      <span className="mr-3 h-5 w-5 flex items-center justify-center">
-        {React.cloneElement(icon as React.ReactElement, { className: 'h-5 w-5' })}
-      </span>
+      {icon && (
+        <span className="mr-3 h-5 w-5 flex items-center justify-center">
+          {React.cloneElement(icon, { className: 'h-5 w-5' })}
+        </span>
+      )}
       {label}
     </NavLink>
   );
 }

Also applies to: 90-92

🤖 Prompt for AI Agents
In @frontend/src/components/Sidebar.tsx around lines 18 - 23, The Sidebar
component uses hardcoded light-theme classes and unsafe icon cloning: replace
instances of 'bg-white' and 'border-gray-200' in the Sidebar JSX with the app's
design tokens (e.g., 'bg-background' and 'border-border') so the component
respects dark mode, and make icon rendering safe by checking
React.isValidElement(icon) before calling React.cloneElement(icon as
ReactElement, ...) — if the check fails, render a fallback/null; update the same
fix for the other occurrence noted around the cloneElement use (the one at lines
~90-92).

Comment on lines +59 to 67
<div className="flex items-start justify-center pt-8">
<div className="flex flex-wrap items-start justify-center w-full px-2 md:px-16">
<div className="w-full md:w-2/3 p-4 md:p-16">
<img src={DebateCover} alt="Debate Cover" className="w-full object-cover" />
</div>
<div className="flex w-full md:w-1/3 flex-col items-center justify-center space-y-4 p-4">
<h3 className="text-xl md:text-4xl font-bold text-center">
Play Debate Online on the <span className="text-primary">#1</span> Site!
<div className="flex w-full md:w-1/3 flex-col items-center justify-center space-y-8 p-4 pt-16 min-h-[600px]">
<h3 className="text-2xl md:text-6xl lg:text-7xl font-extrabold text-center leading-tight tracking-tight drop-shadow-2xl shadow-black/50" style={{ textShadow: '4px 4px 8px rgba(0, 0, 0, 0.5), 2px 2px 4px rgba(0, 0, 0, 0.3)' }}>
<span className="whitespace-nowrap">Play Debate Online</span><br />on the <span className="text-primary font-black drop-shadow-xl shadow-black/60">#1</span> Site!
</h3>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

find . -name "Home.tsx" -path "*/frontend/*"

Repository: AOSSIE-Org/DebateAI

Length of output: 92


🏁 Script executed:

cd frontend && find . -name "Home.tsx" | head -5

Repository: AOSSIE-Org/DebateAI

Length of output: 83


🏁 Script executed:

git ls-files "frontend/src/Pages/Home.tsx"

Repository: AOSSIE-Org/DebateAI

Length of output: 90


🏁 Script executed:

cat -n frontend/src/Pages/Home.tsx | sed -n '55,100p'

Repository: AOSSIE-Org/DebateAI

Length of output: 3401


🏁 Script executed:

wc -l frontend/src/Pages/Home.tsx

Repository: AOSSIE-Org/DebateAI

Length of output: 94


Fix whitespace-nowrap overflow on medium+ screens where heading text exceeds 1/3-width container.

The heading "Play Debate Online" with whitespace-nowrap at md:text-6xl lg:text-7xl will overflow its md:w-1/3 container. At md breakpoint (768px), the content div is ~213px wide; at lg (1024px), ~298px—insufficient for a 60-72px font size without wrapping. Consider removing whitespace-nowrap or adjusting the responsive width/font scaling to prevent horizontal overflow.

🤖 Prompt for AI Agents
In @frontend/src/Pages/Home.tsx around lines 59 - 67, The heading h3 uses a span
with className "whitespace-nowrap" which causes overflow inside the right column
(container with md:w-1/3) at md/lg font sizes; fix by making the no-wrap
behavior responsive or adjusting sizing—either remove "whitespace-nowrap" from
the span, replace it with "md:whitespace-normal" (or "whitespace-normal
md:whitespace-nowrap" depending on desired breakpoints), or alternatively reduce
the heading font at md/lg (change md:text-6xl/lg:text-7xl to smaller classes) or
increase the column width (e.g., change md:w-1/3 to md:w-1/2); pick one approach
and update the h3/span className and/or the parent div className accordingly.

@ankitkr104
Copy link
Author

Thanks for the automated review!
This PR is intentionally scoped to Home page UI/UX improvements only.
I’ve removed unrelated backend changes and limited the update to frontend UI files.
Looking forward to any feedback.

@ayush00git
Copy link
Contributor

Hey @ankitkr104
The idea of shifting from sidebar to navbar is really good as seen from your screenshot, but could you please explain why the backend files are changed and also the file tailwind.config.js is changed. I'm not a maintainer, just a contributor trying to help, as I can see that's it's your first PR here.
My recommendations -

  • You should revert the backend changes to avoid coderabbit's yellow pins.
  • Also avoid defining a single style globally, rather use tailwind's inline classes to do that drop-shadow effect.
    Hope it would help : )

@ankitkr104
Copy link
Author

hey @ayush00git ,
Thanks a lot for the detailed feedback, really appreciate it!
You’re right — the backend changes were unintentional and I’ve already reverted them to keep the PR strictly frontend/UI-focused and avoid unnecessary CodeRabbit warnings.

Regarding tailwind.config.js, that was added to experiment with a consistent shadow style, but I understand your point. I’ll move that styling to Tailwind utility classes instead of defining it globally to keep the design simpler and more maintainable.

Thanks again for pointing this out — it definitely helps improve the quality of the PR 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI/UX Home Page Redesign

2 participants