Skip to content

About

fun :)

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

201 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CodeChef-VIT

CookOff 11.0 Portal

The official participant portal for CookOff 11.0, the 11th edition of CodeChef-VIT's premier competitive programming contest. The platform provides participants with a seamless contest experience, from authentication and round progression to problem solving, code execution, submissions, and real-time result tracking.

Live PRs Welcome


πŸš€ Deploy

The CookOff 11.0 participant portal is deployed and accessible at:

https://cookoff.codechefvit.com/


πŸ› οΈ Tech Stack

The portal is built using a modern and scalable web stack:


✨ Features

πŸ” Authentication

  • Google OAuth-based participant authentication.
  • Secure session handling through the backend.
  • Automatic redirection between authentication and protected contest routes.

🏠 Participant Dashboard

  • Participant session information.
  • Current score and contest progress.
  • Round availability and progression.
  • Contest state retrieved directly from the backend.

🏁 Multi-Round Contest Flow

CookOff 11.0 consists of multiple rounds with different problem-solving formats.

  • Round 1: Visual/block-based programming questions.
  • Round 2: Competitive programming problems with an integrated code editor.
  • Round 3: Competitive programming problems with an integrated code editor.
  • Round access is controlled through contest state and round gating.

🧩 Visual Programming

Round 1 introduces a block-based problem-solving interface:

  • Drag-and-drop programming blocks.
  • Block chain construction.
  • Dynamic visual question interaction.
  • Submission of constructed solutions to the backend.

πŸ’» Code Editor

Rounds 2 and 3 provide an integrated coding environment powered by Monaco Editor.

  • Syntax highlighting.
  • Multiple programming languages.
  • Code persistence while solving questions.
  • Custom input execution.
  • Public testcase execution.
  • Compilation and execution feedback.

πŸ“€ Code Submission

  • Submit solutions directly from the contest portal.
  • Backend-powered judging.
  • Submission status tracking.
  • Result polling for submitted solutions.
  • Compiler and testcase feedback.

πŸ§ͺ Custom Run

Participants can test their solutions before submitting:

  • Execute code against custom input.
  • Run against public testcases.
  • View execution results directly inside the portal.

⏱️ Contest Timer

  • Contest timing is synchronized with the backend.
  • Countdown information is retrieved from the contest server.
  • Contest state is reflected throughout the participant interface.

πŸ’Ύ Progress Persistence

Important participant state is persisted locally, including:

  • Code drafts.
  • Selected languages.
  • Custom input.
  • Question-specific progress.

This allows participants to recover their work after refreshing the page.


πŸ›οΈ Frontend Architecture

The CookOff 11.0 portal is built using the Next.js App Router and follows a component-based architecture.

Application Structure

The application is broadly divided into:

  • App Routes β€” Authentication, dashboard, rounds and question pages.
  • API Layer β€” Centralized communication with the CookOff backend.
  • Components β€” Reusable UI and contest-specific components.
  • Hooks β€” Reusable client-side logic.
  • Stores β€” Global client-side state using Zustand.
  • Schemas β€” Runtime validation using Zod.
  • Types β€” Shared TypeScript types.
  • Utilities β€” Common helper functions.

Route Structure

src/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (auth)/
β”‚   β”‚   └── login/
β”‚   β”œβ”€β”€ (protected)/
β”‚   β”‚   β”œβ”€β”€ dashboard/
β”‚   β”‚   β”œβ”€β”€ round/
β”‚   β”‚   └── loading.tsx
β”‚   β”œβ”€β”€ layout.tsx
β”‚   β”œβ”€β”€ page.tsx
β”‚   └── not-found.tsx
β”‚
β”œβ”€β”€ api/
β”‚   β”œβ”€β”€ attempts.ts
β”‚   β”œβ”€β”€ blocks.ts
β”‚   β”œβ”€β”€ client.ts
β”‚   β”œβ”€β”€ questions.ts
β”‚   β”œβ”€β”€ session.ts
β”‚   β”œβ”€β”€ submissions.ts
β”‚   β”œβ”€β”€ testcases.ts
β”‚   β”œβ”€β”€ timer.ts
β”‚   β”œβ”€β”€ visual-submissions.ts
β”‚   └── wire.ts
β”‚
β”œβ”€β”€ components/
β”œβ”€β”€ constants/
β”œβ”€β”€ hooks/
β”œβ”€β”€ lib/
β”œβ”€β”€ schemas/
β”œβ”€β”€ stores/
β”œβ”€β”€ styles/
β”œβ”€β”€ test/
β”œβ”€β”€ types/
└── utils/

πŸ”Œ Backend Communication

The participant portal communicates with a separate backend service responsible for authentication, contest state, questions, submissions and judging.

The backend URL is configured through:

NEXT_PUBLIC_API_URL=

The frontend communicates with APIs including:

GET  /dashboard
POST /logout

GET  /question/round
GET  /question/:id
GET  /question/:id/blocks

POST /submit
GET  /result/:id

POST /runcode
POST /runcustom

GET  /getTime

POST /submit/visual

The authentication flow begins through:

/auth/google

The backend handles Google OAuth and establishes the participant session before redirecting the user back to the portal.


πŸ§ͺ Getting Started

Prerequisites

Make sure you have the following installed:

  • Node.js
  • pnpm
  • A running CookOff 11.0 backend

Installation

Clone the repository:

git clone https://github.com/CodeChefVIT/cookoff-portal-11.0.git
cd cookoff-portal-11.0

Install dependencies:

pnpm install

Environment Variables

Create a local environment file:

cp example.env .env.local

Set the backend URL:

NEXT_PUBLIC_API_URL=http://localhost:8080

Run the Development Server

pnpm dev

The application will be available at:

http://localhost:3000

πŸ“œ Available Scripts

pnpm dev          # Start development server
pnpm build        # Create production build
pnpm start        # Start production server
pnpm lint         # Run ESLint
pnpm lint:fix     # Fix ESLint issues
pnpm format       # Format the project
pnpm format:check # Check formatting
pnpm type-check   # Run TypeScript checks
pnpm test         # Run tests
pnpm test:watch   # Run tests in watch mode

πŸ”— Related Projects


🀝 Contributing

Contributions are welcome and appreciated.

  1. Fork the repository.
  2. Create your feature branch:
git checkout -b feature/AmazingFeature
  1. Commit your changes:
git commit -m "Add AmazingFeature"
  1. Push the branch:
git push origin feature/AmazingFeature
  1. Open a Pull Request.

πŸš€ Contributors

Harshil Maheshwari

Harshil Maheshwari

Upayan Mazumder

Upayan Mazumder

Atharva Sharma

Atharva Sharma

YOGESH-08

Yogesh Kumar

Rithish-2914

Rithish Bajjuri

Radical-11

Vihaan Jain

VPK570

VP Krishna

Dragon-Rage

Ayman Raza Naqvi


πŸ“ License

Distributed under the MIT License. See LICENSE for more information.


Made with ❀️ by CodeChef-VIT

About

fun :)

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages