Skip to content
project-robinPublic

About

Mini cloud PDM for hardware teams: parts, immutable revisions, exclusive locks, multi-level BOM with cycle detection, and direct-to-S3 2GB CAD processing on AWS.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

PartVault — Mini Cloud PDM for Hardware Teams

PartVault is a production-grade, serverless Product Data Management (PDM) system for hardware teams. Parts, revisions, BOMs, and CAD files are versioned, locked, audited, and processed asynchronously — all on AWS with pay-per-use pricing.

Architecture

Features

  • Parts & revision lifecycle (Draft → In Review → Released, immutable releases)
  • Direct-to-S3 multipart uploads (up to 2 GB) with SHA-256 content addressing
  • Async file pipeline (S3 → SQS → Lambda) with STL metadata extraction
  • Check-out/check-in locks with expiry and admin override
  • BOM tree, where-used, CSV export, diff, and cycle prevention
  • Role-based access (admin / engineer / viewer) via Cognito groups
  • Audit log, CloudWatch alarms, and CI/CD via GitHub OIDC

Architecture

flowchart LR
  User[Engineer] -->|Hosted UI| Cognito[Cognito User Pool]
  User -->|SPA| CF[CloudFront + S3]
  CF --> API[API Gateway]
  API -->|JWT authorizer| AL[API Lambda]
  AL <--> DDB[(DynamoDB)]
  AL -->|Presigned multipart| S3P[(S3 uploads)]
  S3P -->|ObjectCreated uploads/| Q[SQS + DLQ]
  Q --> W[Worker Lambda]
  W --> DDB
  W --> S3P
Loading

Quickstart

Prerequisites

  • Node.js 22+, pnpm 9+
  • AWS account (region ap-south-1 default, configurable via AWS_REGION)
  • Named AWS profile with admin-equivalent permissions

Install

pnpm install
pnpm build  # builds shared, api, worker, web

Bootstrap CDK (one-time)

export AWS_PROFILE=partvault
export AWS_REGION=ap-south-1
export STAGE=dev
export ALARM_EMAIL=you@example.com
pnpm infra:bootstrap

Deploy

pnpm infra:deploy

Outputs include ApiUrl, WebUrl, UserPoolId, WebClientId, and CognitoDomain. Copy them into apps/web/.env:

cp apps/web/.env.example apps/web/.env
# edit values from cdk outputs

Seed demo data

export TABLE_NAME=$(aws cloudformation describe-stacks --stack-name PartVault-dev --query "Stacks[0].Outputs[?OutputKey=='TableName'].OutputValue" --output text)
export BUCKET_NAME=$(aws cloudformation describe-stacks --stack-name PartVault-dev --query "Stacks[0].Outputs[?OutputKey=='UploadsBucketName'].OutputValue" --output text)
export USER_POOL_ID=$(aws cloudformation describe-stacks --stack-name PartVault-dev --query "Stacks[0].Outputs[?OutputKey=='UserPoolId'].OutputValue" --output text)
pnpm seed

Demo users: admin@demo.local / engineer@demo.local / viewer@demo.local (passwords in scripts/seed.ts — change for production).

Local dev

pnpm --filter partvault-web dev  # http://localhost:5173

Documentation

  • Data model — DynamoDB single-table design and access patterns
  • ADRs — trade-off records
  • Runbook — DLQ investigation, reprocessing, rollback
  • Security — presigned URL scope, authZ, file validation

Cost estimate

Pay-per-use only (Lambda, DynamoDB on-demand, S3, SQS, CloudFront, Cognito, CloudWatch). At demo scale: < $10/month. A Budgets alert fires at 80% of $10.

Teardown

pnpm infra:destroy

Screenshots

Parts list
Part detail — Files
BOM diff

Tests

pnpm test           # Vitest unit tests
pnpm typecheck      # strict TS
pnpm lint           # ESLint + Prettier
pnpm --filter ./infra synth  # CDK synth

About

Mini cloud PDM for hardware teams: parts, immutable revisions, exclusive locks, multi-level BOM with cycle detection, and direct-to-S3 2GB CAD processing on AWS.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages