Skip to content

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:

  1. Code Sharing: Common utilities and types can be shared between applications
  2. Unified Tooling: Single configuration for linting, formatting, and testing
  3. Atomic Changes: Related changes across applications can be made in single commits
  4. Efficient CI/CD: Build and test processes can be optimized for the entire workspace
  5. Developer Experience: Single repository clone with all related code