Skip to content

ohmschrodinger/LeetCode-Leaderboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ LeetBoard - Minecraft-Styled LeetCode Leaderboard

A competitive LeetCode leaderboard with weekly rankings, built with Next.js and Supabase. Features a retro Minecraft-inspired dark theme!

Status Next.js TypeScript Supabase


โœจ Features

  • ๐Ÿ” Google OAuth Authentication - Secure sign-in with Google
  • ๐ŸŽฏ LeetCode Integration - Validates and tracks real LeetCode usernames
  • ๐Ÿ“Š Automated Stats Tracking - Hourly updates from LeetCode API
  • ๐Ÿ”„ Weekly Stats - Automatic weekly reset every Monday
  • ๐Ÿ† Points System - Earn points based on difficulty (Easy: 1pt, Medium: 2pt, Hard: 3pt)
  • ๐Ÿ“ˆ Beautiful Leaderboard - Minecraft-styled table with rankings
  • ๐Ÿฅ‡ Rank Badges - Gold/Silver/Bronze for top 3 users
  • โœจ User Highlighting - See your position at a glance
  • ๐Ÿ”€ Multiple Sorting - Sort by weekly points, total solved, or contest rating
  • โšก Manual Refresh - Users can trigger their own stats update
  • ๐Ÿ“ฑ Responsive Design - Works perfectly on mobile, tablet, and desktop
  • ๐Ÿ‘‘ Admin Panel - Manually manage users (admin-only feature) [Coming in Phase 4]
  • ๐ŸŽจ Minecraft Theme - Retro pixel art styling with dark mode

๐Ÿš€ Quick Start

For first-time setup, see: QUICK_START.md
For Phase 2 setup, see: PHASE2_QUICKSTART.md

Prerequisites

  • Node.js 18+
  • Supabase account
  • Google OAuth credentials
  • Vercel account (for cron jobs)

Installation

# Install dependencies
npm install

# Copy environment variables
cp .env.local.example .env.local

# Edit .env.local with your Supabase credentials + CRON_SECRET
# Then run the development server
npm run dev

Visit http://localhost:3000


๐Ÿ“š Documentation


๐Ÿ—๏ธ Project Status

โœ… Phase 1: Authentication & Signup (COMPLETE)

  • Google OAuth integration
  • LeetCode username validation
  • Supabase database setup
  • Minecraft-styled UI theme
  • User profile management

โœ… Phase 2: LeetCode Data Integration (COMPLETE)

  • Fetch user statistics from LeetCode
  • Weekly stats tracking with baseline
  • Automated hourly data refresh via Vercel Cron
  • Points calculation system (E:1, M:2, H:3)
  • Manual refresh button for users
  • Automatic weekly reset (Mondays)

โœ… Phase 3: Leaderboard UI (COMPLETE)

  • Main leaderboard table with Minecraft styling
  • Ranking system with gold/silver/bronze badges
  • Difficulty breakdown display (E:X, M:Y, H:Z)
  • Current user row highlighting
  • Multiple sort options (weekly points, total, rating)
  • Refresh functionality
  • Responsive design for all devices
  • Real-time ranking calculation with tie-breaking

๐Ÿ‘‘ Phase 4: Admin Panel (FINAL)

  • Admin dashboard
  • Manual user management
  • Bulk operations
  • System logs

๐ŸŽจ Design System

The project uses a Minecraft-inspired dark theme with:

  • Pixel font (Press Start 2P)
  • Blocky UI elements with depth/shadows
  • Retro color palette
  • Pixelated scrollbars and inputs

Custom CSS Classes:

  • .mc-button - Minecraft-styled buttons
  • .mc-input - Pixelated input fields
  • .mc-panel - Container panels
  • .mc-table - Leaderboard table

๐Ÿ› ๏ธ Tech Stack

  • Frontend: Next.js 15, React 19, TypeScript, Tailwind CSS 4
  • Backend: Next.js API Routes, Supabase (PostgreSQL)
  • Auth: Supabase Auth with Google OAuth
  • External: LeetCode GraphQL API
  • Deployment: Vercel (recommended)

๐Ÿ“ Project Structure

leetboard/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ api/              # API routes
โ”‚   โ”‚   โ”œโ”€โ”€ auth/             # Auth callbacks
โ”‚   โ”‚   โ”œโ”€โ”€ signup/           # Signup page
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ””โ”€โ”€ supabase/         # Supabase utilities
โ”‚   โ””โ”€โ”€ middleware.ts         # Auth middleware
โ”œโ”€โ”€ public/                   # Static assets
โ”œโ”€โ”€ DATABASE_SCHEMA.md        # SQL schema
โ”œโ”€โ”€ PHASE1_SETUP.md          # Setup guide
โ””โ”€โ”€ PROJECT_ROADMAP.md       # Full roadmap

๐Ÿ”’ Environment Variables

Create a .env.local file with:

NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
ADMIN_EMAIL=your-admin-email@example.com

See .env.local.example for details.


๐Ÿงช Development

# Start dev server
npm run dev

# Build for production
npm run build

# Run production build
npm start

# Lint code
npm run lint

๐Ÿค Contributing

This is a personal project, but feel free to fork and customize it for your own use!


๐Ÿ“ License

MIT License - feel free to use this project however you'd like!


๐ŸŽฏ Roadmap

See PROJECT_ROADMAP.md for the complete 4-phase development plan.

Current Phase: Phase 1 Complete โœ…
Next Up: Phase 2 - LeetCode Data Integration ๐Ÿ”„


Built with โค๏ธ and lots of pixel art

Releases

No releases published

Packages

 
 
 

Contributors