# stalker-moment/frontend_ccr architecture

> Architecture diagram of the GitHub repository stalker-moment/frontend_ccr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/stalker-moment/frontend_ccr
- Repository: https://github.com/stalker-moment/frontend_ccr

## Overview

##### Project type and purpose
- This is a full-stack dashboard template built with Next.js (App Router) and NextUI.
- Purpose: provide a responsive, dark/light-mode enabled admin dashboard with stubbed authentication and chart/table pages.

##### File structure
- Top-level “app” folder: Next.js App Router – contains route segments (app/(app), app/(auth)), page.tsx, layout.tsx and providers.tsx (theme/provider contexts).
- “pages/api”: simple API routes (e.g., getAuthToken.ts) for server-side logic.
- “actions”: business logic invoked by client (e.g., auth.action.ts).
- Config files: next.config.js, tailwind.config.js, postcss.config.js, tsconfig.json, ESLint and package.json.

##### README for additional insights
- Confirms NextJS & NextUI stack, dark-mode support, delineates major pages (home, accounts, charts).
- Notes that this is a template deployable to Vercel, with future feature additions.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Side
    subgraph "Client (Browser)"
        Browser["Browser"]:::client
        subgraph "UI Layer (React/NextUI)"
            LayoutComp["components/layout/layout.tsx"]:::client
            Navbar["components/navbar/navbar.tsx"]:::client
            Sidebar["components/sidebar/sidebar.tsx"]:::client
            LoginComp["components/auth/login.tsx"]:::client
            RegisterComp["components/auth/register.tsx"]:::client
            HomeContent["components/home/content.tsx"]:::client
            ChartComp["components/charts/steam.tsx"]:::client
            TableComp["components/table/table.tsx"]:::client
        end
    end

    %% Actions Layer
    Actions["actions/auth.action.ts"]:::server

    %% Server Side
    subgraph "Next.js Server"
        subgraph "App Router"
            Providers["app/providers.tsx"]:::server
            AppLayout["app/layout.tsx"]:::server
            AppAppLayout["app/(app)/layout.tsx"]:::server
            AuthLayout["app/(auth)/layout.tsx"]:::server
            AppPage["app/(app)/page.tsx"]:::server
            LoginPage["app/(auth)/login/page.tsx"]:::server
            RegisterPage["app/(auth)/register/page.tsx"]:::server
        end
        Middleware["middleware.ts"]:::server
        API["pages/api/getAuthToken.ts"]:::server
    end

    %% Static Assets
    Public["public/"]:::static

    %% Config & Tooling
    subgraph "Config & Tooling"
        NextConfig["next.config.js"]:::config
        Tailwind["tailwind.config.js"]:::config
        PostCSS["postcss.config.js"]:::config
        TSConfig["tsconfig.json"]:::config
        ESLint[".eslintrc.json"]:::config
        Package["package.json"]:::config
        Readme["README.md"]:::config
    end

    %% External Services
    Vercel["Vercel"]:::external

    %% Relationships
    Browser -->|HTTP GET Page| Providers
    Providers -->|renders Layout| Browser
    Browser -->|renders| LayoutComp
    LayoutComp -->|fetch| API
    LoginComp -->|calls| Actions
    RegisterComp -->|calls| Actions
    Actions -->|invokes| API
    API -->|returns JWT| Actions
    Providers -->|routes through| Middleware
    Middleware -->|handles auth| Providers
    Public -->|serves static assets| Browser
    Vercel -->|hosts & deploys| Providers

    %% Click Events
    click LayoutComp "https://github.com/stalker-moment/frontend_ccr/blob/main/components/layout/layout.tsx"
    click Navbar "https://github.com/stalker-moment/frontend_ccr/blob/main/components/navbar/navbar.tsx"
    click Sidebar "https://github.com/stalker-moment/frontend_ccr/blob/main/components/sidebar/sidebar.tsx"
    click LoginComp "https://github.com/stalker-moment/frontend_ccr/blob/main/components/auth/login.tsx"
    click RegisterComp "https://github.com/stalker-moment/frontend_ccr/blob/main/components/auth/register.tsx"
    click HomeContent "https://github.com/stalker-moment/frontend_ccr/blob/main/components/home/content.tsx"
    click ChartComp "https://github.com/stalker-moment/frontend_ccr/blob/main/components/charts/steam.tsx"
    click TableComp "https://github.com/stalker-moment/frontend_ccr/blob/main/components/table/table.tsx"
    click Actions "https://github.com/stalker-moment/frontend_ccr/blob/main/actions/auth.action.ts"
    click Middleware "https://github.com/stalker-moment/frontend_ccr/blob/main/middleware.ts"
    click API "https://github.com/stalker-moment/frontend_ccr/blob/main/pages/api/getAuthToken.ts"
    click Providers "https://github.com/stalker-moment/frontend_ccr/blob/main/app/providers.tsx"
    click AppLayout "https://github.com/stalker-moment/frontend_ccr/blob/main/app/layout.tsx"
    click AppAppLayout "https://github.com/stalker-moment/frontend_ccr/blob/main/app/(app)/layout.tsx"
    click AuthLayout "https://github.com/stalker-moment/frontend_ccr/blob/main/app/(auth)/layout.tsx"
    click AppPage "https://github.com/stalker-moment/frontend_ccr/blob/main/app/(app)/page.tsx"
    click LoginPage "https://github.com/stalker-moment/frontend_ccr/blob/main/app/(auth)/login/page.tsx"
    click RegisterPage "https://github.com/stalker-moment/frontend_ccr/blob/main/app/(auth)/register/page.tsx"

    %% Styles
    classDef client fill:#E3F2FD,stroke:#2196F3,color:#0D47A1;
    classDef server fill:#E8F5E9,stroke:#4CAF50,color:#1B5E20;
    classDef static fill:#F5F5F5,stroke:#9E9E9E,color:#424242;
    classDef config fill:#EEEEEE,stroke:#757575,color:#212121;
    classDef external fill:#FFF3E0,stroke:#FF9800,color:#E65100
```
