Skip to content

psgtech-caa/blindCoding

Repository files navigation

Blind Coding Contest Platform

A unique competitive coding platform where participants code under restricted visibility conditions. This contest rewards thinking under uncertainty — not perfect code.

🌟 Features

Blind Coding Modes

  • 🌫️ Fog of Code: Only N lines around your cursor are visible - the rest is hidden in fog
  • 🔇 Echo Mode: No compiler errors, no runtime errors - only output and test results
  • ⏳ Vanishing Code: Lines disappear after a fixed time - code from memory

Platform Features

  • Roll Number Entry: No signup required - join with just your roll number
  • Time-Bound Contests: Automatic start/end with live countdown
  • Real-Time Leaderboard: Track your ranking (hidden during contest if configured)
  • Multiple Languages: Python, Java, C, C++ supported
  • Puter.js Execution: Client-side sandboxed code execution

Admin Dashboard

  • Create and schedule contests
  • Upload problems with weighted test cases
  • Manual scoring (40 points) for code quality
  • View submissions and manage participants

🚀 Quick Start

Prerequisites

  • Node.js 18+ installed
  • npm or yarn

Installation

# Clone the repository
git clone <repository-url>
cd blind-coding-platform

# Install dependencies
npm install

# Generate Prisma client
npm run db:generate

# Push database schema
npm run db:push

# Start development server
npm run dev

Open http://localhost:3000 to view the app.

Environment Variables

Create a .env file in the root directory:

# Database (SQLite by default)
DATABASE_URL="file:./dev.db"

# Optional: Socket.IO server URL for real-time features
NEXT_PUBLIC_SOCKET_URL=""

📁 Project Structure

src/
├── app/                    # Next.js App Router pages
│   ├── admin/             # Admin dashboard
│   ├── api/               # API routes
│   ├── contest/           # Contest pages
│   └── page.tsx           # Home page
├── components/            # React components
│   ├── admin/             # Admin components
│   ├── contest/           # Contest components
│   ├── editor/            # Monaco editor & overlays
│   └── leaderboard/       # Leaderboard components
├── hooks/                 # Custom React hooks
├── lib/                   # Utilities (db, api, scoring)
├── types/                 # TypeScript type definitions
└── constants/             # App constants

🎯 Scoring System

Component Points
Automatic (Test Cases) 60
Manual - Logic 20
Manual - Structure 10
Manual - Edge Cases 10
Total 100

Penalties

  • Compilation Error: -10
  • Runtime Error: -5
  • Timeout: -10

🔧 Tech Stack

  • Framework: Next.js 14 (App Router)
  • Styling: Tailwind CSS
  • Database: Prisma + SQLite (can switch to PostgreSQL)
  • Editor: Monaco Editor (VS Code engine)
  • Execution: Puter.js (client-side sandboxed)
  • Real-time: Socket.IO (optional)

📖 Usage

For Participants

  1. Navigate to /contest
  2. Enter your Roll Number
  3. Select an active contest
  4. Code in the editor with your chosen language
  5. Submit before time runs out!

For Admins

  1. Navigate to /admin
  2. Create a new contest with blind mode settings
  3. Add problems and test cases
  4. Monitor participants and submissions
  5. Add manual scores after contest ends

🛠️ Available Scripts

npm run dev          # Start development server
npm run build        # Build for production
npm run start        # Start production server
npm run lint         # Run ESLint
npm run db:push      # Push schema to database
npm run db:studio    # Open Prisma Studio
npm run db:generate  # Generate Prisma client

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

MIT License - see LICENSE file for details.


Built with ❤️ for competitive coding enthusiasts Contributions are welcome! Please submit a pull request or open an issue for any enhancements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Code Black Event for Thiran

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages