A real-time competitive battle platform built with React + TypeScript + Vite + Supabase, where users can challenge each other using Codeforces problems.
CFClash enables:
- Duel-style battles
- Difficulty-based problem selection
- Real-time syncing of submissions
- Automated Codeforces data synchronization
- Scalable backend powered by Supabase
- 🔐 Authentication via Supabase Auth
- ⚔️ Create and join battle rooms
- 🎯 Dynamic problem selection by difficulty
- 📡 Real-time updates using Supabase Realtime
- 🤖 Codeforces API integration
- ⏱️ Automated contest/problem syncing
- 🧠 Battle tracking and result evaluation
- Frontend: React, TypeScript, Vite
- Backend: Supabase (PostgreSQL + Auth + Realtime)
- External API: Codeforces API
- Deployment: Vercel
- Cron Jobs: Vercel Cron
git clone https://github.com/mhdnazrul/cfclash.git
cd cfclashnpm installCreate a .env.local file:
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
VITE_CF_API_BASE=https://codeforces.com/apinpm run dev- 📌 Setup Guide →
docs/setup.md - 🔄 Workflow Overview →
docs/workflow.md
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build production bundle |
npm run lint |
Run ESLint checks |
npm test |
Run tests with Vitest |
npm run sync:problems |
Sync Codeforces problems to Supabase |
| Variable | Description |
|---|---|
VITE_SUPABASE_URL |
Supabase project URL |
VITE_SUPABASE_ANON_KEY |
Public anon key |
VITE_CF_API_BASE |
Codeforces API base URL (optional) |
⚠️ Never expose the service role key to the public
| Variable | Description |
|---|---|
SUPABASE_URL |
Supabase project URL |
SUPABASE_SERVICE_ROLE_KEY |
Admin/service role key |
CRON_SECRET |
Secret token for securing cron endpoint |
-
Frontend communicates with Supabase directly using anon key
-
Supabase handles:
- Auth
- Database
- Realtime subscriptions
-
Server-side:
- Cron jobs sync Codeforces data
- Scripts populate problems table
-
Codeforces API used for:
- Problem metadata
- Contest data
- Submission polling
- Please read the
/docs/SETUP.mdfile, which has a proper setup guide. - Fork the repo
- Create a feature branch
- Follow existing code style
- Test changes locally
- Submit a pull request
Nazrul Islam B.Sc. in Computer Science and Engineering | Premier University, Chittagong
Passionate about software development, competitive programming, and exploring new technologies like IoT and AI. I love building open-source projects and sharing tech knowledge.
- 🔭 Currently working on: AI Hex Game / shopfinity
- 🌱 Learning & exploring: Mobile App Development and UI/UX Design
- ⚡ Fun fact: I run a YouTube channel called Tech 2 Hi-Tek - Technology for You
- 📫 How to reach me: nazrul.puc.cse@gmail.com