Skip to content

About

admin abuse go brr

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

91 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeChef-VIT

Cookoff 11.0 Admin


Cookoff is CodeChef-VIT's flagship competitive programming event that brings together programmers for an intense competitive coding experience. This repository contains the Admin Portal for Cookoff 11.0 — the central interface for managing participants, questions, testcases, rounds, leaderboards, timers, and contest communication.

🌐 Deploy

The Cookoff 11.0 Admin Portal is deployed at:

Production URL

Replace the URL above if the production deployment uses a different domain.

⚙️ Tech Stack

🔧 Features

🔐 Authentication & Access Control

  • Google-based admin authentication.
  • Protected admin routes through AuthGuard.
  • Cookie-based authentication handled by the backend.
  • Backend session validation for protected operations.

📊 Dashboard & Analytics

  • Admin dashboard with contest analytics.
  • Participant statistics and contest information.
  • Notification sending interface.
  • Visual analytics powered by Recharts.

👥 User Management

  • View and manage registered participants.
  • Searchable user listings.
  • Ban and unban participants.
  • Promote participants to the next round.
  • Bulk round promotion.

📝 Question Management

  • Create, view, update, and delete questions.
  • Manage question metadata.
  • Configure questions for different contest rounds.
  • Manage visual blocks and visual solutions for visual questions.

🧪 Testcase Management

  • Create testcases for questions.
  • View public testcases.
  • Update existing testcases.
  • Delete testcases.
  • Manage testcases on a per-question basis.

⏱️ Round & Contest Control

  • View the current contest timer.
  • Start rounds.
  • Stop/reset round state.
  • Set contest time.
  • Add or update remaining time.
  • Enable rounds from the admin portal.

🏆 Leaderboard

  • View participant rankings.
  • Display scores and rank ordering.
  • Monitor participant performance during the contest.

📢 Notifications

  • Send notifications to participants through the admin portal.
  • Communicate important contest updates directly to users.

🏁 Get Started

Prerequisites

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

Clone

git clone -b main https://github.com/CodeChefVIT/cookoff-admin-11.0.git
cd cookoff-admin-11.0

Install Dependencies

pnpm install

Environment Variables

Create a .env.local file:

cp example.env .env.local

Configure the backend API:

NEXT_PUBLIC_API_URL=http://localhost:8080

The application also uses Firebase configuration variables:

NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=

Run Development Server

pnpm dev

The development server runs on port 3067 as configured in the project.

Production Build

pnpm build
pnpm start

🧱 Repository Structure

cookoff-admin-11.0/
├── src/
│   ├── app/
│   │   ├── (protected)/
│   │   │   ├── dashboard/
│   │   │   ├── leaderboard/
│   │   │   ├── question/
│   │   │   ├── timer/
│   │   │   └── users/
│   │   ├── layout.tsx
│   │   └── page.tsx
│   │
│   ├── api/
│   │   ├── adminDashboard.ts
│   │   ├── client.ts
│   │   ├── questions.ts
│   │   ├── testcases.ts
│   │   ├── timer.ts
│   │   └── users.ts
│   │
│   ├── components/
│   │   ├── Analytics.tsx
│   │   ├── NotificationsSender.tsx
│   │   ├── auth/
│   │   ├── providers/
│   │   ├── ui/
│   │   └── Table/
│   │
│   ├── hooks/
│   ├── lib/
│   ├── schemas/
│   ├── stores/
│   ├── styles/
│   ├── test/
│   ├── types/
│   └── utils/
│
├── public/
├── example.env
├── next.config.js
├── package.json
├── pnpm-lock.yaml
├── tsconfig.json
├── vitest.config.ts
├── README.md
└── AGENTS.md

🔌 Backend API

The admin portal communicates with the Cookoff 11.0 backend through the API client in src/api/client.ts.

Major endpoints include:

Authentication & Session

GET /admin/session

Google authentication is initiated through:

/api/v1/auth/google?portal=admin

User Management

GET  /admin/users
POST /admin/users/:id/ban
POST /admin/users/:id/unban
POST /admin/users/:id/upgrade
POST /admin/users/upgrade-all

Leaderboard

GET /admin/leaderboard

Questions

GET    /question
POST   /question
GET    /question/:id
PUT    /question/:id
DELETE /question/:id

Visual Questions

POST   /question/:questionId/blocks
DELETE /question/blocks/:blockId

POST   /question/:questionId/solutions
DELETE /question/solutions/:solutionId

Testcases

POST   /testcase
GET    /question/:id/testcases
GET    /question/:id/testcases/public
PUT    /testcase/:id
DELETE /testcase/:id

Contest Timer

GET  /getTime
POST /admin/setTime
POST /admin/updateTime
POST /admin/resetRound
POST /admin/startRound
POST /round/enable

🧭 Admin Portal Flow

The application is organized around protected admin routes:

/
├── dashboard
├── leaderboard
├── users
├── question
└── timer
  • / — Admin login and authentication entry point.
  • /dashboard — Contest analytics and notifications.
  • /leaderboard — Participant rankings.
  • /users — Participant management.
  • /question — Question and testcase administration.
  • /timer — Contest and round timing controls.

All protected routes are guarded through the application's authentication layer and depend on a valid backend session.

🧪 Scripts

pnpm dev          # Start development server
pnpm build        # Create production build
pnpm start        # Start production server
pnpm lint         # Run ESLint
pnpm pretty       # Format files with Prettier
pnpm format:check # Check formatting
pnpm type-check   # Run TypeScript checks
pnpm test         # Run Vitest tests

🤝 Contribution Workflow

  1. Fork the repository.
  2. Create a feature branch:
git checkout -b feat/<scope>-<short-description>
  1. Make your changes.
  2. Run the project's checks:
pnpm lint
pnpm type-check
pnpm format:check
pnpm test
  1. Commit your changes using a descriptive commit message:
git commit -m "feat: add bulk user promotion"
  1. Push your branch and open a Pull Request.

For UI changes, include relevant screenshots in the Pull Request.

🔗 Related Projects

These services work together to provide the complete Cookoff 11.0 contest infrastructure.

🚀 Contributors

Harshil Maheshwari

Harshil Maheshwari

Rithish-2914

Rithish Bajjuri

YOGESH-08

Yogesh Kumar

Upayan Mazumder

Upayan Mazumder

VPK570

VP Krishna

📝 License

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

Made with ❤️ by CodeChef-VIT

About

admin abuse go brr

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages