Workspace StructureΒΆ
EUDIPLO is organized as a monorepo workspace using pnpm workspaces. This structure allows us to manage multiple related applications in a single repository while maintaining clear separation of concerns.
π Directory StructureΒΆ
eudiplo/
βββ apps/ # Application packages
β βββ backend/ # NestJS API server
β β βββ src/ # Backend source code
β β βββ test/ # Backend tests
β β βββ package.json # Backend dependencies
β β βββ Dockerfile # Backend container definition
β βββ client/ # Angular web interface
β β βββ src/ # Client source code
β β βββ package.json # Client dependencies
β β βββ Dockerfile # Client container definition
β βββ webhook/ # Cloudflare Worker for testing
β βββ src/ # Webhook source code
β βββ package.json # Webhook dependencies
βββ assets/ # Configuration and assets
βββ docs/ # Documentation
βββ deployment/ # Docker Compose configurations
βββ package.json # Root workspace configuration
βββ pnpm-workspace.yaml # pnpm workspace definition
βββ docker-compose.yml # Development compose file
ποΈ ApplicationsΒΆ
Backend (@eudiplo/backend
)ΒΆ
- Technology: NestJS with TypeScript
- Purpose: Core API server for EUDI Wallet integration
- Port: 3000
- Key Features:
- OID4VCI, OID4VP, SD-JWT VC support
- OAuth2 authentication
- Pluggable key management
- Database abstraction
Client (@eudiplo/client
)ΒΆ
- Technology: Angular with TypeScript
- Purpose: Web interface for EUDIPLO management
- Port: 4200
- Key Features:
- Credential issuance configuration
- Presentation request management
- Real-time monitoring
- Admin dashboard
Webhook (test-rp
)ΒΆ
- Technology: Cloudflare Worker
- Purpose: Testing relying party implementation
- Key Features:
- Webhook endpoints for testing
- Presentation verification
- Development utilities
π§ Workspace CommandsΒΆ
The workspace provides several convenient commands:
DevelopmentΒΆ
# Install all dependencies
pnpm install
# Start all applications
pnpm run dev
# Start specific application
pnpm --filter @eudiplo/backend run start:dev
pnpm --filter @eudiplo/client run dev
pnpm --filter test-rp run dev
BuildingΒΆ
# Build all applications
pnpm run build
# Build specific application
pnpm --filter @eudiplo/backend run build
pnpm --filter @eudiplo/client run build
TestingΒΆ
# Test all applications
pnpm run test
# Test specific application
pnpm --filter @eudiplo/backend run test
pnpm --filter @eudiplo/client run test
Linting & FormattingΒΆ
# Check code quality across workspace
pnpm run lint
pnpm run format:check
# Fix issues automatically
pnpm run lint:fix
pnpm run format
π³ Docker IntegrationΒΆ
Each application has its own optimized Dockerfile:
- Backend:
apps/backend/Dockerfile
- Multi-stage build with workspace support - Client:
apps/client/Dockerfile
- Angular build with nginx serving
The root docker-compose.yml
orchestrates both services:
# Start both services
docker compose up -d
# Build and start
docker compose up -d --build
# View logs
docker compose logs -f
π¦ Dependency ManagementΒΆ
The workspace uses pnpm for efficient dependency management:
- Shared dependencies are hoisted to the root
node_modules
- App-specific dependencies remain in their respective
node_modules
- Lockfile (
pnpm-lock.yaml
) ensures consistent installs across environments
Adding DependenciesΒΆ
# Add to workspace root (shared utilities)
pnpm add dependency-name
# Add to specific application
pnpm --filter @eudiplo/backend add dependency-name
pnpm --filter @eudiplo/client add dependency-name
π BenefitsΒΆ
This workspace structure provides:
- Code Sharing: Common utilities and types can be shared between applications
- Unified Tooling: Single configuration for linting, formatting, and testing
- Atomic Changes: Related changes across applications can be made in single commits
- Efficient CI/CD: Build and test processes can be optimized for the entire workspace
- Developer Experience: Single repository clone with all related code