# eamap **Repository Path**: wb04307201/eamap ## Basic Information - **Project Name**: eamap - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-30 - **Last Updated**: 2026-07-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # eamap **eamap** — a TOGAF ADM-based Enterprise Architecture implementation tool. Covers the full 11-phase TOGAF ADM with an **iteration model** (start with a tailored subset like STARTER / GROWING / FULL, then progressively activate more phases as the enterprise matures), a generic **catalog/matrix CRUD** engine driven by `phase_config` JSON, a **4-domain G6 panorama** with cross-layer edge cropping and iteration filtering, **RBAC** with 9 default roles per spec §6.6, and a multi-tab admin shell (header + sidebar driven by `sys_menu` + tabbed content area with right-click "close others / close all"). ## Quick Start Two terminals. ```bash # 1. Backend (Spring Boot, port 9040) cd backend && mvn spring-boot:run # 2. Frontend (Vite, port 9030) cd frontend && npm install && npm run dev ``` Open . ## Default Users | Username | Password | Role | |---------------|-------------|----------------| | `sys_admin` | `admin123` | `SYS_ADMIN` | | `ea_arch` | `test1234` | `EA_ARCHITECT` | | `ba_arch` | `test1234` | `BA_ARCHITECT` | | `data_arch` | `test1234` | `DATA_ARCHITECT`| | `app_arch` | `test1234` | `APP_ARCHITECT` | | `tech_arch` | `test1234` | `TECH_ARCHITECT`| | `pmo` | `test1234` | `PMO` | | `stakeholder` | `test1234` | `STAKEHOLDER` | | `viewer` | `test1234` | `VIEWER` | > **To reset `sys_admin` to `admin123`:** open the H2 console > (`http://localhost:9040/h2-console`, JDBC URL > `jdbc:h2:mem:eamap`, user `sa`, blank password) and run: > `UPDATE sys_user SET password_hash = '$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy' WHERE username = 'sys_admin';` ## Project Structure ``` eamap/ ├── backend/ │ ├── src/main/java/com/eamap/ │ │ ├── EamapApplication.java │ │ ├── common/ ApiResponse, BusinessException, GlobalExceptionHandler │ │ ├── auth/ Cookie auth, CSRF, TokenStore, change password │ │ ├── rbac/ User/role/menu, RbacInterceptor, @RequiresRole, menu/my │ │ ├── workspace/ Project CRUD + iteration #1 auto-create │ │ └── adm/ │ │ ├── phase/ State machines (Phase + Iteration), 11-phase CRUD │ │ ├── catalog/ Generic Catalog CRUD + schema validator │ │ ├── matrix/ Generic Matrix CRUD │ │ └── panorama/ G6 4-domain aggregation + edge cropping │ ├── src/main/resources/ │ │ ├── application.yml │ │ └── db/migration/ V1 schema, V2-V7 seed data (roles/menus/profiles/users) │ └── src/test/java/ 227 unit + integration tests └── frontend/ ├── src/ │ ├── api/ axios + per-domain modules (auth, workspace, catalog, …) │ ├── auth/ AuthProvider (hydrates current user on mount) │ ├── components/ CatalogTable, MatrixGrid, PhaseDiagramView, G6Panorama, … │ ├── layout/ AppShell (header + sidebar + tabbar), ProjectLayout │ ├── pages/ │ │ ├── login/ │ │ ├── workspace/ List + NewProjectWizard (3-dim scoring → profile) │ │ ├── project/ Dashboard, PhaseWorkspace, IterationList, Panorama │ │ └── admin/ User + Role management │ ├── router/ Routes (HashRouter, /app/* wrapped by AppShell) │ ├── store/ useAuth, useWorkspace, useTabStore (Zustand) │ └── utils/ phaseLabel (shared between AppSidebar + wizard) └── package.json ``` ## Tech Stack | Layer | Tech | |----------|-----------------------------------------------------------------------| | Backend | Java 25 · Spring Boot 4 · MyBatis-Plus 3.5 · H2 (in-memory) · Flyway | | Auth | Cookie `eamap_token` (HttpOnly Lax) + `eamap_csrf` (non-HttpOnly Strict) + `X-CSRF-TOKEN` header | | Frontend | Vite 6 · React 19 · TypeScript 5 · antd 6 · Zustand 5 · Axios · `@antv/g6` v5 | | Build | Maven (backend) · npm (frontend) | | Tests | JUnit 5 (backend, 227 tests) · Vitest (frontend, phaseLabel + edge cropping) | ## Architecture Highlights ### Iteration model A project has N `adm_iteration` rows. Each iteration activates a subset of phases via `adm_phase.active_iteration_id`. New iterations can be opened on an existing project (when all current-iteration phases are PUBLISHED, or with SYS_ADMIN force override). RM is always active, never removable. ### Catalog & matrix (generic) Phase config (`adm_phase_config.catalog_types`, `matrix_types`) is stored as JSON. `CatalogService` and `MatrixService` are not per-phase — the backend reads the JSON schema at request time and validates inputs. Adding a new phase or catalog type is a data-only change (V7 seed). ### RBAC `@RequiresRole` annotation + `RbacInterceptor` (Spring HandlerInterceptor). GET endpoints are open to all 9 roles (per spec §6.6 — 浏览任何阶段 is 9/9). Mutation endpoints declare a per-method role list. ### Frontend multi-tab `useTabStore` (Zustand) keeps the open tabs + active tab. Tabs persist in `localStorage`. Right-click on a tab opens a 3-item menu: 关闭当前 / 关闭其他 / 关闭全部. The dropdown position follows the cursor (1px trigger div at `event.clientX/Y`). ## Tests ```bash # Backend (227 tests) cd backend && mvn test # Frontend (vitest) cd frontend && npm test ``` ## Navigation (Fastnav / Pages 化) 3 demo projects seed on cold start. Login as `sys_admin / admin123` (or any of the 8 demo users). The post-login shell exposes four navigation surfaces: - **Sidebar (left rail)** — a contextual **project tree**, not a flat menu. `工作台` is the home; each project expands to `概览 / 阶段 (11) / 全景图 / 迭代`. `系统管理` branch is visible only to `SYS_ADMIN`. The 项目 submenu auto-opens on entry, then respects manual collapse. - **Top breadcrumb** — `eamap / 工作台 / FIN-001 / A — 架构愿景`. Click any non-leaf segment to jump up. The last segment (current page) is bold and not clickable. - **Command palette (`Cmd/Ctrl + K`)** — type to search across projects, phases, admin items. Empty query shows your **10 most recently visited pages** (deduped by path). Pick an item to navigate; recent is updated on every route change, not just palette selections. The 🔍 button in the header is the discoverable alternative. - **Tab strip — opt-in only** — the multi-tab admin shell is *off by default*. To re-enable, open the user menu (top right) → `Tab 模式: 开`. Recent items + browser history cover the same use case for users who leave it off. - **`图示` button** on every phase page (right of the phase title) opens a 90vw modal with the G6 diagram — not a sub-tab any more. Defaults are tuned for keyboard / power-user flow. Hover the 🔍 button for the `Cmd/Ctrl+K` hint. ## Docs - Specs: `docs/superpowers/specs/` — V9 demo data, Fastnav / Pages 化, plus the earlier MVP specs. - Plans: `docs/superpowers/plans/` — V9 demo, Fastnav / Pages 化 14-task plan, plus earlier MVP plans. ## Status (as of latest commit) 90+ commits across MVP + Phase 2/3 + App Shell refactor + 4 polish rounds + V9 demo data + Fastnav / Pages 化 3-phase migration. 227 backend tests pass. Frontend TypeScript clean. 11-phase workspace + G6 panorama + project-tree sidebar + Cmd+K command palette + opt-in tab strip + RBAC + change password all working end-to-end.