# anouar-rezrazi/konecta_project architecture

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

- Interactive diagram: https://gitdiagram.com/anouar-rezrazi/konecta_project
- Repository: https://github.com/anouar-rezrazi/konecta_project

## Overview

##### Project Type and Purpose
- This is a full-stack web application built with Next.js (React framework) using the App Router (app/ directory).
- It serves a dashboard UI with authenticated routes (login, dashboard pages for calls and users) and a set of reusable UI components.

##### File-Structure Analysis
- Top-level config:
- next.config.js, tsconfig.json/jsconfig.json, .eslintrc.json – Next.js, TypeScript/JS config, linting.
- package.json, package-lock.json – dependencies and scripts.
- public/ – static assets.
- App code:
- app/ – Next.js App Router folder.
– layout.jsx & globals.css for app-wide layout and styling.
– page.jsx at root (homepage) and nested routes (login/page.jsx, dashboard/page.jsx, dashboard/calls/page.jsx, dashboard/users/page.jsx).
- app/ui/ – shared React components (dashboard navbar, sidebar, card, chart, rightbar), each with its own stylesheet (.module.css).

##### Architectural Patterns & Key Technologies
- File-based routing (Next.js App Router)
- Server-side rendering (SSR) and static-site generation (SSG) in Next.js
- Component-driven development (atomic UI components under app/ui)
- CSS Modules for scoped styling
- Font optimization with next/font
- Deployment target: Vercel platform

##### Main Components & Relationships
a. Client (Browser)
- Interacts via HTTP(S) with Next.js server (SSR/SSG)
- Requests pages, receives pre-rendered HTML/CSS/JS
b. Next.js Application Server
- Serves routes in app/
- Runs React components (app/ui/*)
- Applies global layout (app/layout.js) and nested layouts (app/dashboard/layout.jsx)
- Leverages next/font optimization
c. Static Assets & Styles
- public/ directory (images, favicon)
- CSS Modules (component-level styling)
- globals.css for base styles
d. External Services
- Google Fonts (via next/font)
- Vercel (build, CI/CD, hosting)

1. Client Layer: Browser
2. Application Layer: Next.js Server (with App Router & React components)
3. Asset/External Layer: Static assets, Fonts, Vercel Hosting
- Within the Application Layer, break out:
- Routing Layer: file-based routes (login, dashboard, calls, users)
- Layout System: root layout, dashboard layout
- Component Library: app/ui/* (navbar, sidebar, card, chart, rightbar)
- Data flow:
– Browser → HTTP request → Next.js Server
– Next.js Server → loads correct route component → uses UI components → applies CSS Modules/globals.css → builds HTML/CSS/JS response → returns to Browser
– Next.js Server ↔ next/font service for font optimization
- Build/deploy:
– Local dev via npm run dev
– Production build & deploy on Vercel

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    Browser["Browser Client"]:::external

    %% Application Layer
    subgraph "Next.js App Server"
        direction TB
        RoutingLayer["Routing Layer"]:::internal
        LayoutSystem["Layout System"]:::internal
        ComponentLib["UI Component Library"]:::internal
    end

    %% Routing Layer Details
    subgraph "Routing Layer"
        direction TB
        Homepage["Homepage\n(app/page.jsx)"]:::internal
        Login["Login Page\n(app/login/page.jsx)"]:::internal
        DashboardOverview["Dashboard Overview\n(app/dashboard/page.jsx)"]:::internal
        CallsPage["Calls Page\n(app/dashboard/calls/page.jsx)"]:::internal
        UsersPage["Users Page\n(app/dashboard/users/page.jsx)"]:::internal
    end

    %% Layout System Details
    subgraph "Layout System"
        direction TB
        RootLayout["Root Layout\n(app/layout.js)"]:::internal
        DashboardLayout["Dashboard Layout\n(app/dashboard/layout.jsx)"]:::internal
        GlobalsCSS["Global Styles\n(app/ui/globals.css)"]:::assets
    end

    %% UI Component Library Details
    subgraph "UI Component Library"
        direction TB
        CardComp["Card Component"]:::internal
        ChartComp["Chart Component"]:::internal
        NavbarComp["Navbar Component"]:::internal
        SidebarComp["Sidebar Component"]:::internal
        MenuLinkComp["MenuLink Subcomponent"]:::internal
        RightbarComp["Rightbar Component"]:::internal
        DashboardStyles["Dashboard Styles\n(app/ui/dashboard/dashboard.module.css)"]:::assets
    end

    %% Static & External Layer
    subgraph "Static & External"
        direction TB
        PublicAssets["Public Assets\n(public/)"]:::assets
        GoogleFonts["Google Fonts\n(via next/font)"]:::external
        VercelHost["Vercel Hosting & CI/CD"]:::external
    end

    %% Config & Tooling
    subgraph "Config & Tooling"
        direction TB
        NextConfig["next.config.js"]:::config
        TSConfig["tsconfig.json / jsconfig.json"]:::config
        ESLint[".eslintrc.json"]:::config
        PackageJSON["package.json / package-lock.json"]:::config
    end

    %% Data Flows
    Browser -->|"HTTP Request"| RoutingLayer
    RoutingLayer -->|"serves"| Homepage
    RoutingLayer -->|"serves"| Login
    RoutingLayer -->|"serves"| DashboardOverview
    RoutingLayer -->|"serves"| CallsPage
    RoutingLayer -->|"serves"| UsersPage
    RoutingLayer -->|"uses"| LayoutSystem
    LayoutSystem -->|"applies"| RootLayout
    RootLayout -->|"wraps"| DashboardLayout
    DashboardLayout -->|"renders"| ComponentLib
    ComponentLib --> CardComp
    ComponentLib --> ChartComp
    ComponentLib --> NavbarComp
    ComponentLib --> SidebarComp
    SidebarComp --> MenuLinkComp
    ComponentLib --> RightbarComp
    ComponentLib --> DashboardStyles
    ComponentLib --> GlobalsCSS
    NextConfig --> VercelHost
    PackageJSON --> VercelHost
    TSConfig --> NextConfig
    ESLint --> NextConfig
    Browser -->|"requests static"| PublicAssets
    PublicAssets -->|"served by"| RoutingLayer
    RoutingLayer -->|"fetches fonts"| GoogleFonts

    %% Click Events - Routing Layer
    click Homepage "https://github.com/anouar-rezrazi/konecta_project/blob/main/app/page.jsx"
    click Login "https://github.com/anouar-rezrazi/konecta_project/blob/main/app/login/page.jsx"
    click DashboardOverview "https://github.com/anouar-rezrazi/konecta_project/blob/main/app/dashboard/page.jsx"
    click CallsPage "https://github.com/anouar-rezrazi/konecta_project/blob/main/app/dashboard/calls/page.jsx"
    click UsersPage "https://github.com/anouar-rezrazi/konecta_project/blob/main/app/dashboard/users/page.jsx"

    %% Click Events - Layout System
    click RootLayout "https://github.com/anouar-rezrazi/konecta_project/blob/main/app/layout.js"
    click DashboardLayout "https://github.com/anouar-rezrazi/konecta_project/blob/main/app/dashboard/layout.jsx"
    click GlobalsCSS "https://github.com/anouar-rezrazi/konecta_project/blob/main/app/ui/globals.css"

    %% Click Events - UI Components
    click CardComp "https://github.com/anouar-rezrazi/konecta_project/blob/main/app/ui/dashboard/card/card.jsx"
    click ChartComp "https://github.com/anouar-rezrazi/konecta_project/blob/main/app/ui/dashboard/chart/chart.jsx"
    click NavbarComp "https://github.com/anouar-rezrazi/konecta_project/blob/main/app/ui/dashboard/navbar/navbar.jsx"
    click SidebarComp "https://github.com/anouar-rezrazi/konecta_project/blob/main/app/ui/dashboard/sidebar/sidebar.jsx"
    click MenuLinkComp "https://github.com/anouar-rezrazi/konecta_project/blob/main/app/ui/dashboard/sidebar/menuLink/menuLink.jsx"
    click RightbarComp "https://github.com/anouar-rezrazi/konecta_project/blob/main/app/ui/dashboard/rightbar/rightbar.jsx"
    click DashboardStyles "https://github.com/anouar-rezrazi/konecta_project/blob/main/app/ui/dashboard/dashboard.module.css"

    %% Click Events - Static & External
    click PublicAssets "https://github.com/anouar-rezrazi/konecta_project/tree/main/public/"

    %% Click Events - Config & Tooling
    click NextConfig "https://github.com/anouar-rezrazi/konecta_project/blob/main/next.config.js"
    click TSConfig "https://github.com/anouar-rezrazi/konecta_project/blob/main/tsconfig.json"
    click ESLint "https://github.com/anouar-rezrazi/konecta_project/blob/main/.eslintrc.json"
    click PackageJSON "https://github.com/anouar-rezrazi/konecta_project/blob/main/package.json"

    %% Styles
    classDef internal fill:#d0e7ff,stroke:#0366d6,color:#034e8c,stroke-width:1px
    classDef external fill:#d0ffd0,stroke:#228B22,color:#006400,stroke-width:1px
    classDef assets fill:#f0f0f0,stroke:#666666,color:#333333,stroke-width:1px
    classDef config fill:#fff2cc,stroke:#d5a600,color:#806000,stroke-width:1px
```
