# mororyou/skill-sheets-service architecture

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

- Interactive diagram: https://gitdiagram.com/mororyou/skill-sheets-service
- Repository: https://github.com/mororyou/skill-sheets-service

## Overview

##### Project Overview and Purpose
- This is a Next.js project bootstrapped with create‑next‑app, oriented around “skill sheets” or “skill pages”. It features a rich UI built with React components and leverages server-side logic to query and display detailed skill-related data.
- The application integrates various libraries (e.g., date‑fns, tanstack-query, microcms, shadcn) to handle data formatting, querying, CMS integration, and UI primitives.
- There is a clear separation between client (UI) and server logic, though within Next.js both are blended in the “app” and “server” directories.

##### Analyzing the File Structure
- Top-Level Components:
- /app: Contains Next.js pages and layout definitions (e.g., layout.tsx, page.tsx, manifest.json) along with the “skill-sheets” folder which houses dynamic routes and pages for individual skill sheets.
- /components: Organizes UI elements and layout components (header, footer, etc.), and feature-specific components (skill-pages, technology badges) which render the UI for skills.
- /libs: Contains utility libraries and integrations for external packages (date‑fns, microcms, shadcn, tanstack‑query). This clearly shows a modular approach to handle external technology concerns.
- /queries: Encapsulates the business logic for fetching and validating skill sheet data (including test specs) likely used with tanstack‑query for caching and data management.
- /server: Implements backend logic using the repository and service pattern. This includes a repository for interfacing with microCMS (src/server/repository) and a service layer for fetching skill sheet data.
- Other configuration and devops files: .github workflows (CI/CD), ESLint, Prettier, Tailwind, TypeScript configurations, etc.

##### Components and Their Interactions
- UI Layer (Frontend):
- Pages in src/app that render the overall layout and specific pages for skill sheets.
- UI components in src/components which include layout parts (header, footer), reusable UI elements (button, card, loader, separator), and feature components for skill pages.
- Data Query Layer:
- The queries in src/queries/skill-sheet that encapsulate the fetching and error-handling logic.
- Communication with the server/service layer to retrieve the latest data for skill sheets.
- Server/Backend Layer:
- Service components (in src/server/service/skill-sheets) handle business logic (e.g., get-skill-sheet-service.ts) and delegate data-retrieval tasks to repository components.
- Repository modules (in src/server/repository) abstract away communication with external data sources (e.g., microCMS), making it easier to swap or upgrade the data provider.
- Integration & Libraries:
- Utility libraries in src/libs provide support for dates (date‑fns), query handling (tanstack‑query), and CMS integration (microcms). This modularity also helps in unit testing components in isolation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend/UI Layer
    subgraph "Frontend/UI"
        subgraph "Pages and Layout"
            A1["Layout (src/app/layout.tsx)"]
            A2["Page (src/app/page.tsx)"]
            A3["Manifest (src/app/manifest.json)"]
            A4["Skill Sheets (src/app/skill-sheets)"]
        end
        subgraph "UI Components"
            B1["Header/Footer Components (src/components/_layout)"]
            B2["Skill Page Components (src/components/feature/skill-pages)"]
        end
    end

    %% Query/Data Layer
    subgraph "Query/Data Layer"
        Q1["Skill-Sheet Query (src/queries/skill-sheet)"]
    end

    %% Server/Backend Layer
    subgraph "Server/Backend Layer"
        S1["Skill Sheet Service (src/server/service/skill-sheets)"]
        S2["CMS Repository (src/server/repository)"]
    end

    %% Utility Libraries
    subgraph "Utility Libraries"
        L1["Date Formatting (src/libs/date-fns)"]
        L2["CMS Integration Lib (src/libs/microcms)"]
        L3["UI Primitives (src/libs/shadcn)"]
        L4["Query Handling Lib (src/libs/tanstack-query)"]
    end

    %% External Integration
    E1["External CMS (microCMS)"]:::external

    %% Data Flow Arrows
    A2 -->|"calls"| Q1
    B2 -->|"rendersData"| Q1
    Q1 -->|"requests"| S1
    S1 -->|"fetchesVia"| S2
    S2 -->|"calls"| E1

    %% Utility Libraries Support
    L4 ---|"supports"| Q1
    L2 ---|"supports"| S2
    L1 ---|"formats"| A2
    L3 ---|"providesUI"| B1

    %% Click Events
    click A1 "https://github.com/mororyou/skill-sheets-service/blob/main/src/app/layout.tsx"
    click A2 "https://github.com/mororyou/skill-sheets-service/blob/main/src/app/page.tsx"
    click A3 "https://github.com/mororyou/skill-sheets-service/blob/main/src/app/manifest.json"
    click A4 "https://github.com/mororyou/skill-sheets-service/tree/main/src/app/skill-sheets"
    click B1 "https://github.com/mororyou/skill-sheets-service/tree/main/src/components/_layout"
    click B2 "https://github.com/mororyou/skill-sheets-service/tree/main/src/components/feature/skill-pages"
    click Q1 "https://github.com/mororyou/skill-sheets-service/tree/main/src/queries/skill-sheet"
    click S1 "https://github.com/mororyou/skill-sheets-service/tree/main/src/server/service/skill-sheets"
    click S2 "https://github.com/mororyou/skill-sheets-service/tree/main/src/server/repository"
    click L1 "https://github.com/mororyou/skill-sheets-service/tree/main/src/libs/date-fns"
    click L2 "https://github.com/mororyou/skill-sheets-service/tree/main/src/libs/microcms"
    click L3 "https://github.com/mororyou/skill-sheets-service/tree/main/src/libs/shadcn"
    click L4 "https://github.com/mororyou/skill-sheets-service/tree/main/src/libs/tanstack-query"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef backend fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef lib fill:#FFD700,stroke:#000,stroke-width:1px;
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:1px;

    class A1,A2,A3,A4,B1,B2,Q1 frontend;
    class S1,S2 backend;
    class L1,L2,L3,L4 lib;
```
