# w3di/n-kolmykov-frontend architecture

> Architecture diagram of the GitHub repository w3di/n-kolmykov-frontend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/w3di/n-kolmykov-frontend
- Repository: https://github.com/w3di/n-kolmykov-frontend

## Overview

##### Project Type & Purpose
- This is a frontend‐only, Next.js 15 application (App Router) written in React & TypeScript.
- It serves as an open-source “quiz” site: static/dynamic pages (Home, About Me, Quiz) with client-side state and SSG/SSR.

##### File-Structure Analysis
- **app/** – Next.js App Router pages & layouts (page.tsx, layout.tsx, subroutes like /about-me, /quiz).
- **src/features/quiz/** – domain feature module: API stubs, React context & hooks for quiz state, UI components & styles.
- **src/shared/ui/** – shared design system: kit components (Accordion, Button, Toast, etc.), layout (Header, Footer), page sections (Hero, Stats, AboutMe, etc.).
- **config & tooling** – ESLint, Stylelint, Prettier, Husky hooks, Dockerfile, GitHub Actions workflow.

##### README Insights
- No backend yet—quiz data is mocked and consumed client-side.

a. Main Components
- **User Agent (Browser)**
- **Next.js Server (Node/Vercel)**
- **Page Router & Layout** (app/layout.tsx, page.tsx)
- **Feature Module: Quiz** (src/features/quiz)
- **Shared UI Library** (src/shared/ui)
- **Static Assets Store** (public/) – fonts, images, SVGs, animations
- **Build & Deploy Pipeline** (Dockerfile, GitHub Actions)
b. Relationships & Data Flows
- Browser <–> Next.js Server: initial SSR/SSG + hydration
- Browser pulls static assets from CDN/public folder
- Client-side React (Quiz Context & Hooks) manages quiz state, navigation, stats
- Build pipeline compiles TS/SCSS, runs lint & tests, outputs production bundle
- CI/CD pipeline triggers on git push → deploy to hosting
c. Architectural Patterns
- **Component-based** (atomic UI kit → sections → pages)
- **Feature-based modules** (quiz logic isolated under src/features)
- **App Router** (Next.js v15 folder-based routing + layouts)
- **CSS Modules & SCSS** (scoped styling by component/section)
d. Key Technologies
- Next.js, React, TypeScript, SCSS Modules
- React-Toastify (notifications)
- Lottie for animated assets
- GitHub Actions (CI/CD), Husky (pre-commit), Docker (containerization)

##### Detail & Clarity
- Data flows (e.g., “fetch mock questions” → “Quiz Context”).
- Related components with container boundaries (e.g., Next.js App Router).
- Notes for future backend integration and AI-powered extensions.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Agent
    Browser["User Agent (Browser)"]:::external

    %% Next.js Server
    NextServer["Next.js Server (Node/Vercel)"]:::server

    %% App Router
    subgraph "Next.js App Router" 
        direction TB
        Layout["Layout (app/layout.tsx)"]:::frontend
        HomePage["Home Page (app/page.tsx)"]:::frontend
        AboutPage["About Me Page (app/about-me/page.tsx)"]:::frontend
        QuizPage["Quiz Page (app/quiz/page.tsx)"]:::frontend
    end

    %% Feature Module: Quiz
    subgraph "Feature Module: Quiz" 
        direction TB
        QuizDir["Quiz Module Directory\n(src/features/quiz/)"]:::feature
        QuizAPI["Quiz API Stubs\n(src/features/quiz/api/index.ts)"]:::feature
        QuizContext["Quiz Context\n(src/features/quiz/model/quiz-context.tsx)"]:::feature
        QuizHooks["Quiz Hooks\n(src/features/quiz/model/use-quiz-*.tsx)"]:::feature
        QuizUI["Quiz UI Components\n(src/features/quiz/ui/)"]:::feature
        QuizWidgets["Quiz Widgets\n(src/features/quiz/widgets/)"]:::feature
    end

    %% Shared UI Library
    subgraph "Shared UI Library" 
        direction TB
        Kit["UI Kit\n(src/shared/ui/kit/)"]:::ui
        LayoutUI["Layout Components\n(src/shared/ui/layout/)"]:::ui
        PagesUI["Page Sections\n(src/shared/ui/pages/)"]:::ui
        SectionsUI["UI Sections\n(src/shared/ui/sections/)"]:::ui
    end

    %% Static Assets
    Assets(("Static Assets Store")):::assets
    Fonts["fonts (public/font/)"]:::assets
    Images["images (public/images/)"]:::assets
    Icons["SVG Icons (public/svg/icons/)"]:::assets
    Lottie["Lottie (public/lottie/)"]:::assets
    Styles["Styles (public/styles/)"]:::assets

    %% Build & Deploy Pipeline
    subgraph "Build & Deploy Pipeline" 
        direction TB
        Docker["Dockerfile"]:::pipeline
        CI["GitHub Actions\n(.github/workflows/deploy.yml)"]:::pipeline
        HuskyPre["Husky Pre-commit\n(.husky/pre-commit)"]:::pipeline
        HuskyPush["Husky Pre-push\n(.husky/pre-push)"]:::pipeline
        IconsGen["generate-icons.js"]:::pipeline
        NextConfig["next.config.ts"]:::pipeline
        ESLint["eslint.config.mjs"]:::pipeline
        StyleLint[".stylelintrc.json"]:::pipeline
        Prettier[".prettierrc"]:::pipeline
    end

    %% Connections
    Browser <-->|"SSR/SSG + Hydration"| NextServer
    NextServer -->|"Renders via Router"| Layout
    Layout --> HomePage
    Layout --> AboutPage
    Layout --> QuizPage

    Browser -->|"Loads Static Assets"| Assets
    Assets --> Fonts
    Assets --> Images
    Assets --> Icons
    Assets --> Lottie
    Assets --> Styles

    NextServer -->|"Imports Feature Module"| QuizDir
    QuizDir --> QuizAPI
    QuizDir --> QuizContext
    QuizDir --> QuizHooks
    QuizDir --> QuizUI
    QuizDir --> QuizWidgets

    NextServer -->|"Imports Shared UI"| Kit
    NextServer --> LayoutUI
    NextServer --> PagesUI
    NextServer --> SectionsUI

    CI -->|"Build & Test"| Docker
    Docker -->|"Compile TS/SCSS"| NextConfig
    Docker --> ESLint
    Docker --> StyleLint
    Docker --> Prettier
    Docker --> IconsGen
    Docker -->|"Produces Bundle"| NextServer

    CI -->|"Deploy to Hosting"| NextServer

    %% Click Events
    click Layout "https://github.com/w3di/n-kolmykov-frontend/blob/main/app/layout.tsx"
    click HomePage "https://github.com/w3di/n-kolmykov-frontend/blob/main/app/page.tsx"
    click AboutPage "https://github.com/w3di/n-kolmykov-frontend/blob/main/app/about-me/page.tsx"
    click QuizPage "https://github.com/w3di/n-kolmykov-frontend/blob/main/app/quiz/page.tsx"

    click QuizDir "https://github.com/w3di/n-kolmykov-frontend/tree/main/src/features/quiz/"
    click QuizAPI "https://github.com/w3di/n-kolmykov-frontend/blob/main/src/features/quiz/api/index.ts"
    click QuizContext "https://github.com/w3di/n-kolmykov-frontend/blob/main/src/features/quiz/model/quiz-context.tsx"
    click QuizHooks "https://github.com/w3di/n-kolmykov-frontend/blob/main/src/features/quiz/model/use-quiz-*.tsx"
    click QuizUI "https://github.com/w3di/n-kolmykov-frontend/tree/main/src/features/quiz/ui/"
    click QuizWidgets "https://github.com/w3di/n-kolmykov-frontend/tree/main/src/features/quiz/widgets/"

    click Kit "https://github.com/w3di/n-kolmykov-frontend/tree/main/src/shared/ui/kit/"
    click LayoutUI "https://github.com/w3di/n-kolmykov-frontend/tree/main/src/shared/ui/layout/"
    click PagesUI "https://github.com/w3di/n-kolmykov-frontend/tree/main/src/shared/ui/pages/"
    click SectionsUI "https://github.com/w3di/n-kolmykov-frontend/tree/main/src/shared/ui/sections/"

    click Fonts "https://github.com/w3di/n-kolmykov-frontend/tree/main/public/font/"
    click Images "https://github.com/w3di/n-kolmykov-frontend/tree/main/public/images/"
    click Icons "https://github.com/w3di/n-kolmykov-frontend/tree/main/public/svg/icons/"
    click Lottie "https://github.com/w3di/n-kolmykov-frontend/tree/main/public/lottie/"
    click Styles "https://github.com/w3di/n-kolmykov-frontend/tree/main/public/styles/"

    click Docker "https://github.com/w3di/n-kolmykov-frontend/tree/main/Dockerfile"
    click CI "https://github.com/w3di/n-kolmykov-frontend/blob/main/.github/workflows/deploy.yml"
    click HuskyPre "https://github.com/w3di/n-kolmykov-frontend/tree/main/.husky/pre-commit"
    click HuskyPush "https://github.com/w3di/n-kolmykov-frontend/tree/main/.husky/pre-push"
    click IconsGen "https://github.com/w3di/n-kolmykov-frontend/blob/main/generate-icons.js"
    click NextConfig "https://github.com/w3di/n-kolmykov-frontend/blob/main/next.config.ts"
    click ESLint "https://github.com/w3di/n-kolmykov-frontend/blob/main/eslint.config.mjs"
    click StyleLint "https://github.com/w3di/n-kolmykov-frontend/blob/main/.stylelintrc.json"
    click Prettier "https://github.com/w3di/n-kolmykov-frontend/blob/main/.prettierrc"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366D6,color:#0366D6
    classDef external fill:#E2E8F0,stroke:#94A3B8,color:#475569
    classDef server fill:#E6FFFA,stroke:#2C7A7B,color:#2C7A7B
    classDef feature fill:#ECFDF5,stroke:#34D399,color:#065F46
    classDef ui fill:#EFF6FF,stroke:#60A5FA,color:#1E3A8A
    classDef assets fill:#F5F5F5,stroke:#A1A1AA,color:#4B5563
    classDef pipeline fill:#FFF7ED,stroke:#FB923C,color:#9A3412
```
