How triellis/clash-of-codes works
Main Components
a) Client-Side (Next.js Application):
• Inside this container, create sub-sections for:
• Pages Layer (Admin, Clans, Live, PastScores)
• Components Layer (Reusable UI components)
• State Management (Redux store - indicated by userSlice.ts)
• Utilities Layer (functions, hooks, types)
b) External Services:
• CodeForces API
• Custom Express Backend (as mentioned in README)
• Authentication Service (indicated by LoginBtn component)
Component Relationships
• Data flow between pages and components
• API calls to CodeForces and custom backend
• State management interactions
• Authentication flow
Specific Implementation Details
Create sections showing:
• Routing structure (based on the app directory structure)
• Component hierarchy (showing reusable components)
• Data flow for live contest updates
• Clan management system
┌─ Next.js Frontend ─────────────────────┐
• ┌─ Pages ─────────┐ ┌─ Components ──┐ │
• Admin │ │ - NavBar │ │
• Clans │ │ - Leaderboard │ │
• Live │ │ - UserItem │ │
• PastScores │ │ - ... │ │
• ┘ └──────────────┘ │
• ┌─ State ─────────┐ ┌─ Utils ──────┐ │
• User Store │ │ - Functions │ │
• Redux │ │ - Hooks │ │
• ┘ └──────────────┘ │
• ┘
┌─ APIs ──────────┐ ┌─ Backend ────────┐
• CodeForces │ │ - Express Server │
• Authentication│ │ - Contest Data │
• ┘ └─────────────────┘
Important Notes
• Real-time data flow for live contest updates
• Clan management system's interaction with the backend
• Authentication flow
• How past scores are stored and retrieved
• Error handling paths (Error component)