# himanshu3889/acd-ladders architecture

> Architecture diagram of the GitHub repository himanshu3889/acd-ladders, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/himanshu3889/acd-ladders
- Repository: https://github.com/himanshu3889/acd-ladders

## Overview

##### Project type and purpose
- This is a full-stackish single-page application built with Next.js (React) focused on filtering and analyzing Codeforces problems.
- There is no custom backend in this repo; instead, the “backend” is a Next.js serverless layer that fetches data from the Codeforces API and serves pre-rendered pages or API routes.
- Key purpose: Let users enter filter criteria, fetch problems/submissions from Codeforces, process them (using custom algorithms and data structures), and present interactive charts and tables.

##### File structure
- pages/ – Next.js routes (SSR/SSG), e.g. pages/index.tsx, pages/v2/analytics/cf/index.tsx
- app/store.ts – Redux Toolkit store setup
- features/ – Redux “slices” and async actions (contests, problems, user, filters, etc.)
- components/ – UI layer, subdivided by feature (analytics, layouts, sidebars, textSearch)
- service/ – facade over external APIs (codeforces.ts, acdLadders.ts), storage adapters (cookie, local, session), notificationService
- utils/ – pure helper functions and data structures (algorithms, analytics processors, fenwickTree)
- configs/constants.ts – global constants
- styles/, tailwind.config.js – theming and CSS
- next.config.js, tsconfig.json, .eslintrc.json – build and lint tooling

##### README for additional insights
- Confirms reliance on Next.js, React, Tailwind CSS
- Highlights advanced filtering algorithms (maps, sets, pointers, string algorithms)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Boundary
    subgraph "Client-Side (Browser)" 
        direction TB
        UI["React Components"]:::frontend
        Store["Redux Store"]:::state
        Hooks["Custom Hooks"]:::hooks
    end

    %% Serverless Boundary
    subgraph "Serverless Backend (Next.js Server)" 
        direction TB
        Server["Next.js Server (pages/)"]:::backend
        Service["Service Layer"]:::service
    end

    %% Utils and External
    subgraph "Processing & External"
        direction TB
        Utils["Utils (Algorithms & Data Structures)"]:::utils
        Storage["Storage Services"]:::storage
        External["External Codeforces API"]:::external
    end

    %% Flows
    UI -->|"dispatch actions"| Store
    Store -->|"thunks call"| Service
    Service -->|"fetch/process"| External
    Service -->|"access"| Storage
    Service -->|"notify"| ServiceNotif((Notification Service)):::service
    Service -->|"forward data"| Utils
    Utils -->|"processed results"| Store
    Store -->|"state updates"| UI

    %% Next.js SSR/SSG
    Server -->|"renders pages"| UI
    UI -->|"page requests"| Server
    Server -->|"API routes use"| Service

    %% Click Events
    click Server "https://github.com/himanshu3889/acd-ladders/tree/master/pages/"
    click Server "https://github.com/himanshu3889/acd-ladders/blob/master/pages/_app.tsx"
    click Server "https://github.com/himanshu3889/acd-ladders/blob/master/pages/index.tsx"
    click Server "https://github.com/himanshu3889/acd-ladders/blob/master/pages/404.tsx"
    click Server "https://github.com/himanshu3889/acd-ladders/blob/master/pages/v2/analytics/cf/index.tsx"
    click Server "https://github.com/himanshu3889/acd-ladders/blob/master/pages/v2/cf_filter.tsx"
    click Server "https://github.com/himanshu3889/acd-ladders/blob/master/pages/v2/about.tsx"
    click UI "https://github.com/himanshu3889/acd-ladders/tree/master/components/"
    click UI "https://github.com/himanshu3889/acd-ladders/blob/master/components/Sidebars.tsx"
    click UI "https://github.com/himanshu3889/acd-ladders/blob/master/components/UserDetails.tsx"
    click UI "https://github.com/himanshu3889/acd-ladders/blob/master/components/UserSearch.tsx"
    click UI "https://github.com/himanshu3889/acd-ladders/tree/master/components/analytics/"
    click UI "https://github.com/himanshu3889/acd-ladders/tree/master/components/layouts/"
    click UI "https://github.com/himanshu3889/acd-ladders/tree/master/components/leftAside/"
    click UI "https://github.com/himanshu3889/acd-ladders/tree/master/components/rightAside/"
    click UI "https://github.com/himanshu3889/acd-ladders/blob/master/components/textSearch/TextSearch.tsx"
    click Store "https://github.com/himanshu3889/acd-ladders/blob/master/app/store.ts"
    click Store "https://github.com/himanshu3889/acd-ladders/blob/master/features/contests/contestSlice.ts"
    click Store "https://github.com/himanshu3889/acd-ladders/blob/master/features/contests/contestAction.ts"
    click Store "https://github.com/himanshu3889/acd-ladders/blob/master/features/problems/problemSlice.ts"
    click Store "https://github.com/himanshu3889/acd-ladders/blob/master/features/problems/problemAction.ts"
    click Store "https://github.com/himanshu3889/acd-ladders/blob/master/features/user/userSlice.ts"
    click Store "https://github.com/himanshu3889/acd-ladders/blob/master/features/user/userAction.ts"
    click Store "https://github.com/himanshu3889/acd-ladders/blob/master/features/filters/filterSlice.ts"
    click Store "https://github.com/himanshu3889/acd-ladders/blob/master/features/filters/filterConstants.ts"
    click Store "https://github.com/himanshu3889/acd-ladders/blob/master/features/search/searchSlice.ts"
    click Service "https://github.com/himanshu3889/acd-ladders/blob/master/service/codeforces.ts"
    click Service "https://github.com/himanshu3889/acd-ladders/blob/master/service/acdLadders.ts"
    click Service "https://github.com/himanshu3889/acd-ladders/blob/master/service/notificationService/notifyService.ts"
    click Storage "https://github.com/himanshu3889/acd-ladders/blob/master/service/storageService/cookieStorage.ts"
    click Storage "https://github.com/himanshu3889/acd-ladders/blob/master/service/storageService/localStorage.ts"
    click Storage "https://github.com/himanshu3889/acd-ladders/blob/master/service/storageService/sessionStorage.ts"
    click Utils "https://github.com/himanshu3889/acd-ladders/blob/master/utils/algorithms/bisectLeft.ts"
    click Utils "https://github.com/himanshu3889/acd-ladders/blob/master/utils/dataStructures/fenwickTree.ts"
    click Utils "https://github.com/himanshu3889/acd-ladders/blob/master/utils/stringAlgos.ts"
    click Utils "https://github.com/himanshu3889/acd-ladders/blob/master/utils/analytics/cf/contestAnalytics/processContestAnalyticsData.ts"
    click Utils "https://github.com/himanshu3889/acd-ladders/blob/master/utils/analytics/cf/contestAnalytics/processUserContestAnalyticsData.ts"
    click Utils "https://github.com/himanshu3889/acd-ladders/blob/master/utils/analytics/cf/contestAnalytics/userRanking.ts"
    click Utils "https://github.com/himanshu3889/acd-ladders/blob/master/utils/analytics/cf/submissionAnalytics/processSubmissionAnalyticsData.ts"
    click Constants "https://github.com/himanshu3889/acd-ladders/blob/master/configs/constants.ts"
    click Constants "https://github.com/himanshu3889/acd-ladders/blob/master/styles/colors.ts"
    click Constants "https://github.com/himanshu3889/acd-ladders/blob/master/tailwind.config.js"
    click Constants "https://github.com/himanshu3889/acd-ladders/blob/master/next.config.js"
    click Hooks "https://github.com/himanshu3889/acd-ladders/blob/master/hooks/useClickAway.ts"
    click Hooks "https://github.com/himanshu3889/acd-ladders/blob/master/hooks/useDebounce.ts"
    click Hooks "https://github.com/himanshu3889/acd-ladders/blob/master/hooks/useSearchParamsCustom.ts"

    %% Styles
    classDef frontend fill:#D0E6FF,stroke:#3399FF,stroke-width:1px
    classDef backend fill:#FFEFD0,stroke:#FF9933,stroke-width:1px
    classDef service fill:#E0FFE0,stroke:#33CC33,stroke-width:1px
    classDef utils fill:#F0E0FF,stroke:#9933CC,stroke-width:1px
    classDef state fill:#FFF3D0,stroke:#FFCC33,stroke-width:1px
    classDef storage fill:#FFF0D0,stroke:#FF9900,stroke-width:1px,stroke-dasharray: 5 5
    classDef external fill:#D0FFD0,stroke:#33CC33,stroke-width:2px,stroke-dasharray: 5 5
    classDef hooks fill:#FFE0E0,stroke:#FF3333,stroke-width:1px
    class Constants fill:#F5F5F5,stroke:#AAAAAA,stroke-width:1px
    class ServiceNotif fill:#E0FFE0,stroke:#33CC33,stroke-width:1px

    %% Constants Node
    Constants["Global Config & Constants"]:::frontend
    Storage --> Constants
    Service --> Constants
    UI --> Constants
```
