Skip to content

YASHK-arch/AlgoGATE

Repository files navigation

AlgoGATE πŸš€

A production-grade, AI-assisted Competitive Programming Learning Platform built with React 19 + Firebase.

Live Demo Video Demo React Firebase Vite TailwindCSS


🧠 Problem Statement

Who is the user? Computer science students and competitive programmers (especially IITM BS / Codeforces beginners) who want a structured, personalised learning path for DSA and CP problems.

What problem are we solving? Most CP platforms (like Codeforces, LeetCode) are raw problem archives β€” they give you thousands of problems but provide zero guidance on what to study, in what order, or how you're progressing. Students choose problems randomly, miss entire topic classes, and have no way to track their study effort holistically.

Why does this matter? A structured, topic-wise, difficulty-gated learning journey dramatically improves retention and interview readiness. AlgoGATE provides:

  • Curated, topic-wise problem sets (800 β†’ 900 β†’ 1000 β†’ 1300 β†’ 1500 β†’ 1800 rating tracks)
  • Auto-syncing with Codeforces to credit work already done elsewhere
  • A GitHub-style activity heatmap combining AlgoGATE + Codeforces data
  • Integrated PDF study notes (DSA Java, IITM BS Stats, etc.)
  • A real-time discussion thread per problem for community learning

✨ Key Features

Feature Description
πŸ” Authentication Email/Password signup & login via Firebase Auth
πŸ“Š Dashboard Streak tracker, stats overview, topic progress rings, activity heatmap
🧩 Topic-wise Practice 10+ DSA topics Γ— 8 difficulty levels (800–1500) with 100+ curated CF problems
⭐ Star / Bookmark Bookmark problems; view them on a dedicated Starred page
πŸ“ Study Notes Browse PDF notes by subject (DSA Java, IITM BS Stats/Maths/Python)
πŸ’¬ Discussion Threads Real-time per-problem discussion via Firestore onSnapshot
πŸ”„ Codeforces Auto-Sync Auto-detects and marks problems solved on Codeforces into AlgoGATE progress
πŸ“ˆ Activity Heatmap Codeforces-style 52-week heatmap (AlgoGATE + CF unified)
πŸ—“οΈ Planner Calendar Plan and track your upcoming study sessions by date
πŸ‘€ Profile Page View stats, edit CF handle, manually trigger full sync
πŸ’‘ Hint System Collapsible, reveal-on-demand hints for curated problems
πŸ”’ Protected Routes All authenticated pages guarded via ProtectedRoute component

βš›οΈ React Concepts Demonstrated

Core Concepts βœ…

  • Functional Components β€” 100% functional component architecture across all pages and components
  • Props & Composition β€” StatsCard, ProgressRing, QuestionRow, PdfCard, TopicAccordion, etc.
  • useState β€” Used extensively for local UI state (modals, search, edit toggles, loading flags)
  • useEffect β€” Data loading on auth change, CF auto-sync on login, heatmap re-draw triggers
  • Conditional Rendering β€” Loading skeletons, error states, solved/unsolved badges, CF modal
  • Lists & Keys β€” Topic lists, question rows, heatmap cells, discussion threads all keyed correctly

Intermediate Concepts βœ…

  • Lifting State Up β€” Progress, starred, and activity state live in AppContext and flow down
  • Controlled Components β€” All form inputs (login, signup, search boxes, CF handle input) are fully controlled
  • React Router v7 β€” Nested routes, dynamic segments (/practice/:topic/:questionId), Navigate, Link
  • Context API β€” AuthContext (auth state) and AppContext (global app data) decouple state from UI

Advanced Concepts βœ…

  • useMemo β€” topicProgresses, filteredTopics, totalSolved, streak, filteredQuestions all memoised
  • useCallback β€” loadUserData, syncIfStale, runSync wrapped in useCallback to prevent re-renders
  • useRef β€” autoSyncFiredRef (session guard), inProgressRef (sync race condition guard)
  • React.lazy + Suspense β€” All 9 pages lazily loaded with a branded PageLoader spinner
  • Custom Hook β€” useCodeforcesSync encapsulates the entire CF API β†’ Firestore sync pipeline

πŸ” Authentication & Firebase

Auth Flow

  • Firebase Authentication (Email + Password)
  • onAuthStateChanged listener in AuthContext β€” single source of auth truth
  • On signup, a Firestore user document is created under users/{uid}
  • Protected routes redirect unauthenticated users to /auth

Firestore Collections

Collection Document ID Purpose
users {uid} Name, email, cfHandle, rating, createdAt, lastSyncedAt
progress {uid} Nested: topic β†’ difficulty β†’ { solved: [ids] }
starred {uid} { questions: [questionIds] }
activity {uid} { dates: { "YYYY-MM-DD": count }, cfDates: {...} }
discussions {questionId} Subcollection comments with real-time onSnapshot

CRUD Operations

  • Create: Signup (user doc), Post discussion comment, Mark solved, Star question
  • Read: Load progress, load starred, load activity, load discussion thread
  • Update: Bulk mark solved (CF sync), update CF handle, update rating, log activity
  • Delete: Unstar question, delete own discussion comment

πŸ—‚οΈ Project Structure

src/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ dashboard/       # StatsCard, ProgressRing, CFOnboardModal, CFSyncStatus
β”‚   β”œβ”€β”€ discussion/      # DiscussionThread (real-time Firestore)
β”‚   β”œβ”€β”€ heatmap/         # ActivityHeatmap (GitHub-style)
β”‚   β”œβ”€β”€ layout/          # Navbar, ProtectedRoute
β”‚   └── practice/        # QuestionRow, AdvisoryPopup
β”œβ”€β”€ context/
β”‚   β”œβ”€β”€ AppContext.jsx    # Global state: progress, starred, activity, streak
β”‚   └── AuthContext.jsx  # Firebase Auth state & user profile
β”œβ”€β”€ hooks/
β”‚   └── useCodeforcesSync.js  # Custom hook: CF API β†’ Firestore sync
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ LandingPage.jsx
β”‚   β”œβ”€β”€ AuthPage.jsx
β”‚   β”œβ”€β”€ Dashboard.jsx
β”‚   β”œβ”€β”€ PracticePage.jsx
β”‚   β”œβ”€β”€ TopicPage.jsx
β”‚   β”œβ”€β”€ QuestionPage.jsx
β”‚   β”œβ”€β”€ StarredPage.jsx
β”‚   β”œβ”€β”€ StudyPage.jsx
β”‚   β”œβ”€β”€ ProfilePage.jsx
β”‚   └── CalendarPage.jsx
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ firebase.js          # Firebase app init
β”‚   β”œβ”€β”€ authService.js       # signUp, signIn, signOut, getUserProfile
β”‚   β”œβ”€β”€ progressService.js   # markSolved, bulkMarkSolved, markUnsolved, starred CRUD
β”‚   β”œβ”€β”€ activityService.js   # logActivity, getActivity, setCFActivity
β”‚   β”œβ”€β”€ discussionService.js # getDiscussions, subscribeDiscussions, postComment, deleteComment
β”‚   └── codeforcesService.js # CF API: user info, submissions, solved extraction
└── utils/
    β”œβ”€β”€ questionData.js      # Master DB: 400+ curated CF problems, TOPICS, LEVELS
    β”œβ”€β”€ progressionEngine.js # getLevelStatus, getTopicProgress, getTopicsMastered
    β”œβ”€β”€ streakEngine.js      # computeStreak, generateHeatmapData, getIntensity
    └── studyData.js         # STUDY_SUBJECTS, topicβ†’PDF mapping, getStudentPdfPath

πŸ› οΈ Tech Stack

Layer Technology
Framework React 19 (Vite)
Routing React Router v7
Styling Tailwind CSS v3
Backend / Auth Firebase v12 (Auth + Firestore)
External API Codeforces Public REST API
Icons Lucide React
Deployment GitHub Pages (via gh-pages)

βš™οΈ Setup & Installation

Prerequisites

  • Node.js β‰₯ 18
  • A Firebase project with Authentication (Email/Password) and Firestore enabled

1. Clone the repository

git clone https://github.com/YASHK-arch/AlgoGATE.git
cd AlgoGATE

2. Install dependencies

npm install

3. Configure environment variables

Create a .env file in the project root:

VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id
VITE_FIREBASE_MEASUREMENT_ID=G-XXXXXXXXXX

4. Run locally

npm run dev

App runs at http://localhost:5173

5. Deploy to GitHub Pages

npm run deploy

πŸ“¦ Required Features Checklist

  • βœ… Authentication system (Firebase Email/Password)
  • βœ… Dashboard / Main screen with stats, heatmap, progress rings
  • βœ… 5+ core features (Practice, Study Notes, Discussions, CF Sync, Starred, Calendar)
  • βœ… CRUD functionality (progress, starred, discussions, user profile)
  • βœ… Persistent storage (Firestore β€” survives refresh, cross-device)
  • βœ… Routing (React Router v7 with protected + public routes)
  • βœ… State management (Context API β€” AuthContext + AppContext)

🌐 Live Deployment

πŸ”— Live Web App πŸ“Ί Video Demo / Walkthrough


πŸ“„ License

MIT β€” feel free to fork, study, and build on top of AlgoGATE.

About

A modified CP-31 application that organizes problems by core concepts rather than just tags, with a difficulty range from easy to hard. It is designed to help students prepare effectively for college DSA exams and the IIT BS dual degree program, and includes detailed curated notes for deeper understanding.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors