# kushibikimashu/scrum architecture

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

- Interactive diagram: https://gitdiagram.com/kushibikimashu/scrum
- Repository: https://github.com/kushibikimashu/scrum

## Overview

##### Project’s Main Purpose and Type
- The README explains that this repository is a scrum team management application operable via both CLI and web interfaces.
- The project involves managing employees and scrum teams, supporting operations such as initial setup, employee registration, team creation, editing, and developer management.
- It is a full-stack application with a clear separation between the command-line interface (CLI) and a Next.js-based Web interface.

##### File Structure
- The repository is structured into multiple top-level directories:
- apps/cli: Contains the CLI application with commands for initializing the system and managing employees, teams, and developers.
- apps/web: Contains the Next.js web application that provides a graphical interface.
- packages/core: Contains the fundamental business logic, including definitions related to company, scrum artifacts, teams, and events.
- packages/use-case: Holds the application layer implementing various use cases for employee management, scrum team operations, and query services for both CLI and Web.
- packages/config: Contains configuration files for building, testing, etc.
- The clear names such as “developer”, “employee”, “team” in the CLI section and corresponding use-case and repository layers show a clean domain-driven design.
- Presence of testing directories and configuration files suggests a well-organized codebase with a layered structure (Domain, Application, Infrastructure, and Presentation).

##### Key Components to Capture
a. Main Components:
- CLI Application (apps/cli): Command-line interface for executing scrum team commands.
- Web Application (apps/web): Next.js web application with pages and components for scrum team operations.
- Core Domain Layer (packages/core): Contains domain entities and common business logic (employee, scrum team, product backlog, sprint backlog, etc.).
- Application/Use-Case Layer (packages/use-case): Orchestrates application-specific operations, including command handling and query services for both CLI and web.
- Adapters/Repositories (within packages/use-case/src/gateway): Handles interaction with external data sources (like JSON repositories using lowdb).
- Configuration and Build Tools (packages/config, turbo.json, etc.): Supporting the build, linting, and testing processes.
- Documentation (docs): Contains additional information, such as data models and user stories.

b. Relationships and Interactions:
- Both interfaces (CLI and Web) rely on the use-case/application layer to invoke business logic.
- The use-case layer interacts with the core domain to perform operations (e.g., employee commands, scrum-team commands).
- The use-case layer communicates with persistence through adapters (JSON repositories using lowdb).
- The CLI and Web adapters translate user commands and web requests into application service calls.
- The core domain emits or processes scrum events and domain-specific logic to maintain consistency.

c. Architectural Patterns and Design Principles:
- Layered Architecture / Hexagonal (Ports and Adapters) architecture: Separate adapters (CLI, Web) from the core business logic.
- Domain-Driven Design (DDD): Distinct domain entities and use cases for scrum management.
- Clear separation of concerns: UI (CLI/Web), Application logic (use-case), Domain core (packages/core), and Persistence (gateways/repositories).

d. Relevant Technologies and Frameworks:
- Node.js with TypeScript.
- Next.js for the web application.
- CLI built with Node.js command modules.
- Lowdb for JSON-based persistence.
- Configuration and testing tools such as ESLint, Prettier, and Jest.

##### Instructed Elements
- Use clear, descriptive labels for each major component (CLI App, Web App, Use-Case Layer, Core Domain, Repository/Adapter Layer, Configuration/Build Tools).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "User Interfaces"
        CLI["CLI Application"]:::ui
        Web["Web Application"]:::ui
    end

    %% Application Layer
    subgraph "Application Layer"
        UC["Use-Case Layer"]:::app
    end

    %% Domain Layer
    subgraph "Core Domain"
        Core["Core Domain Layer"]:::domain
    end

    %% Infrastructure Layer
    subgraph "Infrastructure"
        Repo["Adapters/Repositories"]:::infra
        Config["Configuration & Build Tools"]:::infra
        Turbo["Turbo Config"]:::infra
        Docs["Documentation"]:::infra
    end

    %% Connections
    CLI -->|"command_call"| UC
    Web -->|"web_query"| UC
    UC -->|"business_logic"| Core
    UC -->|"persist_data"| Repo
    Repo -->|"data_access"| Core
    UC -->|"use_config"| Config
    Config -->|"includes"| Turbo
    Web -->|"docs_reference"| Docs

    %% Click Events
    click CLI "https://github.com/kushibikimashu/scrum/tree/main/apps/cli"
    click Web "https://github.com/kushibikimashu/scrum/tree/main/apps/web"
    click Core "https://github.com/kushibikimashu/scrum/tree/main/packages/core"
    click UC "https://github.com/kushibikimashu/scrum/tree/main/packages/use-case"
    click Repo "https://github.com/kushibikimashu/scrum/tree/main/packages/use-case/src/gateway"
    click Config "https://github.com/kushibikimashu/scrum/tree/main/packages/config"
    click Turbo "https://github.com/kushibikimashu/scrum/blob/main/turbo.json"
    click Docs "https://github.com/kushibikimashu/scrum/tree/main/docs"

    %% Styles
    classDef ui fill:#a6cee3,stroke:#1f78b4,stroke-width:2px;
    classDef app fill:#b2df8a,stroke:#33a02c,stroke-width:2px;
    classDef domain fill:#fb9a99,stroke:#e31a1c,stroke-width:2px;
    classDef infra fill:#fdbf6f,stroke:#ff7f00,stroke-width:2px;
```
