Brewhaus
An AI-driven specialty coffee marketplace for home enthusiasts.
The Problem
Home coffee enthusiasts struggle to find beans matched to their taste. Brewhaus profiles flavor with AI and recommends roasts that fit each palate — turning discovery into an interactive experience.
My Role
Built solo with AI-assisted development — SSR storefront, vector search, AI integration, and Dockerized deployment.
Highlights
- Next.js 15 SSR storefront with gamification and subscription billing
- pgvector semantic search powering AI-driven flavor profiling
- Claude AI integration for personalized recommendations
- Containerized with Docker and served via Cloudflare Tunnels
Stack
Constraints
- Self-hosted on a home server — no cloud bill, but also no auto-scaling.
- Solo build, so the stack had to favour boring, well-documented pieces over novelty.
- AI cost must stay bounded — recommendations had to use embeddings, not a per-request LLM call.
System Architecture
Key Trade-offs
The decisions worth defending — what I chose, what I turned down, and why.
Recommendation engine
Chose
pgvector similarity on cached embeddings
Rejected
LLM call per recommendation
Vector search is millisecond-fast and effectively free once embeddings are computed; LLMs would have added cost and latency per page view.
Public ingress
Chose
Cloudflare Tunnel
Rejected
Public VPS with open ports
No exposed origin IP, free TLS, and DDoS protection inherited from Cloudflare — much smaller attack surface for a self-hosted box.
Rendering model
Chose
Next.js 15 SSR
Rejected
Pure client-rendered SPA
Product pages need to be indexable and shareable; SSR gives fast first paint and clean OG cards without a separate prerender step.
What I'd Do Differently
An honest retrospective — the stuff I'd change with more time, more users, or a second pass.
- 1Move embedding generation to a background queue — synchronous calls during admin product writes briefly blocked the UI.
- 2Add a staging container that mirrors prod data shape so AI tuning doesn't happen against the live DB.
- 3Track recommendation quality with a click-through metric instead of relying on subjective spot-checks.
Technical Deep-Dive
Architecture, specifications, and implementation details.
01 · Executive Summary
Project: Brewhaus — Specialty Coffee Marketplace
Owner: Ice Legends Enterprises
Domain: brewhaus.icelegends.cloud
Stack: Next.js 15 · Docker · Cloudflare Tunnel · PostgreSQL + pgvector · Claude AI
#What Is Brewhaus
Brewhaus is a premium, fully interactive specialty coffee marketplace targeting Romanian home coffee enthusiasts. It is designed to stand apart from every existing competitor through three core differentiators:
-
AI-powered discovery — A 5-question adaptive quiz powered by Claude Haiku builds a taste profile vector, which is matched against the product catalog using cosine similarity search via pgvector.
-
Gamification — A Brew XP system with 5 levels (Bronze → Black), 9 badge types, and exclusive tier-based reward unlocks drives retention without discounts.
-
Ice Cave aesthetic — A completely unique dark navy and glacial blue design language, with stalactite motifs, crystalline card borders, and Orbitron typography — unlike any coffee or e-commerce site in Romania.
#Business Goals
| Goal | Target | Measure |
|---|---|---|
| Launch MVP | Q3 2026 | Site live on icelegends.cloud |
| Monthly Active Users | 1,000 by month 3 | Analytics |
| Subscription conversion | 8% of visitors | Stripe dashboard |
| AI quiz completion rate | > 60% | Event tracking |
| Average order value | RON 140+ | Order analytics |
| Page load (LCP) | < 200ms | Core Web Vitals |
| Uptime | 99.9% | Cloudflare Health Checks |
#Platform Scope — 7 Pages
| Page | Route | Key Feature |
|---|---|---|
| Homepage | / | Hero + AI quiz widget + products |
| Shop | /shop | Full catalog, filters, search |
| Product Detail | /shop/[slug] | 3D viewer, specs, brew guide |
| AI Recommender | /quiz | 5-question Claude-powered quiz |
| Origins Map | /origins | Interactive SVG world map |
| Brew Guides | /guides | 6 guides, XP rewards on completion |
| User Profile | /profile | XP dashboard, orders, badges |
#Technology Decisions
##Why Docker + Cloudflare Tunnel?
The project runs fully containerised with no exposed server ports. All traffic enters via a Cloudflare outbound QUIC tunnel. This means:
- No public IP required
- No port forwarding on the router
- DDoS protection via Cloudflare edge built in
- TLS 1.3 enforced automatically
- Works on any server (VPS, home lab, office machine)
##Why PostgreSQL + pgvector?
Storing taste profile embeddings and product embeddings in the same database as
the product catalog eliminates the need for a separate vector database service.
pgvector's <=> cosine distance operator handles similarity search with
millisecond latency at our scale.
##Why Claude (Haiku + Sonnet)?
- Haiku for the quiz: low latency, low cost, structured JSON output
- Sonnet for brew guide generation: richer language, better recipe quality
#Key Performance Requirements
Page Load (LCP): < 200ms
API Response (p95): < 500ms
AI Quiz Response: < 2 seconds
Vector Search: < 50ms
Concurrent Users: 50,000 peak
Database Connections: 100 pooled via PgBouncer
Cache Hit Rate Target: > 80% on product catalog
Uptime SLA: 99.9% (< 8.7 hours downtime/year)
#Team
| Role | Responsible |
|---|---|
| Architecture | Ice Legends Enterprises |
| Frontend | Ice Legends Enterprises |
| Backend + API | Ice Legends Enterprises |
| AI Integration | Ice Legends Enterprises |
| DevOps / Docker | Ice Legends Enterprises |
| Design System | Ice Legends Enterprises |