# part-4-1/coworkers architecture

> Architecture diagram of the GitHub repository part-4-1/coworkers, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/part-4-1/coworkers
- Repository: https://github.com/part-4-1/coworkers

## Overview

##### Project type and purpose
- This is a full-stack-style frontend application built with Next.js (App Router).
- It provides a collaborative to-do platform (“Coworkers”) where teams can manage tasks, share a free bulletin board, and view user history.
- It hosts static pages (landing, auth, 404) and dynamic pages (group dashboard, boards, tasklists) on Vercel and communicates with an external REST API (base URL in NEXT_PUBLIC_API_URL).

##### File structure
- Top-level directories:
- src/app – Next.js App Router pages and layouts
- src/api – domain-oriented modules wrapping Axios for CRUD against the backend
- src/components – reusable UI pieces (buttons, modals, cards, skeletons)
- src/hooks – custom hooks (React Query API hooks, form hooks, modal, toast, etc.)
- src/utils, src/constants, src/types – shared utilities, constants, and TypeScript types
- public – static assets (images, lottie animations)
- Config and scripts: next.config.ts, Tailwind (tailwind.config.ts), PostCSS, Prettier, Husky, Github Actions for CI.

##### README for additional insights
- Technology stack: Next.js, React, TypeScript, TailwindCSS, React Query, React Hook Form, Axios, Storybook.
- OAuth integration with Kakao.
- Deployed on Vercel.

##### Detail
- Dynamic route patterns (/[groupId], /boards/[articleId], /app/(auth)/*.tsx).
- Data-flow sequence for a typical “complete task” operation:
Browser click → React Query mutation → Axios DELETE /task/:id → REST API → DB → React Query invalidation → UI refresh.
- SSR vs. CSR boundaries: initial page load from Vercel vs. client-side navigation.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Infrastructure Layer
    Client["Client (Browser/Mobile)"]:::infra
    CDN["Vercel CDN & Edge Network"]:::infra
    Client -->|"Page navigation/static assets"| CDN
    CDN -->|"SSR/SSG page render"| NextJS

    %% Application Layer
    subgraph "Next.js Application Layer"
        direction TB
        NextJS["Next.js Serverless Functions"]:::infra
        subgraph "App Router (Pages & Layouts)"
            direction TB
            AppRouter["src/app"]:::ui
            AuthPages["Auth Pages & Layouts"]:::ui
            OAuthKakao["OAuth Kakao Integration"]:::ui
            GroupDash["Group Dashboard & Nested Routes"]:::ui
            Tasklist["Tasklist Module"]:::ui
            Boards["Bulletin Board (Articles/Boards)"]:::ui
            MyHistory["User History Page"]:::ui
            MyPage["User Profile & Settings"]:::ui
            Landing["Landing Page"]:::ui
            NoTeam["No Team Onboarding"]:::ui
            TakeTeam["Take Team Onboarding"]:::ui
        end
        subgraph "Global Providers & Middleware"
            Providers["src/providers.tsx"]:::data
            Middleware["src/middleware.ts"]:::data
            ToastProv["src/toast-provider.tsx"]:::data
            Font["src/font/font.ts"]:::data
        end
        subgraph "UI Component Library"
            Components["src/components"]:::ui
        end
        subgraph "Data Layer"
            direction TB
            APIWrapper["API Wrapper (Axios modules)"]:::data
            Hooks["React Query Hooks"]:::data
            Utils["src/utils, src/constants, src/types"]:::data
        end
        NextJS -->|uses| AppRouter
        NextJS -->|wraps| APIWrapper
        AppRouter -->|renders| Components
        AppRouter -->|calls| Hooks
        Hooks -->|uses| APIWrapper
        APIWrapper -->|HTTP requests| RESTAPI
        AppRouter -->|global| Providers
    end

    %% External Services
    subgraph "External Services"
        direction TB
        RESTAPI["External REST API Backend"]:::external
        OAuthProvider["OAuth Provider (Kakao)"]:::external
    end
    RESTAPI -->|persistence| Database
    OAuthProvider <-->|OAuth Redirect/Token Exchange| Client
    Hooks -->|CRUD calls| RESTAPI

    %% Persistence Layer
    Database["Database"]:::external

    %% Connections
    Client -->|CSR navigation| NextJS
    NextJS -->|SSR data fetch| RESTAPI

    %% Click Events
    click AppRouter "https://github.com/part-4-1/coworkers/tree/develop/src/app"
    click AuthPages "https://github.com/part-4-1/coworkers/tree/develop/src/app/(auth)"
    click OAuthKakao "https://github.com/part-4-1/coworkers/blob/develop/src/app/oauth/kakao/page.tsx"
    click OAuthKakao "https://github.com/part-4-1/coworkers/blob/develop/src/app/oauth/kakao/redirect.tsx"
    click GroupDash "https://github.com/part-4-1/coworkers/blob/develop/src/app/[groupId]/page.tsx"
    click GroupDash "https://github.com/part-4-1/coworkers/tree/develop/src/app/[groupId]/_components"
    click Tasklist "https://github.com/part-4-1/coworkers/blob/develop/src/app/[groupId]/tasklist/page.tsx"
    click Tasklist "https://github.com/part-4-1/coworkers/blob/develop/src/app/[groupId]/tasklist/layout.tsx"
    click Tasklist "https://github.com/part-4-1/coworkers/tree/develop/src/app/[groupId]/tasklist/_components"
    click Tasklist "https://github.com/part-4-1/coworkers/blob/develop/src/app/[groupId]/tasklist/@task/page.tsx"
    click Boards "https://github.com/part-4-1/coworkers/blob/develop/src/app/boards/page.tsx"
    click Boards "https://github.com/part-4-1/coworkers/blob/develop/src/app/boards/layout.tsx"
    click Boards "https://github.com/part-4-1/coworkers/blob/develop/src/app/boards/[articleId]/page.tsx"
    click Boards "https://github.com/part-4-1/coworkers/blob/develop/src/app/boards/write/page.tsx"
    click Boards "https://github.com/part-4-1/coworkers/blob/develop/src/app/boards/[articleId]/edit/page.tsx"
    click Boards "https://github.com/part-4-1/coworkers/tree/develop/src/app/boards/_components"
    click MyHistory "https://github.com/part-4-1/coworkers/blob/develop/src/app/myhistory/page.tsx"
    click MyHistory "https://github.com/part-4-1/coworkers/blob/develop/src/app/myhistory/_components/history-list.tsx"
    click MyPage "https://github.com/part-4-1/coworkers/blob/develop/src/app/mypage/page.tsx"
    click MyPage "https://github.com/part-4-1/coworkers/tree/develop/src/app/mypage/_components"
    click Landing "https://github.com/part-4-1/coworkers/blob/develop/src/app/page.tsx"
    click NoTeam "https://github.com/part-4-1/coworkers/blob/develop/src/app/noteam/page.tsx"
    click TakeTeam "https://github.com/part-4-1/coworkers/blob/develop/src/app/taketeam/page.tsx"
    click APIWrapper "https://github.com/part-4-1/coworkers/blob/develop/src/api/index.ts"
    click APIWrapper "https://github.com/part-4-1/coworkers/tree/develop/src/api/auth"
    click APIWrapper "https://github.com/part-4-1/coworkers/tree/develop/src/api/group"
    click APIWrapper "https://github.com/part-4-1/coworkers/tree/develop/src/api/task"
    click APIWrapper "https://github.com/part-4-1/coworkers/tree/develop/src/api/articles"
    click APIWrapper "https://github.com/part-4-1/coworkers/tree/develop/src/api/comments"
    click APIWrapper "https://github.com/part-4-1/coworkers/tree/develop/src/api/image"
    click APIWrapper "https://github.com/part-4-1/coworkers/tree/develop/src/api/user"
    click Hooks "https://github.com/part-4-1/coworkers/tree/develop/src/hooks/api/auth"
    click Hooks "https://github.com/part-4-1/coworkers/tree/develop/src/hooks/api/group"
    click Hooks "https://github.com/part-4-1/coworkers/tree/develop/src/hooks/api/task"
    click Hooks "https://github.com/part-4-1/coworkers/tree/develop/src/hooks/api/articles"
    click Hooks "https://github.com/part-4-1/coworkers/tree/develop/src/hooks/api/comments"
    click Hooks "https://github.com/part-4-1/coworkers/tree/develop/src/hooks/api/user"
    click Components "https://github.com/part-4-1/coworkers/tree/develop/src/components"
    click Utils "https://github.com/part-4-1/coworkers/tree/develop/src/utils"
    click Utils "https://github.com/part-4-1/coworkers/tree/develop/src/constants"
    click Utils "https://github.com/part-4-1/coworkers/tree/develop/src/types"
    click Providers "https://github.com/part-4-1/coworkers/blob/develop/src/providers.tsx"
    click Middleware "https://github.com/part-4-1/coworkers/blob/develop/src/middleware.ts"
    click ToastProv "https://github.com/part-4-1/coworkers/blob/develop/src/toast-provider.tsx"
    click Font "https://github.com/part-4-1/coworkers/blob/develop/src/font/font.ts"

    %% Styles
    classDef infra fill:#EEEEEE,stroke:#888888,color:#333333
    classDef ui fill:#D0E8FF,stroke:#3B82F6,color:#1E40AF
    classDef data fill:#D1FAE5,stroke:#10B981,color:#065F46
    classDef external fill:#FFE4C0,stroke:#F59E0B,color:#7C2D12
```
