# nerdbord/good-dev-hunting-app architecture

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

- Interactive diagram: https://gitdiagram.com/nerdbord/good-dev-hunting-app
- Repository: https://github.com/nerdbord/good-dev-hunting-app

## Overview

##### Main System Components

The system architecture should be divided into these key layers:

a) Client Layer:
- Next.js Frontend Application (under apps/platform-app/src)
- UI Component System (under packages/ui-system)
- Discord Bot Interface (under apps/hunty-ai-bot)

b) Server Layer:
- Next.js API Routes (under apps/platform-app/src/app/api)
- Authentication System (using NextAuth)
- Backend Services (under src/backend)

c) Database Layer:
- PostgreSQL Database (managed through Prisma)

d) External Services:
- Discord Integration
- GitHub OAuth
- LinkedIn OAuth
- MailerLite & MailerSend
- Groq Service
- Dropbox Service

##### Connection Flows

a) Authentication Flow:
- User → OAuth Providers → Backend → Database
- Session Management through NextAuth

b) Profile Management Flow:
- Frontend → API Routes → Profile Service → Database
- Image Upload → Storage Service

c) Search & Discovery Flow:
- Search Interface → API Routes → Profile Service → Database
- Filtering System → Profile Query Builder

##### Technical Details to Highlight

- Next.js 13+ App Router architecture
- Prisma ORM integration
- Authentication system
- File upload handling
- Real-time communication paths
- Cache layers if present

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        FE["Frontend App"]
        UI["UI Component System"]
        DC["Discord Bot"]
        
        subgraph Frontend_Components
            LP["Landing Page"]
            PM["Profile Management"]
            AU["Authentication UI"]
            SF["Search & Filtering"]
            MI["Moderation Interface"]
        end
    end

    subgraph Server
        API["API Routes"]
        
        subgraph Backend_Services
            PS["Profile Service"]
            US["User Service"]
            CRS["Contact Request Service"]
            TS["Technology Service"]
            CS["Country Service"]
            MS["Mailing Service"]
        end
        
        AUTH["Authentication System"]
    end

    subgraph Database
        DB[(PostgreSQL/Prisma)]
        
        subgraph Models
            UM["User Model"]
            PM_DB["Profile Model"]
            CR_DB["Contact Request"]
            RR["Rejection Reason"]
            TM["Technology Stack"]
            LM["Languages"]
        end
    end

    subgraph External
        GH["GitHub OAuth"]
        LI["LinkedIn OAuth"]
        ML["MailerLite"]
        MS_EXT["MailerSend"]
        GQ["Groq Service"]
        DX["Dropbox Service"]
        DI["Discord Integration"]
    end

    %% Client Layer Connections
    FE --> API
    DC --> DI
    
    %% Frontend Component Connections
    LP --> AU
    PM --> API
    SF --> API
    MI --> API
    
    %% Server Layer Connections
    API --> AUTH
    API --> Backend_Services
    Backend_Services --> DB
    
    %% External Service Connections
    AUTH --> GH
    AUTH --> LI
    MS --> ML
    MS --> MS_EXT
    PS --> GQ
    PS --> DX

    %% Style Definitions
    classDef frontend fill:#2196F3,color:white
    classDef backend fill:#4CAF50,color:white
    classDef database fill:#FFC107,color:black
    classDef external fill:#9C27B0,color:white

    %% Apply Styles
    class FE,UI,DC,LP,PM,AU,SF,MI frontend
    class API,PS,US,CRS,TS,CS,MS,AUTH backend
    class DB,UM,PM_DB,CR_DB,RR,TM,LM database
    class GH,LI,ML,MS_EXT,GQ,DX,DI external

    %% Click Events
    click FE "https://github.com/nerdbord/good-dev-hunting-app/tree/main/apps/platform-app/src/app/[locale]"
    click UI "https://github.com/nerdbord/good-dev-hunting-app/tree/main/packages/ui-system/src/components"
    click DC "https://github.com/nerdbord/good-dev-hunting-app/tree/main/apps/hunty-ai-bot"
    click AUTH "https://github.com/nerdbord/good-dev-hunting-app/tree/main/apps/platform-app/src/app/api/auth"
    click PS "https://github.com/nerdbord/good-dev-hunting-app/blob/main/apps/platform-app/src/backend/profile/profile.service.ts"
    click US "https://github.com/nerdbord/good-dev-hunting-app/blob/main/apps/platform-app/src/backend/user/user.service.ts"
    click CRS "https://github.com/nerdbord/good-dev-hunting-app/blob/main/apps/platform-app/src/backend/contact-request/contact-request.service.ts"
    click TS "https://github.com/nerdbord/good-dev-hunting-app/blob/main/apps/platform-app/src/backend/technology/technology.service.ts"
    click CS "https://github.com/nerdbord/good-dev-hunting-app/blob/main/apps/platform-app/src/backend/country/country.service.ts"
    click MS "https://github.com/nerdbord/good-dev-hunting-app/blob/main/apps/platform-app/src/backend/mailing/mailing.service.ts"
    click DB "https://github.com/nerdbord/good-dev-hunting-app/blob/main/apps/platform-app/prisma/schema.prisma"
    click DI "https://github.com/nerdbord/good-dev-hunting-app/blob/main/apps/platform-app/src/lib/discord.ts"
    click ML "https://github.com/nerdbord/good-dev-hunting-app/blob/main/apps/platform-app/src/lib/mailerliteClient.ts"
    click MS_EXT "https://github.com/nerdbord/good-dev-hunting-app/blob/main/apps/platform-app/src/lib/mailersendClient.ts"
    click GQ "https://github.com/nerdbord/good-dev-hunting-app/blob/main/apps/platform-app/src/services/groq.service.ts"
    click DX "https://github.com/nerdbord/good-dev-hunting-app/blob/main/apps/hunty-ai-bot/services/dropbox.service.ts"
    click PM "https://github.com/nerdbord/good-dev-hunting-app/tree/main/apps/platform-app/src/app/[locale]/(profile)/(routes)/my-profile"
    click MI "https://github.com/nerdbord/good-dev-hunting-app/tree/main/apps/platform-app/src/app/[locale]/(moderation)"
```
