# quentinjuarez/paint-emoji architecture

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

- Interactive diagram: https://gitdiagram.com/quentinjuarez/paint-emoji
- Repository: https://github.com/quentinjuarez/paint-emoji

## Overview

##### Project type and purpose
- It has no in-repo backend; instead, it communicates with external APIs (for auth, drawing persistence, user data) and third-party services (Google OAuth, Slack emoji lists).

##### File structure
Top-level areas:
- src/ – all Vue components, composables, plugins, stores, services, router, middleware, utils, assets, theme, types.
- src/services/api – thin HTTP wrappers to external REST endpoints (auth, drawing, user).
- src/stores – global state (Pinia).
- src/router – route definitions and navigation.
- src/plugins/services.ts – plugin that injects API client into Vue app.
- scripts/ – release bump & deploy scripts.
- config – Vite, PostCSS, Tailwind, ESLint, Prettier, Husky, Vercel.

##### Key insights from README
- Minimal README points to a public demo URL.
- Implicit architecture: front-end app deployed on Vercel, connecting to remote backend services.

##### Main components & relationships
a. Components to illustrate:
1. User’s Browser / Client
2. Front-end SPA
– Presentation Layer: Vue components (DrawCanvas, EmojiList, etc.)
– Router Layer: vue-router
– State Layer: Pinia stores
– Service Layer: API clients (services/api/*.ts)
– Utility Layer: composables, directives, utils, i18n
3. Build & Deployment Pipeline
– Vite (dev server & build)
– scripts/*.sh (version bump & Vercel deploy)
4. External Services
– Auth Provider (Google OAuth)
– PaintEmoji Backend API (auth, drawing, user endpoints)
– Slack Emoji API (data import)

b. Interactions & data flows:
- Browser → (Vue Router) → Components → (Pinia actions) → Services → HTTP → Backend API
- Components pull from Pinia state; Pinia invokes composables and services.
- On app init, plugins/services register HTTP client globally.
- Asset loading (patterns, emojis) from local src/assets and remote Slack API.
- Community save/browse → backend.
- OAuth login → redirects to Google → callback to frontend → exchange code via auth service.

c. Architectural patterns & principles:
- Layered architecture (presentation, state, service, data).
- Component-based modularity (Base vs. Feature components).
- Single-page application with client-side routing.
- Unidirectional data flow: components dispatch store actions → services → update store → components react.
- Plugin injection for cross-cutting concerns (API client, i18n).

d. Technologies & frameworks:
- Vue 3 + Composition API
- Pinia for state management
- Vue Router
- Vite for bundling & dev server
- TypeScript
- PostCSS & Tailwind CSS
- Husky + ESLint + Prettier for quality
- Vercel for hosting

##### Don’t overthink—capture essential modules
- You don’t need individual every‐file nodes; cluster by feature folder.
- You call out the four major layers, the external boundaries (OAuth, backend), and the build/deploy step.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core App Entry
    subgraph "Core App Entry"
        direction TB
        Main["src/main.ts"]:::entry
        App["src/App.vue"]:::entry
    end

    %% Plugin Injection
    Plugin["Plugin: services.ts"]:::plugin

    %% Router Layer
    subgraph "Router Layer"
        direction TB
        RouterIndex["index.ts"]:::router
        RouterRoutes["routes.ts"]:::router
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        subgraph "Base UI"
            Base["src/components/Base/"]:::presentation
        end
        subgraph "Draw Feature"
            Draw["src/components/Draw/"]:::presentation
        end
        subgraph "GIF Feature"
            Gif["src/components/Gif/"]:::presentation
        end
        subgraph "Icant Feature"
            Icant["src/components/Icant/"]:::presentation
        end
        subgraph "Layout Primitives"
            LayoutComp["src/components/Layout/"]:::presentation
        end
        subgraph "User UI"
            UserUI["src/components/User/"]:::presentation
        end
        subgraph "Write Feature"
            Write["src/components/Write/"]:::presentation
        end
    end

    %% Layouts
    subgraph "Layouts"
        direction TB
        DesktopLayout["DesktopLayout.vue"]:::presentation
        EmptyLayout["EmptyLayout.vue"]:::presentation
    end

    %% State Layer
    subgraph "State Layer"
        direction TB
        StoreIndex["index.ts"]:::state
        OnlineStore["online.ts"]:::state
        PluginStore["plugin.ts"]:::state
    end

    %% Service Layer
    subgraph "Service Layer"
        direction TB
        APIIndex["src/services/index.ts"]:::service
        AuthAPI["auth.ts"]:::service
        DrawingAPI["drawing.ts"]:::service
        UserAPI["user.ts"]:::service
    end

    %% Utility Layer
    subgraph "Utility Layer"
        direction TB
        Composables["src/composables/"]:::util
        Directives["src/directives/vClickOutside.ts"]:::util
        Utils["src/utils/"]:::util
        I18n["src/i18n/"]:::util
    end

    %% Theme & Assets
    subgraph "Theme & Assets"
        direction TB
        Theme["src/theme/index.ts"]:::theme
        Assets["src/assets/"]:::assets
    end

    %% Build & Deployment Pipeline
    subgraph "CI/CD Pipeline"
        direction TB
        ViteConfig["vite.config.ts"]:::pipeline
        TSConfig["tsconfig.json"]:::pipeline
        HTML["index.html"]:::pipeline
        DeployScripts["scripts/"]:::pipeline
        HuskyHooks[".husky/"]:::pipeline
        LintConfig[".eslintrc.cjs/.prettierrc"]:::pipeline
        Tailwind["tailwind.config.cjs"]:::pipeline
        Vercel["vercel.json"]:::pipeline
    end

    %% External Services
    subgraph "External Services"
        direction TB
        GoogleOAuth["Google OAuth"]:::external
        PaintEmojiAPI["PaintEmoji Backend API"]:::external
        SlackAPI["Slack Emoji API"]:::external
    end

    %% User Browser
    Browser["User Browser"]:::external

    %% Flow
    Browser -->|"visits"| Main
    Main -->|"renders"| App
    App -->|"init plugin"| Plugin
    App -->|"use router"| RouterIndex
    RouterIndex -->|"loads routes"| RouterRoutes
    RouterRoutes -->|"navigates to"| Base
    RouterRoutes -->|"navigates to"| Draw
    RouterRoutes -->|"navigates to"| Gif
    RouterRoutes -->|"navigates to"| Icant
    RouterRoutes -->|"navigates to"| LayoutComp
    RouterRoutes -->|"navigates to"| UserUI
    RouterRoutes -->|"navigates to"| Write

    Base -->|"dispatch action"| StoreIndex
    Draw -->|"dispatch action"| StoreIndex
    Gif -->|"dispatch action"| StoreIndex
    Icant -->|"dispatch action"| StoreIndex
    LayoutComp -->|"dispatch action"| StoreIndex
    UserUI -->|"dispatch action"| StoreIndex
    Write -->|"dispatch action"| StoreIndex

    StoreIndex -->|"calls service"| AuthAPI
    StoreIndex -->|"calls service"| DrawingAPI
    StoreIndex -->|"calls service"| UserAPI

    AuthAPI -->|"HTTP"| PaintEmojiAPI
    DrawingAPI -->|"HTTP"| PaintEmojiAPI
    UserAPI -->|"HTTP"| PaintEmojiAPI
    Utils -->|"loads assets"| Assets
    Composables -->|"used by"| Base
    Directives -->|"used by"| Base
    I18n -->|"used by"| App
    Assets -->|"patterns/emojis"| Draw

    PaintEmojiAPI -->|"OAuth flow"| GoogleOAuth
    PaintEmojiAPI -->|"fetch emojis"| SlackAPI

    ViteConfig -->|"builds"| App
    DeployScripts -->|"deploys"| Vercel
    HuskyHooks -->|"pre-commit hooks"| LintConfig

    %% Click Events
    click Base "https://github.com/quentinjuarez/paint-emoji/tree/main/src/components/Base/"
    click Draw "https://github.com/quentinjuarez/paint-emoji/tree/main/src/components/Draw/"
    click Gif "https://github.com/quentinjuarez/paint-emoji/tree/main/src/components/Gif/"
    click Icant "https://github.com/quentinjuarez/paint-emoji/tree/main/src/components/Icant/"
    click LayoutComp "https://github.com/quentinjuarez/paint-emoji/tree/main/src/components/Layout/"
    click UserUI "https://github.com/quentinjuarez/paint-emoji/tree/main/src/components/User/"
    click Write "https://github.com/quentinjuarez/paint-emoji/tree/main/src/components/Write/"
    click RouterIndex "https://github.com/quentinjuarez/paint-emoji/blob/main/src/router/index.ts"
    click RouterRoutes "https://github.com/quentinjuarez/paint-emoji/blob/main/src/router/routes.ts"
    click StoreIndex "https://github.com/quentinjuarez/paint-emoji/blob/main/src/stores/index.ts"
    click OnlineStore "https://github.com/quentinjuarez/paint-emoji/blob/main/src/stores/online.ts"
    click PluginStore "https://github.com/quentinjuarez/paint-emoji/blob/main/src/stores/plugin.ts"
    click AuthAPI "https://github.com/quentinjuarez/paint-emoji/blob/main/src/services/api/auth.ts"
    click DrawingAPI "https://github.com/quentinjuarez/paint-emoji/blob/main/src/services/api/drawing.ts"
    click UserAPI "https://github.com/quentinjuarez/paint-emoji/blob/main/src/services/api/user.ts"
    click APIIndex "https://github.com/quentinjuarez/paint-emoji/blob/main/src/services/index.ts"
    click Plugin "https://github.com/quentinjuarez/paint-emoji/blob/main/src/plugins/services.ts"
    click Composables "https://github.com/quentinjuarez/paint-emoji/tree/main/src/composables/"
    click Directives "https://github.com/quentinjuarez/paint-emoji/blob/main/src/directives/vClickOutside.ts"
    click Utils "https://github.com/quentinjuarez/paint-emoji/tree/main/src/utils/"
    click I18n "https://github.com/quentinjuarez/paint-emoji/blob/main/src/i18n/index.ts"
    click DesktopLayout "https://github.com/quentinjuarez/paint-emoji/blob/main/src/layouts/DesktopLayout.vue"
    click EmptyLayout "https://github.com/quentinjuarez/paint-emoji/blob/main/src/layouts/EmptyLayout.vue"
    click Main "https://github.com/quentinjuarez/paint-emoji/blob/main/src/main.ts"
    click App "https://github.com/quentinjuarez/paint-emoji/blob/main/src/App.vue"
    click Theme "https://github.com/quentinjuarez/paint-emoji/blob/main/src/theme/index.ts"
    click Assets "https://github.com/quentinjuarez/paint-emoji/tree/main/src/assets/"
    click ViteConfig "https://github.com/quentinjuarez/paint-emoji/blob/main/vite.config.ts"
    click TSConfig "https://github.com/quentinjuarez/paint-emoji/blob/main/tsconfig.json"
    click HTML "https://github.com/quentinjuarez/paint-emoji/blob/main/index.html"
    click DeployScripts "https://github.com/quentinjuarez/paint-emoji/tree/main/scripts/"
    click HuskyHooks "https://github.com/quentinjuarez/paint-emoji/tree/main/.husky/pre-commit"
    click LintConfig "https://github.com/quentinjuarez/paint-emoji/blob/main/.eslintrc.cjs"
    click Tailwind "https://github.com/quentinjuarez/paint-emoji/blob/main/tailwind.config.cjs"
    click Vercel "https://github.com/quentinjuarez/paint-emoji/blob/main/vercel.json"

    %% Styles
    classDef presentation fill:#ADD8E6,stroke:#000
    classDef state fill:#90EE90,stroke:#000
    classDef service fill:#FFA500,stroke:#000
    classDef util fill:#DDA0DD,stroke:#000
    classDef router fill:#87CEFA,stroke:#000
    classDef plugin fill:#E0FFFF,stroke:#000
    classDef entry fill:#FFFFE0,stroke:#000
    classDef theme fill:#FFE4B5,stroke:#000
    classDef assets fill:#F5F5DC,stroke:#000
    classDef pipeline fill:#D3D3D3,stroke:#000
    classDef external fill:#CCCCCC,stroke:#000,stroke-dasharray: 5 5
```
