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