Skip to content

Conversation

@DengreSarthak
Copy link
Member

@DengreSarthak DengreSarthak commented Jul 25, 2025

Summary by CodeRabbit

  • New Features

    • Added support for ERC20 token prize pools in hackathons, including token approval and symbol display.
    • Introduced timezone-aware date and time handling for hackathon creation and display.
    • Enabled project editing and optional prize recipient address during submission.
    • Added dedicated judge voting and organizer management interfaces.
    • Launched organizer profile pages with hackathon history.
  • UI/UX Improvements

    • Redesigned landing, explorer, and hackathon detail pages for a more polished and consistent look.
    • Enhanced navigation with clearer active states and improved styling.
    • Improved hackathon cards, status badges, and carousel interactions.
    • Updated forms with better validation, tooltips, and input controls.
  • Bug Fixes

    • Corrected contract data fetching and project/judge information display.
    • Fixed conditional rendering for voting and management actions based on user roles and hackathon status.
  • Chores

    • Removed mock/demo data and legacy code.
    • Updated contract ABIs and addresses for compatibility with new features.
    • Added new utility modules for time formatting and contract interactions.

@DengreSarthak DengreSarthak merged commit 6868353 into main Jul 25, 2025
1 check was pending
@coderabbitai
Copy link

coderabbitai bot commented Jul 25, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update delivers a comprehensive overhaul of the hackathon platform's codebase, focusing on blockchain integration, ERC20 token prize support, and UI/UX refinement. Major changes include new and updated contract ABIs, removal of mock data, dynamic blockchain data fetching, ERC20 approval logic, timezone-aware date handling, and significant UI restyling. Several new client components and utilities were introduced, while obsolete hooks and theme providers were deprecated or removed.

Changes

File(s) / Area Change Summary
app/[hackathon]/InteractionClient.tsx Added ERC20 prize support, prize recipient logic, project editing, judge panel access, extensive UI restyling, and improved data fetching from contracts.
app/[hackathon]/judge/JudgeVotingClient.tsx
app/[hackathon]/judge/page.tsx
New judge voting client and page: enables judges to allocate votes/tokens to projects, batch voting, and dynamic UI with blockchain integration.
app/createHackathon/page.tsx Added ERC20 prize pool support, token approval flow, timezone-aware date handling, and improved form validation and UI.
app/explorer/page.tsx Removed mock/demo data, updated contract data fetching, restructured UI to show categorized hackathon lists, and simplified filtering.
app/globals.css
tailwind.config.ts
Added custom scrollbar, line clamping, infinite scroll animation, and improved date/time picker styles.
app/layout.tsx
components/theme-provider.tsx
providers/ThemeProvider.tsx
Disabled and commented out theme provider logic; layout now only uses WalletProvider.
app/manage/page.tsx New management page for organizers: adjust judge tokens, conclude hackathon, and view hackathon/judge stats, all via contract calls.
app/myHackathons/page.tsx Updated contract calls, improved UI/UX, corrected logic for voting and management buttons, and restyled cards and tabs.
app/organizer/[address]/OrganizerClient.tsx
app/organizer/[address]/page.tsx
New organizer client and page: fetches, filters, and displays hackathons organized by a specific address with robust blockchain integration.
app/page.tsx Refactored home page to fetch live blockchain data, introduced a carousel of recent hackathons, and removed static/featured sections.
components/navigation.tsx Improved active/inactive navigation button styling and header background.
hooks/useHackathons.ts Removed all hook logic; only utility functions remain. Project interface extended with prizeRecipient and formattedPrize fields.
lib/data.ts Deleted all mock data, types, and related utility functions.
next.config.mjs Removed ESLint/TypeScript ignore settings, set output to 'export', changed build directory to 'out'.
tsconfig.json Reformatted arrays for clarity and reordered include paths; no functional changes.
utils/contractABI/HackHub.ts Major ABI overhaul: renamed/retyped functions/events/errors, improved parameter clarity, and removed obsolete functions.
utils/contractABI/HackHubFactory.ts Updated ABI: reordered/renamed parameters, added new error types, and clarified hackathon retrieval functions.
utils/contractABI/HackHubUtils.ts New: Utility ABI and TypeScript helpers for array manipulation (slice, remove, move) and related error types.
utils/contractABI/Interfaces.ts New: Defines ERC20, HackHubFactory, and Ownable interfaces and their ABIs, plus contract config typing.
utils/contractAddress.ts Updated Scroll Sepolia factory contract address.
utils/timeUtils.ts New: Utility functions for UTC/local date/time conversion, formatting, and validation.

Sequence Diagram(s)

ERC20 Prize Hackathon Creation and Submission

sequenceDiagram
    participant User
    participant CreatePage
    participant ERC20Token
    participant HackHubFactory

    User->>CreatePage: Fill form (select ERC20, enter token address)
    CreatePage->>ERC20Token: Check allowance
    alt Not approved
        CreatePage->>ERC20Token: Send approve(prizeAmount)
        ERC20Token-->>CreatePage: Approval receipt
    end
    User->>CreatePage: Submit form
    CreatePage->>HackHubFactory: createHackathon(..., prizeToken, prizeAmount)
    HackHubFactory-->>CreatePage: Transaction receipt
Loading

Judge Voting Flow

sequenceDiagram
    participant Judge
    participant JudgeVotingClient
    participant HackHubContract

    Judge->>JudgeVotingClient: Allocate votes to projects
    JudgeVotingClient->>HackHubContract: vote(projectId, tokenAmount) [per project or batch]
    HackHubContract-->>JudgeVotingClient: Vote confirmation
    JudgeVotingClient-->>Judge: Update UI with new vote status
Loading

Organizer Management Flow

sequenceDiagram
    participant Organizer
    participant ManagePage
    participant HackHubContract

    Organizer->>ManagePage: Adjust judge tokens
    ManagePage->>HackHubContract: adjustJudgeTokens(judge, amount)
    HackHubContract-->>ManagePage: Confirmation

    Organizer->>ManagePage: Conclude hackathon
    ManagePage->>HackHubContract: concludeHackathon()
    HackHubContract-->>ManagePage: Confirmation
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~90+ minutes

Poem

In fields of code, a hackathon blooms,
With tokens and ETH, new prize pools resume.
Judges now vote, organizers steer,
Projects submit, and winners cheer!
UI shines bright, mock data now gone,
Rabbits rejoice—blockchain hops on!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6f70219 and ea666de.

⛔ Files ignored due to path filters (4)
  • public/block.png is excluded by !**/*.png
  • public/hacka-thon.jpg is excluded by !**/*.jpg
  • public/hackhub.png is excluded by !**/*.png
  • public/handRevolution.png is excluded by !**/*.png
📒 Files selected for processing (26)
  • app/[hackathon]/InteractionClient.tsx (21 hunks)
  • app/[hackathon]/judge/JudgeVotingClient.tsx (1 hunks)
  • app/[hackathon]/judge/page.tsx (1 hunks)
  • app/createHackathon/page.tsx (15 hunks)
  • app/explorer/page.tsx (13 hunks)
  • app/globals.css (2 hunks)
  • app/layout.tsx (2 hunks)
  • app/manage/page.tsx (1 hunks)
  • app/myHackathons/page.tsx (18 hunks)
  • app/organizer/[address]/OrganizerClient.tsx (1 hunks)
  • app/organizer/[address]/page.tsx (1 hunks)
  • app/page.tsx (1 hunks)
  • components/navigation.tsx (2 hunks)
  • components/theme-provider.tsx (1 hunks)
  • hooks/useHackathons.ts (4 hunks)
  • lib/data.ts (0 hunks)
  • next.config.mjs (1 hunks)
  • providers/ThemeProvider.tsx (1 hunks)
  • tailwind.config.ts (1 hunks)
  • tsconfig.json (2 hunks)
  • utils/contractABI/HackHub.ts (17 hunks)
  • utils/contractABI/HackHubFactory.ts (8 hunks)
  • utils/contractABI/HackHubUtils.ts (1 hunks)
  • utils/contractABI/Interfaces.ts (1 hunks)
  • utils/contractAddress.ts (1 hunks)
  • utils/timeUtils.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch FrontendSar

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 generate unit tests to generate unit tests for 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.

2 participants