Arrange the Code. Build the Solution.
A Next.js 14 fullstack application for a one-time coding competition event with drag-and-drop code block arrangement, real-time scoring, and anti-cheat measures.
- Drag & Drop Interface: Intuitive code block arrangement using @dnd-kit
- Real-time Leaderboard: Live updates every second with animated rankings
- Admin Dashboard: Complete question management and monitoring
- Anti-Cheat System: Fullscreen enforcement, tab detection, and violation tracking
- Futuristic UI: Glassmorphism effects, neon glows, and animated backgrounds
- Secure Scoring: Server-side calculation with time bonuses and penalties
- Framework: Next.js 14 with App Router
- Language: TypeScript (strict mode)
- Database: SQLite with Prisma ORM (WAL mode)
- Styling: Tailwind CSS v3 + shadcn/ui components
- Animations: Framer Motion
- Drag & Drop: @dnd-kit
- Code Execution: Piston API (C language)
- Node.js 18+ and npm
- Git
- Clone the repository
git clone <repository-url>
cd chain-reaction- Install dependencies
npm install- Set up the database
npx prisma generate
npx prisma db push- Seed the database (optional)
node prisma/seed.js- Create environment file
Create a .envfile in the root directory:
DATABASE_URL="file:./dev.db"npm run devnpm run build
npm run startAdmin access is available for authorized personnel only.
/app
  /api          → Backend API routes
  /meowin       → Admin section
  /contest      → Student contest page
  /login        → Team login
  /practice     → Practice mode
/components
  /ui           → shadcn components
  /contest      → Contest-specific
  /shared       → Shared components
/lib            → Utilities, DB client, scoring
/prisma         → Database schema
- ✅ Create and manage questions with multi-step wizard
- ✅ Live leaderboard with scan animation
- ✅ Team management and monitoring
- ✅ Violation tracking
- ✅ Export results to CSV
- ✅ Drag-and-drop code block arrangement
- ✅ Check answer functionality (1 free test)
- ✅ Real-time timer and scoring
- ✅ Practice mode for learning
- ✅ Fullscreen enforcement
- ✅ Anti-cheat protection
- Base Points: 100 points per question
- Match %: 100% = full points, <100% = halved points
- Time Bonus: +10% if under goal time
- Test Penalty: -25 points per test after 1st free test
- Violation Penalty: Progressive (20, 30, 40...)
- Primary: #00ff88 (Neon Green)
- Accent: #00d4ff (Electric Blue)
- Background: #0a0a0a (Dark)
- Cards: #1a1a1a with glassmorphism
- Glassmorphism cards with backdrop blur
- Neon glow effects on interactive elements
- Animated particle background
- Scan line animations on tables
- Smooth transitions and micro-interactions
- Server-side authentication
- Hardcoded admin credentials (change for production!)
- Anti-cheat measures:
- Fullscreen enforcement
- Tab switch detection
- Copy/paste disabled
- Right-click disabled
- Mobile device blocking
 
Main Tables:
- Team- Team information and scores
- Question- Contest questions
- Attempt- Submission history
- QuestionProgress- Team progress per question
- Violation- Anti-cheat violations
Tailwind CSS PostCSS Error:
npm uninstall tailwindcss @tailwindcss/postcss @tailwindcss/node
npm install -D tailwindcss@^3.4.17Database Issues:
npx prisma generate
npx prisma db push- Dev server not starting: Delete .nextfolder andnode_modules, then reinstall
- Database locked: Close all connections and restart
- Linting errors: Build uses ignoreDuringBuilds: truefor flexibility
- ESLint and TypeScript errors ignored during builds
- Customize in production for stricter validation
- Dark mode configured
- Custom colors and animations
- Responsive design (desktop only, 1024px+)
npm run dev      # Start development server
npm run build    # Build for production
npm run start    # Start production server
npm run lint     # Run ESLintThis is a one-time event platform. For improvements:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - See LICENSE file for details
- Next.js team for the amazing framework
- shadcn for the beautiful UI components
- Prisma for the excellent ORM
- Tailwind CSS for utility-first styling
Built with ❤️ for coding competitions
For detailed setup instructions, see LOCAL_SETUP_GUIDE.md