# otman-dev/otman-portfolio architecture

> Architecture diagram of the GitHub repository otman-dev/otman-portfolio, 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/otman-dev/otman-portfolio
- Repository: https://github.com/otman-dev/otman-portfolio

## Overview

##### Project type and purpose
- This is a full-stack, content-driven portfolio website built with Next.js 13’s App Router.
- Purpose: serve a dynamically generated, highly interactive portfolio (“frontend”) and power two serverless API endpoints (“backend”):
– AI-powered chatbot (Groq SDK)
– Blog feed integration (RSS2JSON)

##### File structure
- Top-level config & assets:
– next.config.ts, tailwind.config.js, tsconfig.json – Next.js, Tailwind & TS setup
– public/ – static assets (PDF resume, images, logo)
- src/app/ – App Router entry:
– layout.tsx, globals.css, motion-utils.css – root layout & global styles
– page.tsx – homepage server component
– api/ – serverless functions: `/api/blog/*` and `/api/chat/*` (speech, unified)
- src/components/ – React components:
– sections/ – UI for each portfolio section (About, Work, Skills…)
– ChatComponent, SpeechToTextChat – client-side chat UI
– FloatingNavigation – client navigation UI
- src/context/ – React Context (NavigationContext) for state
- src/utils/ – static data (personal, projects, skills, etc.), custom hooks, TS types

##### README for additional insights
- Tech stack: Next.js 15 App Router, React 19, TypeScript 5, Tailwind 4, Framer Motion
- Architecture highlights: server components vs client components, serverless API routes, context & hooks, static vs dynamic content, AI & RSS integrations

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User & Browser
    subgraph "User & Browser"
        User["User"]:::frontend
        Browser["Browser"]:::frontend
    end

    %% Client Components
    subgraph "Client Components"
        Sections["Portfolio Sections"]:::frontend
        click Sections "https://github.com/otman-dev/otman-portfolio/tree/master/src/components/sections/"
        ChatUI["ChatComponent"]:::frontend
        click ChatUI "https://github.com/otman-dev/otman-portfolio/blob/master/src/components/ChatComponent.tsx"
        SpeechUI["SpeechToTextChat"]:::frontend
        click SpeechUI "https://github.com/otman-dev/otman-portfolio/blob/master/src/components/SpeechToTextChat.tsx"
        Nav["FloatingNavigation"]:::frontend
        click Nav "https://github.com/otman-dev/otman-portfolio/blob/master/src/components/FloatingNavigation.tsx"
        Context["NavigationContext"]:::frontend
        click Context "https://github.com/otman-dev/otman-portfolio/blob/master/src/context/NavigationContext.tsx"
        Hooks["usePortfolioData Hook"]:::frontend
        click Hooks "https://github.com/otman-dev/otman-portfolio/blob/master/src/utils/hooks/usePortfolioData.ts"
        Types["Portfolio Types"]:::frontend
        click Types "https://github.com/otman-dev/otman-portfolio/blob/master/src/utils/types/portfolio.ts"
    end

    %% Next.js Server
    subgraph "Next.js Server"
        Layout["layout.tsx"]:::server
        click Layout "https://github.com/otman-dev/otman-portfolio/blob/master/src/app/layout.tsx"
        Page["page.tsx"]:::server
        click Page "https://github.com/otman-dev/otman-portfolio/blob/master/src/app/page.tsx"
        subgraph "API Layer"
            ChatAPI1["Chat API (/api/chat)"]:::server
            click ChatAPI1 "https://github.com/otman-dev/otman-portfolio/blob/master/src/app/api/chat/route.ts"
            SpeechAPI["Speech-to-Text API (/api/chat/speech)"]:::server
            click SpeechAPI "https://github.com/otman-dev/otman-portfolio/blob/master/src/app/api/chat/speech/route.ts"
            GroqAPI["Groq Chat (/api/chat/unified)"]:::server
            click GroqAPI "https://github.com/otman-dev/otman-portfolio/blob/master/src/app/api/chat/unified/route.ts"
            BlogAPI["Blog API (/api/blog)"]:::server
            click BlogAPI "https://github.com/otman-dev/otman-portfolio/blob/master/src/app/api/blog/route.ts"
        end
    end

    %% Static Assets & Data
    subgraph "Static Assets & Data"
        Public["public/ (Static Assets)"]:::static
        click Public "https://github.com/otman-dev/otman-portfolio/blob/master/public/CV_OtmanMouhib.pdf"
        Data["utils/data/ (Static Data)"]:::static
        click Data "https://github.com/otman-dev/otman-portfolio/tree/master/src/utils/data/"
    end

    %% External Services
    subgraph "External Services"
        Groq["Groq LLM"]:::external
        RSS["RSS2JSON API"]:::external
    end

    %% Connections
    User --> Browser
    Browser --> Layout
    Layout --> Page
    Page --> Data
    Page --> Public
    Browser --> Sections
    Browser --> ChatUI
    Browser --> SpeechUI
    Browser --> Nav
    Sections --> BlogAPI
    ChatUI --> ChatAPI1
    SpeechUI --> SpeechAPI
    ChatAPI1 --> Groq
    SpeechAPI --> Groq
    Groq --> ChatAPI1
    BlogAPI --> RSS
    RSS --> BlogAPI

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,stroke-width:2px;
    classDef server fill:#E6FFE6,stroke:#28a745,stroke-width:2px;
    classDef static fill:#F0F0F0,stroke:#6c757d,stroke-width:2px;
    classDef external fill:#FFF4E6,stroke:#ff8c00,stroke-width:2px;
```
