# niketkakkar03/crackbot architecture

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

- Interactive diagram: https://gitdiagram.com/niketkakkar03/crackbot
- Repository: https://github.com/niketkakkar03/crackbot

## Overview

##### Main System Components

A. Client Layer
- Next.js frontend architecture with three main sections:
- Landing Section (/(landing))
- Authentication Section (/(auth))
- Dashboard Section (/(dashboard))

B. API Layer
- API routes under /api:
- Conversation API
- Code API
- Image API

C. Services Layer
- Services directory components:
- Article Service
- Providers Service
- Store Service

##### Component Organization

**[Client Layer]**
- Landing Section
- Hero Component
- Navigation
- Auth Section
- Sign In
- Sign Up
- Dashboard Section
- Conversation
- Code Generation
- Image Generation
- Summary Generation

**[API Layer]**
- /api/conversation
- /api/code
- /api/image

**[Services Layer]**
- Article Service
- Providers
- Store

##### Key Relationships to Highlight

- How the dashboard routes interact with their corresponding API endpoints
- Authentication flow between the auth section and the dashboard
- Demonstrate how the services layer supports both the API and client layers
- Relationship between UI components and their parent layouts

##### Technical Stack Indicators

Badges or labels for:
- Next.js
- TypeScript
- Tailwind CSS
- Clerk Authentication
- AI Services Integration

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Landing["Landing Section"]
        click Landing "https://github.com/NiketKakkar03/CrackBot/blob/main/app/(landing)/page.tsx"
        Landing --> Hero["Hero Component"]
        click Hero "https://github.com/NiketKakkar03/CrackBot/blob/main/components/Landing-hero.tsx"
        Landing --> Nav["Navigation"]
        click Nav "https://github.com/NiketKakkar03/CrackBot/blob/main/components/Landing-navbar.tsx"

        Auth["Authentication Section"]
        click Auth "https://github.com/NiketKakkar03/CrackBot/tree/main/app/(auth)"
        Auth --> SignIn["Sign In"]
        click SignIn "https://github.com/NiketKakkar03/CrackBot/blob/main/app/(auth)/(routes)/sign-in/[[...sign-in]]/page.tsx"
        Auth --> SignUp["Sign Up"]
        click SignUp "https://github.com/NiketKakkar03/CrackBot/blob/main/app/(auth)/(routes)/sign-up/[[...sign-up]]/page.tsx"

        Dashboard["Dashboard Section"]
        click Dashboard "https://github.com/NiketKakkar03/CrackBot/tree/main/app/(dashboard)"
        Dashboard --> Conv["Conversation"]
        click Conv "https://github.com/NiketKakkar03/CrackBot/blob/main/app/(dashboard)/(routes)/conversation/page.tsx"
        Dashboard --> Code["Code Generation"]
        click Code "https://github.com/NiketKakkar03/CrackBot/blob/main/app/(dashboard)/(routes)/code/page.tsx"
        Dashboard --> Img["Image Generation"]
        click Img "https://github.com/NiketKakkar03/CrackBot/blob/main/app/(dashboard)/(routes)/image/page.tsx"
        Dashboard --> Sum["Summary Generation"]
        click Sum "https://github.com/NiketKakkar03/CrackBot/blob/main/app/(dashboard)/(routes)/summary/page.tsx"

        SharedUI["Shared UI Components"]
        SharedUI --> Button["Button"]
        click Button "https://github.com/NiketKakkar03/CrackBot/blob/main/components/ui/button.tsx"
        SharedUI --> Card["Card"]
        click Card "https://github.com/NiketKakkar03/CrackBot/blob/main/components/ui/card.tsx"
        SharedUI --> Form["Form"]
        click Form "https://github.com/NiketKakkar03/CrackBot/blob/main/components/ui/form.tsx"
        SharedUI --> Input["Input"]
        click Input "https://github.com/NiketKakkar03/CrackBot/blob/main/components/ui/input.tsx"
        SharedUI --> Select["Select"]
        click Select "https://github.com/NiketKakkar03/CrackBot/blob/main/components/ui/select.tsx"

        CoreUI["Core UI Components"]
        CoreUI --> MainNav["Main Navigation"]
        click MainNav "https://github.com/NiketKakkar03/CrackBot/blob/main/components/navbar.tsx"
        CoreUI --> Sidebar["Sidebar"]
        click Sidebar "https://github.com/NiketKakkar03/CrackBot/blob/main/components/sidebar.tsx"
        CoreUI --> MobileSidebar["Mobile Sidebar"]
        click MobileSidebar "https://github.com/NiketKakkar03/CrackBot/blob/main/components/ui/mobile-sidebar.tsx"
        CoreUI --> BotAvatar["Bot Avatar"]
        click BotAvatar "https://github.com/NiketKakkar03/CrackBot/blob/main/components/bot-avatar.tsx"
        CoreUI --> UserAvatar["User Avatar"]
        click UserAvatar "https://github.com/NiketKakkar03/CrackBot/blob/main/components/user-avatar.tsx"
    end

    subgraph API
        ConvAPI["/api/conversation"]
        click ConvAPI "https://github.com/NiketKakkar03/CrackBot/blob/main/app/api/conversation/route.ts"
        CodeAPI["/api/code"]
        click CodeAPI "https://github.com/NiketKakkar03/CrackBot/blob/main/app/api/code/route.ts"
        ImageAPI["/api/image"]
        click ImageAPI "https://github.com/NiketKakkar03/CrackBot/blob/main/app/api/image/route.ts"
    end

    subgraph Services
        ArticleService["Article Service"]
        click ArticleService "https://github.com/NiketKakkar03/CrackBot/blob/main/services/article.js"
        ProvidersService["Providers Service"]
        click ProvidersService "https://github.com/NiketKakkar03/CrackBot/blob/main/services/providers.tsx"
        StoreService["Store Service"]
        click StoreService "https://github.com/NiketKakkar03/CrackBot/blob/main/services/store.js"
    end

    %% Relationships
    Conv -.-> ConvAPI
    Code -.-> CodeAPI
    Img -.-> ImageAPI
    
    Auth ==> Dashboard
    
    ConvAPI --> ArticleService
    CodeAPI --> ProvidersService
    ImageAPI --> StoreService

    Dashboard --> CoreUI
    Dashboard --> SharedUI

    classDef client fill:#a8d1ff,stroke:#333,stroke-width:2px
    classDef api fill:#90EE90,stroke:#333,stroke-width:2px
    classDef service fill:#FFB347,stroke:#333,stroke-width:2px
    classDef auth fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef ui fill:#D3D3D3,stroke:#333,stroke-width:2px

    class Landing,Hero,Nav,Dashboard,Conv,Code,Img,Sum client
    class ConvAPI,CodeAPI,ImageAPI api
    class ArticleService,ProvidersService,StoreService service
    class Auth,SignIn,SignUp auth
    class SharedUI,CoreUI,Button,Card,Form,Input,Select,MainNav,Sidebar,MobileSidebar,BotAvatar,UserAvatar ui
```
