It is a React-based application that allows users to interactively manage and organize hierarchical data structures through an intuitive drag-and-drop interface. Users can rearrange tree nodes, insert nodes as children or siblings, and view detailed information about each node in a sidebar.
Check out the live version of this project here: https://stackblitz.com/github/kaprielov/dynamic-tree
Follow these steps to set up the project locally:
- Install dependencies:
npm install
npm run dev
npm test
Hold cmd button to put element inside
React StrictMode is enabled by default. This may cause repeated requests or effects in development mode. This is expected behavior and helps detect potential side effects in your code.
The following improvements are suggested to enhance the project:
-
CSS Modules: Use CSS Modules to enable scoped and maintainable styles. Add CSS variables
-
State Management: Integrate a state management library like Redux or Zustand to manage complex state logic.
-
Enhance Accessibility: Ensure the application is accessible to all users by: Keyboard Navigation: Allow users to navigate and manipulate the tree using keyboard shortcuts. ARIA Attributes: Implement appropriate ARIA roles and attributes to convey the tree structure to assistive technologies. Focus Management: Manage focus states effectively during drag-and-drop operations.
-
Improve Performance: If more data becomes available, it is better to use
Maprather thanwhileto quickly traverse the tree. For very large trees, implement virtualization to render only the visible portions of the tree, improving performance. Use libraries like react-window or react-virtualized to handle virtualization.
- Cover the rest of the components with tests
- ESlint is not strict enough