mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 08:29:36 +01:00
Monorepo-Setup (pnpm workspaces) mit vier shared Packages und einer TUI-App: Shared Packages: - @effigenix/types: TypeScript-DTOs (UserDTO, RoleDTO, AuthDTO, Enums) - @effigenix/config: API-Konfiguration und Shared Constants - @effigenix/validation: Zod-Schemas für Username, E-Mail und Passwort - @effigenix/api-client: axios-Client mit JWT-Handling (proaktiver + reaktiver Token-Refresh), AuthInterceptor, ErrorInterceptor, Resources für auth/users/roles TUI (apps/cli, Ink 5 / React): - Authentication: Login/Logout, Session-Restore beim Start, JWT-Refresh - User Management: Liste, Anlage (Zod-Inline-Validation), Detailansicht, Passwort ändern, Sperren/Entsperren mit ConfirmDialog - Role Management: Liste, Detailansicht, Zuweisen/Entfernen per RoleSelectList (↑↓) - UX: SuccessDisplay (Auto-Dismiss 3 s), ConfirmDialog (J/N), FormInput mit Inline-Fehlern, StatusBar mit API-URL - Layout: Fullscreen-Modus (alternate screen buffer), Header mit eingeloggtem User - Tests: vitest + ink-testing-library (15 Tests) |
||
|---|---|---|
| .. | ||
| apps/cli | ||
| packages | ||
| .eslintrc.js | ||
| .gitignore | ||
| .gitkeep | ||
| .prettierrc | ||
| IMPLEMENTATION_PLAN.md | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
| tsconfig.base.json | ||
Effigenix Frontend
TypeScript monorepo containing Terminal User Interface (TUI) and shared packages for the Effigenix ERP system.
Structure
frontend/
├── apps/
│ └── cli/ # Terminal UI (Ink)
│
└── packages/ # Shared packages (reusable for WebUI)
├── api-client/ # HTTP client for Backend API
├── types/ # TypeScript types (generated from OpenAPI)
├── validation/ # Zod schemas
└── config/ # Shared configuration
Prerequisites
- Node.js 20+
- pnpm 9+
- Backend running at http://localhost:8080
Getting Started
Install Dependencies
pnpm install
Development
# Run TUI in dev mode
pnpm run dev
# Run tests
pnpm test
# Type check
pnpm run typecheck
# Lint code
pnpm run lint
# Format code
pnpm run format
Build
# Build all packages
pnpm run build
Package Development
Adding a New Package
cd packages
mkdir my-package
cd my-package
pnpm init
Then update package.json:
- Set name to
@effigenix/my-package - Add
"main": "./dist/index.js" - Add
"types": "./dist/index.d.ts" - Add build script:
"build": "tsup src/index.ts"
Using Packages
{
"dependencies": {
"@effigenix/types": "workspace:*",
"@effigenix/api-client": "workspace:*"
}
}
Type Generation
Types are automatically generated from the backend OpenAPI spec:
# Start backend first
cd ../backend
mvn spring-boot:run
# Generate types
cd ../frontend/packages/types
pnpm run generate:types
Technology Stack
- TypeScript - Type-safe JavaScript
- React - UI library (Ink for terminal)
- pnpm - Fast, efficient package manager
- Zod - Runtime validation + type inference
- Axios - HTTP client with interceptors
- tsup - Zero-config TypeScript bundler
- vitest - Fast unit testing
Monorepo Commands
# Install dependencies in root
pnpm install
# Run command in specific package
pnpm run --filter @effigenix/cli dev
# Run command in all packages
pnpm run --recursive build
# Add dependency to specific package
pnpm add axios --filter @effigenix/api-client
Scripts
pnpm run build- Build all packagespnpm run dev- Run CLI TUI in dev modepnpm test- Run all testspnpm run typecheck- Type check all packagespnpm run lint- Lint all codepnpm run format- Format all code
Documentation
See individual package READMEs for detailed documentation: