# nicolasd09/nextjs_portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/nicolasd09/nextjs_portfolio
- Repository: https://github.com/nicolasd09/nextjs_portfolio

## Overview

##### Main System Components

a) Frontend Layer (Next.js Application)
- Client-side Components
- Server-side Components (Next.js 13+ App Router)
- Static Pages
- Dynamic Routes

b) Content Management
- Contentful Integration (evident from contentfulTypes.d.ts and generateContentfulTypes.js)

c) API Layer
- Internal API Routes
- External Services Integration

##### Component Organization

a) Page Structure
- Main sections: Experiences, Projects, Skills, About, Contact
- Dynamic routing patterns ([slug] routes)
- Layout hierarchy

b) Component Architecture
- Shared Components (UI, Navigation, etc.)
- Page-specific Components
- Reusable Elements

##### Data Flow Representation

Following interactions:

**[Contentful CMS] <---> [Next.js Backend] <---> [Next.js Frontend] <---> [User Interface]**

##### Specific Implementation Details

Key architectural elements:

a) Route Structure
- App Router organization (/src/app structure)
- API routes (/src/api)
- Dynamic routes for experiences, projects, and skills

b) Component Hierarchy
- Layout components
- Page components
- Shared UI components
- Feature-specific components

- Client Layer       |
- (Browser/Next.js)     |

- ↕

- Application Layer   |
- (Next.js App Router)   |

- ↕

- Data Layer       |
- (Contentful)      |

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        UI[User Interface]
        Browser[Web Browser]
    end

    subgraph NextApp[Next.js Application]
        direction TB
        Layout["Layout Component"]:::component
        click Layout "https://github.com/NicolasD09/NextJS_portfolio/blob/main/src/app/layout.tsx"
        
        subgraph Pages["Page Components"]
            direction TB
            Experiences["Experiences Page"]:::page
            click Experiences "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/app/(experiences)/mon-parcours/"
            Projects["Projects Page"]:::page
            click Projects "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/app/(projects)/projets/"
            Skills["Skills Page"]:::page
            click Skills "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/app/(skills)/competences/"
            About["About Page"]:::page
            click About "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/app/(selfDescription)/a-propos/"
            Contact["Contact Page"]:::page
            click Contact "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/app/contact/"
        end

        subgraph DynamicRoutes["Dynamic Routes"]
            ExpRoute["[slug] Experience"]:::route
            click ExpRoute "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/app/(experiences)/mon-parcours/[slug]/"
            ProjRoute["[slug] Project"]:::route
            click ProjRoute "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/app/(projects)/projets/[slug]/"
            SkillRoute["[slug] Skill"]:::route
            click SkillRoute "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/app/(skills)/competences/[slug]/"
        end

        subgraph Components["Shared Components"]
            direction TB
            Nav["Navigation"]:::component
            click Nav "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/components/Navbar/"
            Hero["Hero Section"]:::component
            click Hero "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/components/HeroSection/"
            ProjSection["Projects Section"]:::component
            click ProjSection "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/components/ProjectsSection/"
            SkillSection["Skills Section"]:::component
            click SkillSection "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/components/Skills/SkillsSection/"
            Article["Article System"]:::component
            click Article "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/components/pages/Article/"
        end

        subgraph UIComponents["UI Components"]
            Button["Button"]:::ui
            click Button "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/components/UI/Button/"
            Dropdown["Dropdown"]:::ui
            click Dropdown "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/components/UI/Dropdown/"
            Grid["Grid"]:::ui
            click Grid "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/components/UI/Grid/"
            LinkComp["Link"]:::ui
            click LinkComp "https://github.com/NicolasD09/NextJS_portfolio/tree/main/src/components/Link/"
        end
    end

    subgraph APILayer["API Layer"]
        direction TB
        ExpAPI["Experiences API"]:::api
        click ExpAPI "https://github.com/NicolasD09/NextJS_portfolio/blob/main/src/api/experiences.ts"
        ProjAPI["Projects API"]:::api
        click ProjAPI "https://github.com/NicolasD09/NextJS_portfolio/blob/main/src/api/projects.ts"
        SelfAPI["Self Description API"]:::api
        click SelfAPI "https://github.com/NicolasD09/NextJS_portfolio/blob/main/src/api/selfDescription.ts"
        SkillAPI["Skills API"]:::api
        click SkillAPI "https://github.com/NicolasD09/NextJS_portfolio/blob/main/src/api/skill.ts"
    end

    subgraph CMS["Content Management"]
        Contentful["Contentful CMS"]:::external
        ContentfulLib["Contentful Integration"]:::integration
        click ContentfulLib "https://github.com/NicolasD09/NextJS_portfolio/blob/main/src/lib/contentful.ts"
        Types["Type Definitions"]:::types
        click Types "https://github.com/NicolasD09/NextJS_portfolio/blob/main/contentfulTypes.d.ts"
    end

    Browser --> Layout
    Layout --> Pages
    Layout --> Components
    Pages --> DynamicRoutes
    Pages --> Components
    Components --> UIComponents
    DynamicRoutes --> APILayer
    APILayer --> ContentfulLib
    ContentfulLib --> Contentful

    classDef page fill:#a8dadc,stroke:#457b9d
    classDef component fill:#457b9d,stroke:#1d3557,color:#fff
    classDef route fill:#e63946,stroke:#1d3557
    classDef api fill:#fca311,stroke:#14213d
    classDef ui fill:#2a9d8f,stroke:#264653
    classDef external fill:#606c38,stroke:#283618,color:#fff
    classDef integration fill:#bc6c25,stroke:#dda15e
    classDef types fill:#9b2226,stroke:#ae2012,color:#fff
```
