# mmdctjj/raetable architecture

> Architecture diagram of the GitHub repository mmdctjj/raetable, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mmdctjj/raetable
- Repository: https://github.com/mmdctjj/raetable

## Overview

1. **What this repo is**
   - `raetable` is a **React + Ant Design** component library for building “easy table” page patterns.
   - The package centers on a reusable table/form workflow rather than a standalone app.

2. **Public API boundary**
   - The main entry point is `src/index.ts`, which re-exports the library’s components, hooks, enums, and utilities.
   - This is the boundary consumers import from; everything under `src/components`, `src/hooks`, `src/enum`, and `src/utils` is internal implementation.

3. **Primary component layer**
   - `src/components` contains the user-facing building blocks:
     - `ETable` for the main table experience
     - `EPage` for page-level composition
     - `EForm`, `EFormItem`, `ESelect` for form/query controls
     - `ETitle`, `ECondition`, `EAnimation`, `ResizeTable`, `ETableProps`
   - The `index.tsx` files in each folder are the component entry points, and the accompanying `.md` files are documentation/examples for each component.

4. **Page composition model**
   - `EPage` appears to be the highest-level composition component, likely combining title, conditions/query form, table, and related actions into a single page pattern.
   - In architecture terms, this is the “container” surface that app code uses to assemble the full CRUD/list page experience.

5. **Table subsystem**
   - `ETable` is the core data-display subsystem.
   - Its demos (`action`, `all`, `drawer`, `extend`, `loading`, `resizeTable`) indicate support for:
     - row actions
     - complete table/page composition
     - drawer-based details
     - loading state
     - extensibility via custom slots/props
     - resizable columns or layout
   - `ETableProps` and `interface.ts` suggest a config-driven API for shaping table behavior.

6. **Form and query subsystem**
   - `EForm` and `EFormItem` form the library’s query/filter/edit form layer.
   - The demos (`base`, `extend`, `linked`) show that forms support:
     - basic field rendering
     - extensible/customized fields
     - linked or dependent fields
   - This subsystem is likely used upstream by `EPage` and `ETable` to drive search/filter input and form-driven interactions.

7. **Stateful coordination via hooks**
   - The hooks directory contains the behavioral core:
     - `useTable`, `usePage`, `useForm`, `useFormItem`
     - `useCondition`, `useAnimation`, `useResize`
     - `useFetch`, `useTrigger`, `useTitle`
     - `useMediator`, `useExtendFormItem`
   - These hooks are where state, effects, async fetching, sizing, and orchestration live, keeping the components thinner and more declarative.

8. **Cross-component coordination**
   - Files like `mediator.ts` in `EFormItem` and the `useMediator` hook imply a coordination pattern between parent forms and child form items.
   - This is important for “linked” or “extended” form scenarios where item behavior is not isolated, but depends on shared state or sibling interactions.

9. **Data flow**
   - Consumer configuration flows into the top-level components (`EPage`, `ETable`, `EForm`).
   - Those components delegate state and behavior to hooks, which manage fetching, layout, and interaction logic.
   - Results and events flow back outward through callbacks/props, while rendering is ultimately backed by Ant Design primitives.

10. **Shared primitives**
   - `src/enum` and `src/utils` contain shared constants and helper functions used across the component and hook layers.
   - These act as the low-level common boundary to avoid duplicating rules or mappings across table/form features.

11. **Documentation and examples are first-class**
   - The `docs/` tree is a Dumi-style documentation site with guides and component pages.
   - Each component folder also has its own markdown docs and demos under `demo/`, which are used to illustrate behavior and likely power the online examples referenced in the README.

12. **Build and release architecture**
   - `.fatherrc.ts` indicates the library build is managed with **Father**.
   - `.dumirc.ts` and `docs/` indicate **Dumi** is used for the documentation site.
   - `.github/workflows/gh-pages.yml` shows the docs site is deployed to GitHub Pages.
   - Husky, ESLint, Prettier, Stylelint, and commitlint define the code-quality and commit-gating boundary around the source.

13. **How to draw the architecture**
   - A good diagram would show:
     - **Consumer app / docs site** at the top
     - **Public library API** (`src/index.ts`) in the middle
     - Two main internal domains beneath it: **table/page composition** and **form/query composition**
     - **Hooks** as the behavioral layer powering both domains
     - **Shared utils/enums** as common dependencies
     - **Docs/demo system** as a separate presentation and verification path
   - The library is therefore best understood as a **config-driven React component system for table-centric admin pages**.

Main entry points: [`src/components`](https://github.com/mmdctjj/raetable/tree/master/src/components) (Components), [`src/hooks/index.ts`](https://github.com/mmdctjj/raetable/blob/master/src/hooks/index.ts) (Hooks), [`src/index.ts`](https://github.com/mmdctjj/raetable/blob/master/src/index.ts) (Public API), [`src/components/ETable/index.tsx`](https://github.com/mmdctjj/raetable/blob/master/src/components/ETable/index.tsx) (ETable)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_source["Source"]
  node_public_api["Public API<br/>entrypoint<br/>[index.ts]"]
  node_components_pkg["Components<br/>ui library"]
  node_hooks_pkg["Hooks<br/>behavior layer<br/>[index.ts]"]
  node_enums_pkg["Enums<br/>shared constants<br/>[index.tsx]"]
  node_utils_pkg["Utils<br/>shared helpers<br/>[index.ts]"]
  node_epage["EPage<br/>page composer<br/>[index.tsx]"]
  node_etable["ETable<br/>table core<br/>[index.tsx]"]
  node_eform["EForm<br/>query form<br/>[index.tsx]"]
  node_eformitem["EFormItem<br/>field adapter<br/>[index.tsx]"]
  node_eselect["ESelect<br/>field control<br/>[index.tsx]"]
  node_etitle["ETitle<br/>heading component<br/>[index.tsx]"]
  node_econdition["ECondition<br/>condition bar<br/>[index.tsx]"]
  node_eanimation["EAnimation<br/>ui behavior<br/>[index.tsx]"]
  node_resize_table["ResizeTable<br/>layout helper<br/>[index.tsx]"]
  node_table_props["ETableProps<br/>table config<br/>[index.tsx]"]
end

subgraph group_docs["Docs"]
  node_docs_site["Docs Site<br/>dumi docs<br/>[index.md]"]
  node_component_docs["Component Docs<br/>mdx demos<br/>[component.md]"]
  node_docs_light["Light Theme<br/>docs variant<br/>[light.md]"]
end

subgraph group_tooling["Tooling"]
  node_father_build["Father Build<br/>build config<br/>[.fatherrc.ts]"]
  node_dumi_config["Dumi Config<br/>docs config<br/>[.dumirc.ts]"]
  node_gh_pages["Pages Deploy<br/>release workflow<br/>[gh-pages.yml]"]
end

node_public_api -->|"exports"| node_components_pkg
node_public_api -->|"exports"| node_hooks_pkg
node_public_api -->|"exports"| node_enums_pkg
node_public_api -->|"exports"| node_utils_pkg
node_components_pkg -->|"contains"| node_epage
node_components_pkg -->|"contains"| node_etable
node_components_pkg -->|"contains"| node_eform
node_components_pkg -->|"contains"| node_eformitem
node_components_pkg -->|"contains"| node_eselect
node_components_pkg -->|"contains"| node_etitle
node_components_pkg -->|"contains"| node_econdition
node_components_pkg -->|"contains"| node_eanimation
node_components_pkg -->|"contains"| node_resize_table
node_etable -->|"configures"| node_table_props
node_epage -->|"composes"| node_eform
node_epage -->|"composes"| node_etable
node_eform -->|"renders"| node_eformitem
node_eformitem -->|"coordinates"| node_hooks_pkg
node_etable -->|"driven by"| node_hooks_pkg
node_eform -->|"driven by"| node_hooks_pkg
node_hooks_pkg -->|"uses"| node_enums_pkg
node_hooks_pkg -->|"uses"| node_utils_pkg
node_docs_site -->|"includes"| node_component_docs
node_docs_site -->|"includes"| node_docs_light
node_component_docs -->|"documents"| node_etable
node_component_docs -->|"documents"| node_eform
node_component_docs -->|"documents"| node_epage
node_father_build -->|"builds"| node_public_api
node_dumi_config -->|"drives"| node_docs_site
node_gh_pages -->|"deploys"| node_docs_site

click node_public_api "https://github.com/mmdctjj/raetable/blob/master/src/index.ts"
click node_components_pkg "https://github.com/mmdctjj/raetable/tree/master/src/components"
click node_hooks_pkg "https://github.com/mmdctjj/raetable/blob/master/src/hooks/index.ts"
click node_enums_pkg "https://github.com/mmdctjj/raetable/blob/master/src/enum/index.tsx"
click node_utils_pkg "https://github.com/mmdctjj/raetable/blob/master/src/utils/index.ts"
click node_epage "https://github.com/mmdctjj/raetable/blob/master/src/components/EPage/index.tsx"
click node_etable "https://github.com/mmdctjj/raetable/blob/master/src/components/ETable/index.tsx"
click node_eform "https://github.com/mmdctjj/raetable/blob/master/src/components/EForm/index.tsx"
click node_eformitem "https://github.com/mmdctjj/raetable/blob/master/src/components/EFormItem/index.tsx"
click node_eselect "https://github.com/mmdctjj/raetable/blob/master/src/components/ESelect/index.tsx"
click node_etitle "https://github.com/mmdctjj/raetable/blob/master/src/components/ETitle/index.tsx"
click node_econdition "https://github.com/mmdctjj/raetable/blob/master/src/components/ECondition/index.tsx"
click node_eanimation "https://github.com/mmdctjj/raetable/blob/master/src/components/EAnimation/index.tsx"
click node_resize_table "https://github.com/mmdctjj/raetable/blob/master/src/components/ResizeTable/index.tsx"
click node_table_props "https://github.com/mmdctjj/raetable/blob/master/src/components/ETableProps/index.tsx"
click node_docs_site "https://github.com/mmdctjj/raetable/blob/master/docs/index.md"
click node_component_docs "https://github.com/mmdctjj/raetable/blob/master/docs/guide/component.md"
click node_docs_light "https://github.com/mmdctjj/raetable/blob/master/docs/light/light.md"
click node_father_build "https://github.com/mmdctjj/raetable/blob/master/.fatherrc.ts"
click node_dumi_config "https://github.com/mmdctjj/raetable/blob/master/.dumirc.ts"
click node_gh_pages "https://github.com/mmdctjj/raetable/blob/master/.github/workflows/gh-pages.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_public_api,node_components_pkg,node_hooks_pkg,node_enums_pkg,node_utils_pkg,node_epage,node_etable,node_eform,node_eformitem,node_eselect,node_etitle,node_econdition,node_eanimation,node_resize_table,node_table_props toneBlue
class node_docs_site,node_component_docs,node_docs_light toneAmber
class node_father_build,node_dumi_config,node_gh_pages toneMint
```

## Components

### Source

Library implementation and public API

- [Public API](https://github.com/mmdctjj/raetable/blob/master/src/index.ts): entrypoint · Top-level export surface for consumers · `src/index.ts`
- [Components](https://github.com/mmdctjj/raetable/tree/master/src/components): ui library · Reusable table, form, page, and control components · `src/components`
- [Hooks](https://github.com/mmdctjj/raetable/blob/master/src/hooks/index.ts): behavior layer · State, effects, orchestration, and shared logic · `src/hooks/index.ts`
- [Enums](https://github.com/mmdctjj/raetable/blob/master/src/enum/index.tsx): shared constants · Cross-component constants and mappings · `src/enum/index.tsx`
- [Utils](https://github.com/mmdctjj/raetable/blob/master/src/utils/index.ts): shared helpers · Common helper functions used across the library · `src/utils/index.ts`
- [EPage](https://github.com/mmdctjj/raetable/blob/master/src/components/EPage/index.tsx): page composer · High-level page composition for list and CRUD flows · `src/components/EPage/index.tsx`
- [ETable](https://github.com/mmdctjj/raetable/blob/master/src/components/ETable/index.tsx): table core · Primary data table subsystem · `src/components/ETable/index.tsx`
- [EForm](https://github.com/mmdctjj/raetable/blob/master/src/components/EForm/index.tsx): query form · Form/query subsystem for filtering and editing · `src/components/EForm/index.tsx`
- [EFormItem](https://github.com/mmdctjj/raetable/blob/master/src/components/EFormItem/index.tsx): field adapter · Form item integration and linked-field behavior · `src/components/EFormItem/index.tsx`
- [ESelect](https://github.com/mmdctjj/raetable/blob/master/src/components/ESelect/index.tsx): field control · Specialized select control for form usage · `src/components/ESelect/index.tsx`
- [ETitle](https://github.com/mmdctjj/raetable/blob/master/src/components/ETitle/index.tsx): heading component · Page and section title display · `src/components/ETitle/index.tsx`
- [ECondition](https://github.com/mmdctjj/raetable/blob/master/src/components/ECondition/index.tsx): condition bar · Condition and filter container · `src/components/ECondition/index.tsx`
- [EAnimation](https://github.com/mmdctjj/raetable/blob/master/src/components/EAnimation/index.tsx): ui behavior · Animation helper component · `src/components/EAnimation/index.tsx`
- [ResizeTable](https://github.com/mmdctjj/raetable/blob/master/src/components/ResizeTable/index.tsx): layout helper · Resizable table layout support · `src/components/ResizeTable/index.tsx`
- [ETableProps](https://github.com/mmdctjj/raetable/blob/master/src/components/ETableProps/index.tsx): table config · Table prop/config surface · `src/components/ETableProps/index.tsx`

### Docs

Documentation site and component demos

- [Docs Site](https://github.com/mmdctjj/raetable/blob/master/docs/index.md): dumi docs · Documentation and examples site · `docs/index.md`
- [Component Docs](https://github.com/mmdctjj/raetable/blob/master/docs/guide/component.md): mdx demos · Per-component docs and demos · `docs/guide/component.md`
- [Light Theme](https://github.com/mmdctjj/raetable/blob/master/docs/light/light.md): docs variant · Lightweight documentation theme/page · `docs/light/light.md`

### Tooling

Build, release, and code quality

- [Father Build](https://github.com/mmdctjj/raetable/blob/master/.fatherrc.ts): build config · Library build and packaging configuration · `.fatherrc.ts`
- [Dumi Config](https://github.com/mmdctjj/raetable/blob/master/.dumirc.ts): docs config · Documentation site configuration · `.dumirc.ts`
- [Pages Deploy](https://github.com/mmdctjj/raetable/blob/master/.github/workflows/gh-pages.yml): release workflow · GitHub Pages deployment workflow · `.github/workflows/gh-pages.yml`

## Connections

- Public API → Components: exports · Re-exports component entry points
- Public API → Hooks: exports · Re-exports hook APIs
- Public API → Enums: exports · Re-exports shared enums
- Public API → Utils: exports · Re-exports shared utilities
- Components → EPage: contains · Page-level composition component
- Components → ETable: contains · Core table component
- Components → EForm: contains · Form/query component
- Components → EFormItem: contains · Form item integration
- Components → ESelect: contains · Supporting select control
- Components → ETitle: contains · Title component
- Components → ECondition: contains · Condition/filter container
- Components → EAnimation: contains · Animation helper
- Components → ResizeTable: contains · Resizable table helper
- ETable → ETableProps: configures · Table behavior and props contract
- EPage → EForm: composes · Uses form for query and filters
- EPage → ETable: composes · Uses table for list display
- EForm → EFormItem: renders · Builds fields from form items
- EFormItem → Hooks: coordinates · Depends on mediator and form hooks
- ETable → Hooks: driven by · Table state, fetch, resize, and triggers live in hooks
- EForm → Hooks: driven by · Form state and linkage live in hooks
- Hooks → Enums: uses · Shared behavior constants and modes
- Hooks → Utils: uses · Common helpers for orchestration logic
- Docs Site → Component Docs: includes · Guide pages and component documentation
- Docs Site → Light Theme: includes · Alternative docs presentation
- Component Docs → ETable: documents · Table usage examples and demos
- Component Docs → EForm: documents · Form usage examples and demos
- Component Docs → EPage: documents · Page composition examples and demos
- Father Build → Public API: builds · Packages the library entrypoint
- Dumi Config → Docs Site: drives · Configures the documentation site
- Pages Deploy → Docs Site: deploys · Publishes docs to GitHub Pages
