projects/Gwyneth Prints
A 3D printing service where customers upload a model and see an instant price, then pay by card or manual transfer. Large files go straight to cloud storage.

The problem. Quoting a custom 3D print by hand is slow: someone has to open each file in slicer software, estimate the material, and reply with a price. Large model files also strain a normal web server.
What I built. Gwyneth Prints, a print-on-demand platform. When a customer uploads an STL model, the site reads the file itself, calculates its volume and shows a price immediately. Files of up to 50MB upload directly to Cloudflare R2 using short-lived signed links, so they never pass through the app server. Payments work through Stripe, Ko-fi and manual receipts (FPS and PayMe), an admin panel moderates the gallery, and digital model files are delivered through expiring download links.
The result. Customers get an instant quote without waiting for a reply, uploads stay fast and safe, and paid digital files can only be downloaded by the person who bought them.
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.