Skip to content

Conversation

rixitgithub
Copy link
Contributor

@rixitgithub rixitgithub commented May 25, 2025

In this PR I have added Google Oauth option for authentication

Summary by CodeRabbit

  • New Features

    • Introduced Google Sign-In for authentication.
    • Added debate bot selection and customizable debate sessions with real-time judging and feedback.
    • Launched a comprehensive leaderboard, user profiles with Elo ratings, and debate history.
    • Enabled online debates with real-time video, chat, and speech transcription.
    • Added AI-powered debate coaching, argument evaluation, and pros/cons challenges.
    • Implemented tournament management, brackets, and match logs.
    • Provided room creation, browsing, and joining for live debates.
    • Integrated detailed judgment popups and feedback analysis.
    • Enhanced UI with new components: sidebar, header, modals, charts, badges, tables, tabs, and toasts.
    • Improved accessibility and responsive design across the platform.
  • Bug Fixes

    • Improved error handling and feedback for authentication and debate flows.
  • Chores

    • Updated dependencies and configuration for enhanced performance and security.
    • Expanded documentation and configuration templates for easier setup.

Zahnentferner and others added 30 commits December 3, 2024 10:38
…-Hide-Password-Functionality-46

password hide-visible feature added ( issue AOSSIE-Org#46 )
…DebateAI

- Added seamless post-sign-in user flow with navigation logic in React
- Implemented profile UI and /user backend routes with edit functionality
- Built leaderboard UI and /leaderboard API, sorting users by EloRating
- Created user and debate schemas in MongoDB with Go integration
- Seeded test data; updated config, auth, and dependencies for full stack support
…es and AI judgment using WebSocket and WebRTC
Copy link

coderabbitai bot commented May 25, 2025

Caution

Review failed

Failed to post review comments.

Walkthrough

This update introduces a comprehensive real-time debate platform with both backend and frontend enhancements. Major changes include a complete backend rewrite for authentication (moving from AWS Cognito to MongoDB/JWT), new debate room and transcript management, debate-vs-bot and coaching features, extensive WebSocket and WebRTC integration, and a fully redesigned frontend with new pages, components, and real-time debate flows.

Changes

Files/Groups Change Summary
backend/cmd/server/main.go, backend/config/config.go, backend/config/config.prod.yml Backend server initialization expanded: new services, MongoDB connection, JWT config, CORS, and route grouping by authentication. Config structs and YAML extended for new services.
backend/controllers/auth.go, backend/routes/auth.go, backend/middlewares/auth.go, backend/utils/auth.go, backend/utils/email.go Authentication refactored from Cognito to MongoDB/JWT, with Google login, password reset, email verification, and supporting utilities.
backend/controllers/debate_controller.go, backend/controllers/debatevsbot_controller.go, backend/controllers/leaderboard.go, backend/controllers/profile_controller.go, backend/controllers/transcript_controller.go, backend/routes/debatevsbot.go, backend/routes/leaderboard.go, backend/routes/profile.go, backend/routes/pros_cons_route.go, backend/routes/rooms.go, backend/routes/transcriptroutes.go, backend/services/ai.go, backend/services/coach.go, backend/services/debatevsbot.go, backend/services/pros_cons.go, backend/services/transcriptservice.go, backend/db/db.go, backend/utils/debate.go, backend/utils/user.go New debate, coaching, leaderboard, transcript, and room management controllers, routes, and services; AI integration with Gemini; MongoDB data seeding and management utilities.
backend/models/*.go New data models for users, debates, debate-vs-bot, transcripts, coaching, and pros/cons evaluation.
backend/websocket/handler.go, backend/websocket/websocket.go Old WebSocket handler commented out; new WebSocket and chat handler implemented for signaling, chat, and room management.
frontend/index.html, frontend/package.json, frontend/src/main.tsx, frontend/src/types/google.d.ts Frontend setup: Google Identity Services script added, new dependencies (Radix UI, Recharts), standard React 18+ bootstrapping, and Google Identity TypeScript types.
frontend/src/App.tsx, frontend/src/context/authContext.tsx, frontend/src/utils/auth.ts App routing refactored for protected routes, Google login integrated into auth context, and new auth token utilities.
frontend/src/Pages/*.tsx New and refactored pages: About, Authentication (with Google login), DebateRoom (bot and online), Leaderboard, Profile, Coach, StrengthenArgument, ProsConsChallenge, TournamentHub, TournamentBracket, TournamentDetails, StartDebate, BotSelection, ChatRoom, MatchLogs, etc.
frontend/src/components/*.tsx, frontend/src/components/ui/*.tsx New UI components: Header, Sidebar, Layout, RoomBrowser, DebatePopup, JudgmentPopup, various Radix UI-based components (badge, dialog, select, progress, tabs, table, textarea, toast, toaster, breadcrumb, chart), and new utility hooks (use-toast).
frontend/src/services/*.ts New service modules for leaderboard, profile, debate-vs-bot, and authentication token management.
frontend/src/index.css New floating animation for chat reactions and other UI effects.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Frontend
    participant Backend
    participant MongoDB
    participant GeminiAI

    User->>Frontend: Initiates login/signup (email/password or Google)
    Frontend->>Backend: Sends credentials or Google ID token
    Backend->>MongoDB: Verifies/creates user, hashes password, manages JWT
    Backend-->>Frontend: Returns JWT token
    Frontend-->>User: Stores token, navigates to app

    User->>Frontend: Starts or joins debate (vs bot or online)
    Frontend->>Backend: Requests debate creation/join (with JWT)
    Backend->>MongoDB: Creates/updates debate room/session
    Backend-->>Frontend: Returns debate/session details

    User->>Frontend: Sends/receives debate messages
    Frontend->>Backend: Submits message via WebSocket or HTTP
    Backend->>GeminiAI: (If vs bot) Generates bot response
    Backend-->>Frontend: Broadcasts messages/responses

    User->>Frontend: Completes debate, requests judgment
    Frontend->>Backend: Sends transcripts/history for judgment
    Backend->>GeminiAI: Judges debate, returns scores/verdict
    Backend-->>Frontend: Returns judgment results

    User->>Frontend: Views leaderboard/profile
    Frontend->>Backend: Fetches data (with JWT)
    Backend->>MongoDB: Retrieves user/debate/leaderboard data
    Backend-->>Frontend: Returns profile/leaderboard
Loading

Possibly related issues

Poem

Hopping through debates, both fierce and bright,
Now with bots and humans, we argue day and night!
JWTs and Mongo keep our secrets tight,
WebSockets bounce, chat bubbles take flight.
From coach to leaderboard, our platform’s in bloom—
Join the room, raise your voice, let the arguments zoom!
🐇✨

✨ 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

8 participants