What it is
Lattice is a media processing API for image, video, PDF, and HTML conversion. It handles product photo resizing, video transcoding, and PDF compression through four endpoints. The platform includes a self-serve portal for API key management and usage tracking.
Why I built it
Implemented in Rust to handle CPU-bound media processing, streaming uploads, and concurrent job management. The project covers the full lifecycle of a production API, including authentication, billing, and storage. It uses external tool orchestration for specialized file formats.
Technical Highlights
Processing Engine
•10-step image pipeline (rotate, trim, crop, resize, grayscale, etc.) with independent toggling.
•FFmpeg-based video transcoding for WebM, MP4 (H.264, H.265, AV1).
•PDF compression via Ghostscript with four quality presets.
•Processing concurrency managed by a semaphore to prevent system degradation.
Platform Architecture
•Rust with Axum 0.8 for async execution and low memory footprint.
•PostgreSQL via SQLx with compile-time checked queries.
•S3-compatible object storage for processed output with presigned URL delivery.
Auth, Billing & Rate Limiting
•API key authentication for REST endpoints and signed cookie sessions for the portal.
•Stripe integration for checkout and subscription management.
•Rate limiting middleware with per-key tracking.
Webhooks & Extensibility
•Webhook callback system with HMAC-SHA256 signatures and exponential backoff.
•API documentation generated from OpenAPI specs.
What I solved
Implemented asynchronous upload streaming to handle large media files without full memory buffering. Managed the handoff between async multipart parsing and CPU-bound processing. Used semaphore-based concurrency control to maintain predictable performance.
By the numbers
•4 processing endpoints — image, video, PDF, HTML conversion.
•10 composable image pipeline steps.
•7 video output format profiles including broadcast and digital signage.
•Live in production, processing real workloads.
•1 developer — every line of Rust, SQL, HTML, CSS, and JavaScript.