# dailydotdev/apps architecture

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

- Interactive diagram: https://gitdiagram.com/dailydotdev/apps
- Repository: https://github.com/dailydotdev/apps

## Overview

##### Main Components Architecture

- Web Application (Next.js)
- Browser Extension
- Shared Components Library

##### Key Architectural Layers

For each main component, include these layers:
**Frontend Layer:**
- UI Components
- Pages/Routes
- State Management
- Hooks
- Context Providers

**Backend Integration Layer:**
- GraphQL Clients
- API Integration
- Authentication
- WebSocket Connections

**Infrastructure Layer:**
- Build Systems (Webpack, Next.js)
- Development Tools
- Testing Framework

##### Shared Resources

**Components:**
- UI Components
- Forms
- Modals
- Cards

**Utilities:**
- Hooks
- Context
- GraphQL Operations
- Types
- Constants

**Styling:**
- Tailwind Configuration
- Theme System
- Typography

##### Cross-Cutting Concerns

- Authentication & Authorization
- Feature Flags
- Logging
- Analytics
- Error Handling
- Testing Infrastructure

##### Integration Points

Connections for:
- Browser Extension <-> Web App Communication
- Shared Component Usage
- API Integration Points
- Authentication Flow
- State Synchronization

##### Development Tooling

Supporting systems:
- Storybook Integration
- ESLint Configuration
- Prettier Setup
- Testing Framework
- Build Pipeline

##### Data Flow

- Component Communication
- State Updates
- API Requests
- Event Handling
- Cross-Platform Integration

##### Notes

Annotations for:
- Monorepo Structure
- Shared Code Strategy
- Extension-Specific Features
- Web-Specific Features
- Development Workflow

- The monorepo architecture
- Code sharing between platforms
- Platform-specific implementations
- Development workflow
- Testing strategy
- Component reusability

Remember to maintain a balance between detail and clarity, focusing on the architectural decisions that make this system unique while keeping it understandable for developers who need to work with it.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core["Core Applications"]
        WebApp["Web App (Next.js)"]
        Extension["Browser Extension"]
        Shared["Shared Package"]
    end

    subgraph SharedLayer["Shared Layer"]
        Components["Components"]:::shared
        Hooks["Hooks"]:::shared
        Contexts["Contexts"]:::shared
        GraphQLShared["GraphQL"]:::shared
        Utils["Utils"]:::shared
        Styles["Styles"]:::shared
        Types["Types"]:::shared
        Lib["Library"]:::shared
        Icons["Icons"]:::shared
    end

    subgraph ExtensionLayer["Extension Components"]
        Background["Background"]:::extension
        Companion["Companion"]:::extension
        NewTab["New Tab"]:::extension
        Content["Content"]:::extension
        Permission["Permission"]:::extension
    end

    subgraph WebAppLayer["Web App Components"]
        Pages["Pages"]:::webapp
        Layouts["Layouts"]:::webapp
        WebComponents["Components"]:::webapp
        WebHooks["Hooks"]:::webapp
        WebGraphQL["GraphQL"]:::webapp
        Public["Public"]:::webapp
    end

    subgraph DevTools["Development Infrastructure"]
        Storybook["Storybook"]:::devtool
        ESLint["ESLint"]:::devtool
        Prettier["Prettier"]:::devtool
        Testing["Testing"]:::devtool
    end

    %% Core Dependencies
    WebApp --> Shared
    Extension --> Shared
    
    %% Shared Layer Connections
    Shared --> Components
    Shared --> Hooks
    Shared --> Contexts
    Shared --> GraphQLShared
    Shared --> Utils
    Shared --> Styles
    Shared --> Types
    Shared --> Lib
    Shared --> Icons

    %% Extension Layer Connections
    Extension --> Background
    Extension --> Companion
    Extension --> NewTab
    Extension --> Content
    Extension --> Permission

    %% Web App Layer Connections
    WebApp --> Pages
    WebApp --> Layouts
    WebApp --> WebComponents
    WebApp --> WebHooks
    WebApp --> WebGraphQL
    WebApp --> Public

    %% Development Tools Connections
    DevTools --> WebApp
    DevTools --> Extension
    DevTools --> Shared

    %% Click Events
    click WebApp "https://github.com/dailydotdev/apps/tree/main/packages/webapp/"
    click Pages "https://github.com/dailydotdev/apps/tree/main/packages/webapp/pages/"
    click WebComponents "https://github.com/dailydotdev/apps/tree/main/packages/webapp/components/"
    click Background "https://github.com/dailydotdev/apps/tree/main/packages/extension/src/background/"
    click Companion "https://github.com/dailydotdev/apps/tree/main/packages/extension/src/companion/"
    click Content "https://github.com/dailydotdev/apps/tree/main/packages/extension/src/content/"
    click NewTab "https://github.com/dailydotdev/apps/tree/main/packages/extension/src/newtab/"
    click Permission "https://github.com/dailydotdev/apps/tree/main/packages/extension/src/permission/"
    click Components "https://github.com/dailydotdev/apps/tree/main/packages/shared/src/components/"
    click Hooks "https://github.com/dailydotdev/apps/tree/main/packages/shared/src/hooks/"
    click Contexts "https://github.com/dailydotdev/apps/tree/main/packages/shared/src/contexts/"
    click GraphQLShared "https://github.com/dailydotdev/apps/tree/main/packages/shared/src/graphql/"
    click WebGraphQL "https://github.com/dailydotdev/apps/tree/main/packages/webapp/graphql/"
    click Storybook "https://github.com/dailydotdev/apps/tree/main/packages/storybook/"
    click ESLint "https://github.com/dailydotdev/apps/tree/main/packages/eslint-config/"
    click Prettier "https://github.com/dailydotdev/apps/tree/main/packages/prettier-config/"
    click Styles "https://github.com/dailydotdev/apps/tree/main/packages/shared/src/styles/"
    click Lib "https://github.com/dailydotdev/apps/tree/main/packages/shared/src/lib/"
    click Icons "https://github.com/dailydotdev/apps/tree/main/packages/shared/src/components/icons/"

    classDef shared fill:#90EE90
    classDef extension fill:#ADD8E6
    classDef webapp fill:#FFB6C1
    classDef devtool fill:#D3D3D3
```
