実績・プロジェクト/Gwyneth Prints
バイナリSTLの体積に基づく価格設定と直接Cloudflare R2統合を特徴とするオンデマンド3Dプリントプラットフォーム。

フルスタックの3Dプリントサービス&モデルカタログECプラットフォーム。Cloudflare R2署名付きURLによるクラウド直接ファイル取り込み、正確な体積計算と動的価格設定のためのカスタムバイナリSTL幾何解析、複数チャネルの決済照合(Stripe、Ko-fi、FPS/PayMe手動領収書)、管理者向けギャラリーモデレーション、そして有効期限付きトークンによるデジタルSTLファイル配信を特徴とする。
Key architectural decisions, concrete code implementations, and performance wins behind this project.
Handling large 3D model files (STL models up to 50MB) and payment receipts directly through standard Next.js serverless route handlers introduces heavy payload buffering, memory spikes, and route timeout limits.
Built a presigned URL generation workflow using AWS S3 SDK against Cloudflare R2 endpoints. Filenames are sanitized, MIME types are strictly validated (differentiating STL geometries from image/PDF receipts), and storage keys are partitioned under session user IDs (`uploads/{userId}/` and `receipts/{userId}/`) to enforce zero unauthorized cross-tenant file writes.
Pricing custom 3D prints dynamically requires computing exact model volume in cubic millimeters without requiring users to install native desktop slicer tools.
Implemented signed tetrahedron divergence theorem summation across binary STL facets directly in Node.js/TypeScript. After streaming the object securely from R2 and validating the 50MB payload threshold, the parser reads facet normal vectors and vertex coordinates directly from the IEEE 754 float buffer to compute precise volume in mm³.
Allowing authenticated digital goods distribution and secure model downloads without exposing long-lived access keys, private bucket URLs, or allowing unauthorized link sharing.
Engineered an S3-compatible client wrapper targeting Cloudflare R2 endpoints with scoped presigned URL generators (`getUploadPresignedUrl` with 300s TTL and `getDownloadPresignedUrl` with 60s single-use TTL), pairing digital downloads with database-persisted token hashes.
// community_discussion
Have thoughts, questions, or ideas regarding this system's architecture? Leave a comment below with your GitHub account.