# exebyss/pp-client architecture

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

- Interactive diagram: https://gitdiagram.com/exebyss/pp-client
- Repository: https://github.com/exebyss/pp-client

## Overview

##### Main Components

A. Frontend Layer:
- React/Next.js Application Components
- Core Components (AboutMe, ContactMe, etc.)
- UI Components
- Layout System
- Apollo Client for GraphQL
- Theme System
- PWA Capabilities

B. Backend Layer:
- Next.js API Routes
- Apollo Server
- Authentication System (Auth0)
- Email Service

C. Data Layer:
- MongoDB Database
- Prisma ORM
- Contentful CMS
- GraphQL Schema

**[Client Layer]**
- ↕️
**[Server Layer]**
- ↕️
**[Data Layer]**

##### Component Relationships

A. Frontend Flow:
**User → Next.js Pages → React Components → Apollo Client**
- ↘ UI Components
- ↘ Theme System

B. Backend Flow:
**API Routes → Controllers → Models**
- ↘ Apollo Server → GraphQL Resolvers
- ↘ Auth0 Integration

C. Data Flow:
**Prisma ORM → MongoDB**
**Contentful Client → Contentful CMS**
**Apollo Client → GraphQL API**

##### Detailed Component Breakdown

Frontend Components (Group by functionality):
**Components/**
- Layout (Base structure)
- Core Features (AboutMe, Projects, Skills)
- UI Elements (Button, Input, Navigation)

Backend Services:
**API Routes/**
- Authentication
- GraphQL Endpoint
- Contact Form Handler

##### Additional Elements

- Version information and environment configurations
- Integration points with external services
- Error handling and monitoring (Sentry)

##### Implementation Notes

- Use standardized UML or C4 model notation
- Clear boundaries between different services
- Both synchronous and asynchronous communications
- Security boundaries and authentication flows

##### The UI component hierarchy

Remember to maintain a balance between detail and clarity, focusing on the architectural decisions that make this portfolio application unique, such as the combination of Contentful for content management, Apollo for data fetching, and Auth0 for authentication.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        User(("👤 User"))
        NextPages["Next.js Pages"]
        ReactComp["React Components"]:::frontend
        UIComp["UI Components"]:::frontend
        ThemeSystem["Theme System"]:::frontend
        ApolloClient["Apollo Client"]:::frontend
        PWA["PWA Capabilities"]
        Navigation["Navigation Components"]:::frontend
        CoreFeatures["Core Features"]:::frontend
    end

    subgraph Server
        APIRoutes["API Routes"]:::backend
        ApolloServer["Apollo Server"]:::backend
        Auth0["Auth0 Integration"]:::external
        EmailService["Email Service"]:::backend
        Controllers["Controllers"]:::backend
        ErrorMonitoring["Error Monitoring"]:::backend
    end

    subgraph Data
        PrismaORM["Prisma ORM"]:::data
        MongoDB[(MongoDB)]:::database
        ContentfulCMS["Contentful CMS"]:::external
        GraphQLSchema["GraphQL Schema"]:::data
    end

    %% Client Layer Relationships
    User --> NextPages
    NextPages --> ReactComp
    NextPages --> UIComp
    NextPages --> ThemeSystem
    ReactComp --> ApolloClient
    ReactComp --> Navigation
    ReactComp --> CoreFeatures

    %% Server Layer Relationships
    ApolloClient --> ApolloServer
    APIRoutes --> Controllers
    APIRoutes --> ApolloServer
    APIRoutes --> Auth0
    Controllers --> EmailService
    Controllers --> ErrorMonitoring

    %% Data Layer Relationships
    ApolloServer --> GraphQLSchema
    Controllers --> PrismaORM
    PrismaORM --> MongoDB
    ApolloServer --> ContentfulCMS

    %% Click Events
    click ReactComp "https://github.com/eXebyss/PP-Client/tree/master/components"
    click ApolloClient "https://github.com/eXebyss/PP-Client/blob/master/apollo/client.js"
    click ThemeSystem "https://github.com/eXebyss/PP-Client/tree/master/components/UI/ThemeSelector"
    click UIComp "https://github.com/eXebyss/PP-Client/tree/master/components/UI"
    click ApolloServer "https://github.com/eXebyss/PP-Client/blob/master/pages/api/apollo/graphql.js"
    click Auth0 "https://github.com/eXebyss/PP-Client/blob/master/pages/api/auth/[...auth0].js"
    click EmailService "https://github.com/eXebyss/PP-Client/tree/master/emails"
    click MongoDB "https://github.com/eXebyss/PP-Client/blob/master/utils/connectMongo.js"
    click PrismaORM "https://github.com/eXebyss/PP-Client/blob/master/prisma/schema.prisma"
    click ContentfulCMS "https://github.com/eXebyss/PP-Client/blob/master/helpers/client/contentful.js"
    click GraphQLSchema "https://github.com/eXebyss/PP-Client/blob/master/apollo/type-defs.js"
    click Controllers "https://github.com/eXebyss/PP-Client/tree/master/controllers"
    click CoreFeatures "https://github.com/eXebyss/PP-Client/tree/master/components"
    click Navigation "https://github.com/eXebyss/PP-Client/tree/master/components/UI/Navbar"
    click ErrorMonitoring "https://github.com/eXebyss/PP-Client/blob/master/sentry.client.config.js"

    %% Styling
    classDef frontend fill:#3498db,color:white
    classDef backend fill:#2ecc71,color:white
    classDef data fill:#f1c40f,color:black
    classDef database fill:#e67e22,color:white
    classDef external fill:#9b59b6,color:white

    %% Legend
    subgraph Legend
        Frontend["Frontend Component"]:::frontend
        Backend["Backend Service"]:::backend
        DataStore["Data Store"]:::data
        Database["Database"]:::database
        External["External Service"]:::external
    end
```
