# abdelrahman-sheded/graduationproject architecture

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

- Interactive diagram: https://gitdiagram.com/abdelrahman-sheded/graduationproject
- Repository: https://github.com/abdelrahman-sheded/graduationproject

## Overview

##### Project type and purpose
– This is a Next.js full-stack web application (App Router) focused on recruitment/chat functionality.
– Directory names like “(auth)”, “(chat)”, “(main)” and components for candidates, CV ranking, job management, and chat indicate a platform where users log in, upload CVs, interact via chat, and administrators manage jobs/posts.

##### File structure
– Top-level files: next.config.mjs, jsconfig.json, package.json → standard Next.js config and dependency management.
– /public → static assets (images, favicon, robots.txt).
– /src/app → main App Router directory:
- /(auth) → authentication pages (login).
- /(chat) → chat sub-app with routes for candidates, CV rankings, job chat (dynamic [slug] routes), upload CV.
- /(main) → main public pages (posts, admin dashboard).
- /components → reusable React components (tables, forms, navigation, response bubbles).
- /utils → helper functions (formatJobSlug, truncatePhone).
– Styles: .module.scss files next to components and layouts → CSS Modules.
– No explicit /api folder, but Next.js server components may implement server-side logic (e.g., getServerSideProps or route handlers).

##### README
– Bootstrapped with create-next-app, uses next/font for font optimization.
– No built-in database or API described → likely relies on serverless functions or external services for data persistence, authentication, AI/chat processing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client (Browser/Mobile)"
        Client["User Browser/Mobile"]:::frontend
    end

    %% CDN Layer
    subgraph "CDN / Edge Network"
        CDN["CDN / Edge Network"]:::cdn
    end

    %% Next.js Application Layer
    subgraph "Next.js Application (Edge/Serverless)"
        subgraph "App Router"
            AppRouter["Next.js App Router"]:::backend
        end

        subgraph "Authentication Module"
            Auth["(auth) Authentication Module"]:::backend
        end

        subgraph "Chat Sub-Application"
            ChatLayout["Chat Layout"]:::backend
            CandPage["Candidates Chat Page"]:::backend
            CVRankPage["CV Rankings Page"]:::backend
            JobList["Job Management List"]:::backend
            JobChat["Dynamic Job Chat Page"]:::backend
            UploadCV["Upload CV Page"]:::backend
        end

        subgraph "Main Pages"
            Posts["Public Posts Listing"]:::backend
            AdminDash["Admin Dashboard"]:::backend
            Landing["Main Landing Page"]:::backend
        end

        subgraph "UI Components"
            CandidateTable["Candidate Table"]:::frontend
            JobFormModal["Job Form Modal"]:::frontend
            NavBar["Navigation Bar"]:::frontend
            AssistantBubble["Assistant Response Bubble"]:::frontend
            UserBubble["User Message Bubble"]:::frontend
        end

        subgraph "Utilities"
            formatSlug["formatJobSlug()"]:::backend
            truncatePhone["truncatePhone()"]:::backend
        end

        RootLayout["Root Layout"]:::backend
        Globals["Global Styles & Config"]:::backend
    end

    %% Data Stores
    subgraph "Data Stores"
        DB["PostgreSQL / MongoDB"]:::storage
        S3["Object Storage (S3)"]:::storage
    end

    %% External Services
    subgraph "External Services"
        AuthSvc["Authentication Service"]:::external
        AI["OpenAI GPT (AI/Chat)"]:::external
    end

    %% Connections
    Client -->|HTTPS| CDN
    CDN -->|Cache & Serve| AppRouter
    Client -->|HTTPS| AppRouter

    AppRouter -->|routes to| Auth
    AppRouter -->|routes to| ChatLayout
    AppRouter -->|routes to| Posts
    AppRouter -->|routes to| AdminDash
    AppRouter -->|routes to| Landing

    Auth -->|login/session| AuthSvc

    ChatLayout -->|renders| CandPage
    ChatLayout -->|renders| CVRankPage
    ChatLayout -->|renders| JobList
    ChatLayout -->|renders| JobChat
    ChatLayout -->|renders| UploadCV

    Posts -->|CRUD| DB
    AdminDash -->|CRUD| DB
    Landing -->|fetch content| DB

    CandPage -->|query| formatSlug
    CVRankPage -->|query| AI
    JobList -->|query| DB
    JobChat -->|store/retrieve| DB
    UploadCV -->|PUT/GET| S3

    CandidateTable -->|used by| CandPage
    JobFormModal -->|used by| AdminDash
    NavBar -->|global nav| AppRouter
    AssistantBubble -->|display| JobChat
    UserBubble -->|input| JobChat

    AppRouter -->|uses| formatSlug
    AppRouter -->|uses| truncatePhone

    AppRouter -->|wraps| RootLayout
    RootLayout -->|includes| Globals

    AppRouter -->|communicates| DB
    AppRouter -->|communicates| S3
    AppRouter -->|communicates| AI
    AppRouter -->|communicates| AuthSvc

    %% Click Events
    click AppRouter "https://github.com/abdelrahman-sheded/graduationproject/tree/main/src/app"
    click Auth "https://github.com/abdelrahman-sheded/graduationproject/tree/main/src/app/(auth)"
    click ChatLayout "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/(chat)/layout.js"
    click CandPage "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/(chat)/chat/candidates/page.jsx"
    click CVRankPage "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/(chat)/chat/cv-rankings/page.js"
    click JobList "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/(chat)/chat/job/page.jsx"
    click JobChat "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/(chat)/chat/job/[slug]/page.js"
    click UploadCV "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/(chat)/chat/upload-cv/page.jsx"
    click Posts "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/(main)/Posts/page.jsx"
    click AdminDash "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/(main)/admin/page.js"
    click Landing "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/(main)/page.js"
    click CandidateTable "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/components/CandidateTable/CandidateTable.jsx"
    click JobFormModal "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/components/JobFormModal/JobFormModal.jsx"
    click NavBar "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/components/Navigation/navigation.jsx"
    click AssistantBubble "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/components/AssistantResponse/assistantResponse.jsx"
    click UserBubble "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/components/UserMessage/userMessage.jsx"
    click formatSlug "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/utils/formatJobSlug.js"
    click truncatePhone "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/utils/truncatePhone.js"
    click RootLayout "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/layout.js"
    click Globals "https://github.com/abdelrahman-sheded/graduationproject/blob/main/src/app/globals.scss"
    click S3 "https://github.com/abdelrahman-sheded/graduationproject/tree/main/public"

    %% Styles
    classDef frontend fill:#add8e6,stroke:#000
    classDef backend fill:#90ee90,stroke:#000
    classDef storage fill:#ffa500,stroke:#000
    classDef external fill:#ffcc00,stroke:#000
    classDef cdn fill:#dda0dd,stroke:#000
```
