How mororyou/skill-sheets-service works
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.