Comfy-Org / Comfy-Org/ComfyUI_frontend

Refactor: Convert repository structure from technical layers to Domain-Driven Design (DDD)

Open
#9,108 0 comments 0 reactions 0 assignees View on GitHub
developer experience
Dominant language
TypeScript
Stars
2k
Forks
704
Avg merge
1d 8h
Merged PRs (30d)
512

Description

## Context

This issue is a follow-up to PR #8860 which added the CurveEditor component. During review, it was identified that the repository would benefit from migrating from a technical layer structure to Domain-Driven Design (DDD).

## Current State

The repository currently uses technical layers with top-level directories like:
- `src/composables`
- `src/components`

## Desired State

Reorganize the codebase to follow Domain-Driven Design principles by grouping related functionality by domain rather than by technical type.

## Proposed Structure

- **Renderer domain**: All rendering-related components, composables, and logic should be moved to the `renderer` domain
- **Base folder**: Pure, reusable utility functions that are domain-agnostic
- **Graph domain**: Graph-related code should be in `core/graph`
- **Workspace domain**: Workspace and chrome UI components should be in `src/workspace`

## Migration Tasks

- [ ] Audit all files in `src/composables` and move to appropriate domains
- [ ] Audit all files in `src/components` and move to appropriate domains
- [ ] Update import paths throughout the codebase
- [ ] Update any build configurations or path aliases as needed
- [ ] Update documentation to reflect the new structure

## References

- Requested by: @christian-byrne
- Related PR: #8860
- Related comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/8860#discussion_r2838844911

## Note

This is a significant refactoring effort that should be planned carefully to minimize disruption. Consider breaking this into smaller, incremental PRs by domain.

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-9108-Refactor-Convert-repository-structure-from-technical-layers-to-Domain-Driven-Design--3106d73d365081e5b3fdcfba14b9a5fa) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Research direction

Start by auditing the files under src/composables and src/components, then review PR #8860 and its related discussion for the motivation. Plan the migration by domain: renderer, base, core/graph, and src/workspace. Done means imports and build or path-alias configuration work with the reorganized structure and the documentation reflects it.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.