mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 08:29:36 +01:00
- Move Java backend to backend/ directory - Create frontend/ directory for TypeScript TUI and future WebUI - Update .gitignore for Node.js and worktrees - Update README.md with new repository structure - Copy documentation to backend/
7.9 KiB
7.9 KiB
Effigenix Fleischerei ERP
ERP-System für Fleischereien mit HACCP-Compliance, GoBD-konform, Mehrfilialen-Support.
Repository Structure
effigenix/
├── backend/ # Java Spring Boot Backend
│ ├── src/ # Java source code (DDD + Clean Architecture)
│ ├── docs/ # Backend documentation
│ └── pom.xml # Maven configuration
│
└── frontend/ # TypeScript Frontend (TUI & WebUI)
├── apps/ # Applications (CLI TUI, WebUI)
└── packages/ # Shared packages (api-client, types, validation)
Architektur
Domain-Driven Design + Clean Architecture + Java 21 + Spring Boot
┌─────────────────────────────────────────────────────┐
│ Presentation (REST Controllers) │
└─────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────┐
│ Application Layer (Use Cases) │
│ - Transaction Script for Generic Subdomains │
│ - Rich Domain Model for Core Domains │
└─────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────┐
│ Domain Layer (DDD Tactical Patterns) │
│ - Aggregates, Entities, Value Objects │
│ - Domain Events, Repositories │
└─────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────┐
│ Infrastructure Layer │
│ - Spring, JPA, PostgreSQL, JWT, REST │
└─────────────────────────────────────────────────────┘
Bounded Contexts (11)
Core Domains (7)
- Production Management - Rezeptverwaltung, Chargenproduktion
- Quality Management - HACCP-Compliance, Temperaturüberwachung
- Inventory Management - Bestandsführung, Lagerverwaltung
- Procurement - Einkauf, Wareneingang, Lieferanten
- Sales - Auftragserfassung, Rechnungsstellung, Kunden
Supporting Domains (3)
- Labeling - Etikettendruck mit HACCP-Daten
- Filiales - Mehrfilialen-Verwaltung
Generic Subdomains (3)
- User Management - Authentifizierung, Autorisierung, Rollen
- Reporting - Standard-Reports
- Notifications - E-Mail/SMS-Benachrichtigungen
Tech Stack
- Java 21 (Records, Sealed Interfaces, Pattern Matching)
- Spring Boot 3.2 (Spring Security 6, Spring Data JPA 3)
- PostgreSQL 15+ (Produktiv-DB)
- JWT (Stateless Authentication)
- Flyway (Schema Migrations)
- Maven (Build Tool)
Getting Started
Backend (Java Spring Boot)
Prerequisites:
- Java 21+
- Maven 3.9+
- PostgreSQL 15+
- Docker (optional, für PostgreSQL)
Database Setup:
# PostgreSQL mit Docker
docker run --name effigenix-postgres \
-e POSTGRES_DB=effigenix \
-e POSTGRES_USER=effigenix \
-e POSTGRES_PASSWORD=effigenix \
-p 5432:5432 \
-d postgres:15
Build & Run:
cd backend
# Build
mvn clean install
# Run
mvn spring-boot:run
# Run with specific profile
mvn spring-boot:run -Dspring-boot.run.profiles=dev
API Documentation:
Nach dem Start verfügbar unter:
- Swagger UI: http://localhost:8080/swagger-ui.html
- OpenAPI Spec: http://localhost:8080/api-docs
Frontend (TypeScript TUI)
Prerequisites:
- Node.js 20+
- pnpm 9+
Setup & Run:
cd frontend
# Install dependencies
pnpm install
# Run TUI in dev mode
pnpm run dev
# Build for production
pnpm run build
Detailed frontend documentation: frontend/README.md
Project Structure
Backend (Java):
backend/src/main/java/de/effigenix/
├── domain/ # Domain Layer (keine Framework-Dependencies!)
│ └── usermanagement/
│ ├── User.java
│ ├── Role.java
│ ├── UserId.java
│ └── UserRepository.java
├── application/ # Application Layer (Use Cases)
│ └── usermanagement/
│ ├── CreateUser.java
│ ├── AuthenticateUser.java
│ └── dto/
├── infrastructure/ # Infrastructure Layer
│ ├── persistence/
│ ├── security/
│ ├── web/
│ └── audit/
└── shared/ # Shared Kernel
├── security/ # AuthorizationPort, Action
└── common/ # Result, ApplicationError
backend/src/main/resources/
└── db/migration/ # Liquibase Migrations
Frontend (TypeScript):
frontend/
├── apps/
│ └── cli/ # Terminal UI (Ink)
│ ├── src/
│ │ ├── components/ # UI components
│ │ ├── hooks/ # React hooks
│ │ └── state/ # State management
│ └── package.json
│
└── packages/ # Shared packages (reusable for WebUI)
├── api-client/ # HTTP client für Backend API
├── types/ # TypeScript types (generated from OpenAPI)
├── validation/ # Zod schemas
└── config/ # Shared configuration
User Management (Generic Subdomain)
Vordefinierte Rollen
| Rolle | Permissions | Zielgruppe |
|---|---|---|
| ADMIN | Alle | Systemadministrator |
| PRODUCTION_MANAGER | RECIPE_, BATCH_, PRODUCTION_ORDER_* | Leiter Produktion |
| PRODUCTION_WORKER | RECIPE_READ, BATCH_* | Produktionsmitarbeiter |
| QUALITY_MANAGER | HACCP_, TEMPERATURE_LOG_ | Qualitätsbeauftragter |
| QUALITY_INSPECTOR | TEMPERATURE_LOG_, GOODS_INSPECTION_ | QM-Mitarbeiter |
| PROCUREMENT_MANAGER | PURCHASE_ORDER_, SUPPLIER_ | Einkaufsleiter |
| WAREHOUSE_WORKER | STOCK_, INVENTORY_COUNT_ | Lagermitarbeiter |
| SALES_MANAGER | ORDER_, INVOICE_, CUSTOMER_* | Verkaufsleiter |
| SALES_STAFF | ORDER_READ/WRITE, CUSTOMER_READ | Verkaufsmitarbeiter |
AuthorizationPort (für andere BCs)
// Typsichere, fachliche Authorization - kein direkter Zugriff auf User/Roles!
public interface AuthorizationPort {
boolean can(Action action);
void assertCan(Action action);
boolean can(Action action, ResourceId resource);
void assertCan(Action action, ResourceId resource);
ActorId currentActor();
Optional<BranchId> currentBranch();
}
// Beispiel: Production BC
public class CreateRecipe {
private final AuthorizationPort authPort;
public Result<ApplicationError, RecipeDTO> execute(CreateRecipeCommand cmd) {
authPort.assertCan(ProductionAction.RECIPE_WRITE);
// Business logic...
}
}
Testing
Backend:
cd backend
# Unit Tests
mvn test
# Integration Tests
mvn verify
# Test Coverage
mvn clean verify jacoco:report
Frontend:
cd frontend
# Unit Tests
pnpm test
# Test Coverage
pnpm run test:coverage
# Type Check
pnpm run typecheck
License
Proprietary - Effigenix GmbH
Contact
- Project Lead: sebi@effigenix.com
- Architecture: DDD + Clean Architecture
- Documentation: /docs/mvp/