A modern competitive programming platform where developers can showcase their coding skills, track their progress across multiple platforms, connect with teammates, and participate in tournaments.
- ๐ฏ Multi-Platform Integration: Track your stats from LeetCode and HackerRank
- ๐ Performance Analytics: Visualize your coding progress with interactive graphs
- ๐ฅ Social Features: Connect with friends, send friend requests, and find teammates
- ๐ Leaderboards: Compete with others and climb the rankings
- ๐ฎ Tournaments: Participate in coding competitions
- ๐ผ Project Showcase: Share your projects and discover others' work
- ๐จ Modern UI: Beautiful, responsive interface built with Tailwind CSS
- ๐ Secure Authentication: Powered by Supabase Auth
- Frontend: React 18, TypeScript, Vite
- Styling: Tailwind CSS
- State Management: Zustand
- Backend & Database: Supabase
- Charts: Recharts
- Routing: React Router v6
- HTTP Client: Axios
- Icons: Lucide React
Before you begin, ensure you have:
- Node.js (v18 or higher)
- npm or yarn
- A Supabase account (free tier works great!)
- Git
git clone <your-repo-url>
cd CodeArena-mainnpm install- Go to Supabase Dashboard
- Click "New Project"
- Fill in your project details
- Wait for the project to be provisioned (1-2 minutes)
If your database has expired, you need to either:
- Restore it from the Supabase dashboard (if available)
- Or create a new project and run the migrations
- In your Supabase project dashboard, go to SQL Editor
- Run each migration file in order:
supabase/migrations/20250122044859_empty_tooth.sqlsupabase/migrations/20250122050051_dawn_lantern.sqlsupabase/migrations/20250122050650_bronze_moon.sqlsupabase/migrations/20250123120557_wooden_field.sql
Alternatively, if you have Supabase CLI installed:
npx supabase db push- Copy the example environment file:
cp .env.example .env-
Get your Supabase credentials:
- Go to your Supabase project settings
- Navigate to API section
- Copy the Project URL and anon/public key
-
Update your
.envfile:
VITE_SUPABASE_URL=your-supabase-project-url
VITE_SUPABASE_ANON_KEY=your-supabase-anon-keynpm run devThe app will be available at http://localhost:5173
- Push your code to GitHub:
git add .
git commit -m "Initial commit"
git push origin main-
Go to Vercel
-
Click "Add New Project"
-
Import your GitHub repository
-
Configure your project:
- Framework Preset: Vite
- Build Command:
npm run build - Output Directory:
dist
-
Add Environment Variables in Vercel:
- Go to Settings โ Environment Variables
- Add
VITE_SUPABASE_URLwith your Supabase URL - Add
VITE_SUPABASE_ANON_KEYwith your Supabase anon key
-
Click "Deploy"
Your app will be live in a few minutes! ๐
npm i -g vercel
vercel login
vercelFollow the prompts and add your environment variables when asked.
- Go to Netlify
- Click "Add new site" โ "Import an existing project"
- Connect your GitHub repository
- Configure:
- Build command:
npm run build - Publish directory:
dist
- Build command:
- Add environment variables in Site Settings
- Deploy!
- Install gh-pages:
npm install --save-dev gh-pages- Add to
package.json:
"homepage": "https://your-username.github.io/CodeArena",
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d dist"
}- Update
vite.config.ts:
export default defineConfig({
base: '/CodeArena/',
// ... rest of config
})- Deploy:
npm run deployThe project uses the following main tables:
- profiles: User profiles and information
- friend_requests: Friend connection system
- projects: User project showcases
- tournaments: Competitive coding events
- Additional tables: Check migration files for complete schema
CodeArena-main/
โโโ src/
โ โโโ components/ # React components
โ โโโ lib/ # API clients and utilities
โ โโโ store/ # Zustand state management
โ โโโ types/ # TypeScript type definitions
โ โโโ constants/ # App constants
โโโ supabase/
โ โโโ migrations/ # Database migrations
โโโ public/ # Static assets
โโโ ... config files
Contributions are welcome! Please feel free to submit a Pull Request.
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
If you see "Invalid API key" or connection errors:
- Verify your
.envfile has the correct Supabase credentials - Check if your Supabase project is active (not paused/expired)
- Ensure you've run all database migrations
If you encounter build errors:
- Delete
node_modulesand reinstall:rm -rf node_modules && npm install - Clear cache:
npm run build -- --force - Check that all environment variables are set
- Make sure environment variables are set in your deployment platform
- Verify the build command and output directory are correct
- Check deployment logs for specific errors
This project is open source and available under the MIT License.
- Built with React
- Powered by Supabase
- UI components styled with Tailwind CSS
- Icons from Lucide
Note: Remember to keep your .env file private and never commit it to GitHub! Always use .env.example as a template for others.
For more help, feel free to open an issue or reach out!
Happy Coding! ๐ปโจ