1
0
Fork 0
mirror of https://github.com/s-frick/effigenix.git synced 2026-03-28 08:29:36 +01:00

feat: initialize frontend monorepo with pnpm workspace and types package

- Add pnpm workspace configuration with apps/ and packages/
- Create @effigenix/types package with OpenAPI type generation setup
- Add TypeScript strict mode configuration
- Configure ESLint and Prettier for code quality
- Add wrapper files for clean type exports (auth, user, role, common)
- Add custom UI types and enums
This commit is contained in:
Sebastian Frick 2026-02-17 22:13:18 +01:00
parent c2c48a03e8
commit 3ab2c1a57e
17 changed files with 702 additions and 0 deletions

143
frontend/README.md Normal file
View file

@ -0,0 +1,143 @@
# 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
```bash
pnpm install
```
### Development
```bash
# 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
```bash
# Build all packages
pnpm run build
```
## Package Development
### Adding a New Package
```bash
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
```json
{
"dependencies": {
"@effigenix/types": "workspace:*",
"@effigenix/api-client": "workspace:*"
}
}
```
## Type Generation
Types are automatically generated from the backend OpenAPI spec:
```bash
# 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
```bash
# 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 packages
- `pnpm run dev` - Run CLI TUI in dev mode
- `pnpm test` - Run all tests
- `pnpm run typecheck` - Type check all packages
- `pnpm run lint` - Lint all code
- `pnpm run format` - Format all code
## Documentation
See individual package READMEs for detailed documentation:
- [API Client](packages/api-client/README.md)
- [Types](packages/types/README.md)
- [Validation](packages/validation/README.md)
- [Config](packages/config/README.md)
- [CLI TUI](apps/cli/README.md)