Skip to content

Improve folder organization and code modularity #11

@bburda

Description

@bburda

Summary

Current src/ structure is flat and will not scale well as the project grows. We need to reorganize into a feature-based/domain-driven structure following React best practices.


Proposed solution

Reorganize from:

src/
├── components/
│   ├── ui/           # shadcn primitives
│   └── *.tsx         # all business components mixed
├── lib/
│   ├── store.ts      # monolithic Zustand store (600+ lines)
│   ├── types.ts
│   ├── sovd-api.ts
│   └── utils.ts

To:

src/
├── components/
│   └── ui/                    # shadcn primitives only
├── features/
│   ├── connection/            # server connection dialog
│   │   ├── components/
│   │   ├── hooks/
│   │   └── store.ts
│   ├── entity-tree/           # tree sidebar & navigation
│   │   ├── components/
│   │   ├── hooks/
│   │   └── store.ts
│   ├── data/                  # topic data viewing & publishing
│   │   ├── components/
│   │   └── hooks/
│   ├── operations/            # services & actions
│   │   ├── components/
│   │   └── hooks/
│   ├── configurations/        # ROS 2 parameters
│   │   ├── components/
│   │   └── hooks/
│   └── faults/                # fault monitoring (new)
│       ├── components/
│       └── hooks/
├── hooks/                     # shared hooks
│   ├── use-debounce.ts
│   └── use-local-storage.ts
├── lib/
│   ├── api/
│   │   ├── client.ts          # base HTTP client with error handling
│   │   ├── areas.ts
│   │   ├── components.ts
│   │   ├── apps.ts
│   │   ├── operations.ts
│   │   └── types.ts
│   ├── utils.ts
│   └── constants.ts
├── theme/                     # theming, dark mode, CSS vars
│   └── index.ts
└── types/                     # shared TypeScript types
    └── index.ts

Additional context

This restructure will:

  • Make codebase easier to navigate for new contributors
  • Enable better code splitting and lazy loading
  • Prepare for upcoming features (Apps, Functions, Faults views)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions