# shashank-priyadarshi/foca architecture

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

- Interactive diagram: https://gitdiagram.com/shashank-priyadarshi/foca
- Repository: https://github.com/shashank-priyadarshi/foca

## Overview

##### Component Relationships

- Double lines: API calls

##### Detailed Component Breakdown

a) Pomodoro Timer System:
- Timer Context Provider
- Main Timer
- Mini Widget
- Settings Modal

b) Kanban Board System:
- Board Component
- Task Management
- localStorage Integration

c) Spotify Integration:
- Authentication Flow
- Player Controls
- Now Playing Info

##### State Management & Data Flow

A section showing:
- Context Providers (TimerContext)
- Local Storage Interactions
- API Data Flow

##### Technical Stack Indicators

- Next.js 14
- TypeScript
- Tailwind CSS
- shadcn/ui
- Framer Motion

**[User Interface Layer]**
- ↓
**[Application Logic Layer]**
- ↓
**[API & Integration Layer]**
- ↓
**[External Services]**

##### The theming system

Remember to:
- Use consistent styling
- Brief descriptions for complex flows
- Error handling paths
- Asynchronous operations

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Client Side Next.js"
        UI["UI Layer"]
        POM["Pomodoro System"]
        KAN["Kanban Board"]:::kanban
        SPOT["Spotify Widget"]:::spotify
        THEME["Theme Provider"]:::theme
        DEV["Dev Tools"]:::dev
        METR["Your Metrics"]:::metrics
    end

    subgraph "Application Logic"
        TC["Timer Context"]:::timer
        SETTINGS["Settings Modal"]:::settings
        MINI["Mini Widget"]:::timer
        UTILS["Utility Functions"]:::utils
        HOOKS["Custom Hooks"]:::utils
    end

    subgraph "API Routes"
        SPOT_AUTH["Spotify Auth"]:::spotify_api
        SPOT_INT["Spotify Integration"]:::spotify_api
        CALLBACK["Auth Callback"]:::spotify_api
    end

    subgraph "External Services"
        SPOTIFY["Spotify Web API"]:::external
        LOCAL["Local Storage"]:::external
        THEME_SYS["Browser Theme"]:::external
    end

    UI --> POM
    UI --> KAN
    UI --> SPOT
    UI --> THEME
    UI --> DEV
    UI --> METR

    POM --> TC
    POM --> MINI
    POM --> SETTINGS

    SPOT --> SPOT_AUTH
    SPOT --> SPOT_INT
    SPOT_AUTH --> CALLBACK
    CALLBACK --> SPOTIFY

    KAN --> LOCAL
    THEME --> THEME_SYS

    TC -.-> UTILS
    TC -.-> HOOKS

    %% Click Events
    click POM "https://github.com/shashank-priyadarshi/foca/blob/master/src/components/PomodoroTimer.tsx"
    click MINI "https://github.com/shashank-priyadarshi/foca/blob/master/src/components/PomodoroMiniWidget.tsx"
    click TC "https://github.com/shashank-priyadarshi/foca/blob/master/src/contexts/TimerContext.tsx"
    click KAN "https://github.com/shashank-priyadarshi/foca/blob/master/src/components/KanbanBoard.tsx"
    click SPOT "https://github.com/shashank-priyadarshi/foca/blob/master/src/components/SpotifyWidget.tsx"
    click SPOT_INT "https://github.com/shashank-priyadarshi/foca/blob/master/src/utils/spotifyApi.ts"
    click SPOT_AUTH "https://github.com/shashank-priyadarshi/foca/blob/master/src/app/api/spotify/login/route.ts"
    click CALLBACK "https://github.com/shashank-priyadarshi/foca/blob/master/src/app/callback/page.tsx"
    click THEME "https://github.com/shashank-priyadarshi/foca/blob/master/src/components/theme-provider.tsx"
    click SETTINGS "https://github.com/shashank-priyadarshi/foca/blob/master/src/components/SettingsModal.tsx"
    click UI "https://github.com/shashank-priyadarshi/foca/tree/master/src/components/ui"
    click DEV "https://github.com/shashank-priyadarshi/foca/blob/master/src/components/DevTools.tsx"
    click METR "https://github.com/shashank-priyadarshi/foca/blob/master/src/components/YourMetrics.tsx"
    click UTILS "https://github.com/shashank-priyadarshi/foca/blob/master/src/lib/utils.ts"
    click HOOKS "https://github.com/shashank-priyadarshi/foca/tree/master/src/hooks"

    %% Styling
    classDef default fill:#ddd,stroke:#333,stroke-width:2px
    classDef kanban fill:#a5d6a7,stroke:#333
    classDef spotify fill:#1db954,stroke:#333,color:white
    classDef spotify_api fill:#1ed760,stroke:#333,color:white
    classDef theme fill:#9575cd,stroke:#333
    classDef timer fill:#90caf9,stroke:#333
    classDef external fill:#ffcc80,stroke:#333
    classDef utils fill:#b0bec5,stroke:#333
    classDef dev fill:#ef9a9a,stroke:#333
    classDef metrics fill:#ce93d8,stroke:#333
    classDef settings fill:#80deea,stroke:#333
```
