ποΈ Yorkie Bakery β System Architecture Overview
This page provides a technical high-level overview (HLD) of the Yorkie Bakery platform, including backend architecture, AI/ML pipeline, database design, and deployment infrastructure. This is intended for recruiters and engineers evaluating my work.
1. High-Level Architecture Diagram
ββββββββββββββββββββββββββ
β React + Vite β
β (AI Demo Frontend) β
βββββββββββββ¬βββββββββββββ
β REST + JSON
βΌ
ββββββββββββββββββββββββ
β FastAPI β
β Auth / Menu / AI β
ββββββββββββ¬ββββββββββββ
β
βββββββββββββββ¬ββββββββββΌββββββββββ¬βββββββββββββββ
βΌ βΌ βΌ βΌ βΌ
PostgreSQL ChromaDB OpenAI AWS S3 (Music) AWS SES
(Menu/Users) Vectors Vision / Audio Store Email Verify
Embedding
2. Backend Architecture (FastAPI)
The backend is a modular FastAPI application deployed on AWS EC2 using Docker Compose. It includes:
- πΉ **User authentication** (register, login, session cookies, email verification)
- πΉ **Menu management** (admin CRUD, S3 image uploads)
- πΉ **Music streaming** (S3 signed URLs)
- πΉ **AI endpoints** for RAG, filters, and image matching
API Modules
auth/β login, register, session, email verificationmenu/β product CRUD, pagination, filtersai/demo/β AI pipeline (LLM filters + vector search)ai/vision/β image upload β OpenAI Vision model
3. AI Menu Recommendation Pipeline
The AI system uses a two-stage hybrid retrieval approach combining LLM semantic understanding with vector similarity search and strict backend filtering.
Pipeline Steps
- **User sends text or image** from the React demo.
- FastAPI calls **OpenAI** to extract:
- category (pastry / dessert / drink)
- origin (japanese / french / thai / β¦)
- flavor profile (sweet, fruity, chewy, creamy)
- price range
- Use **ChromaDB vector store** to retrieve the top 50 candidate menu items.
- Apply **server-side filtering** with `apply_all_filters()`.
- Rank + return the final result set to React.
Vision Image Flow
Upload Image β FastAPI β OpenAI Vision β Tags/Flavor β Vector Search β Recommendations
4. Database Schema
PostgreSQL Tables
user_accountβ auth, email verificationmenu_itemβ title, description, price, tagsmusic_trackβ title, s3_urlorders+order_items(future extension)
ChromaDB Vectors
The embedding store uses OpenAI embedding vectors for each menu item:
{ id, title, tags, flavor_profiles, embedding_vector[] }
5. Deployment Architecture
- π³ **Docker Compose** (FastAPI + Postgres + ChromaDB)
- π Hosted on **AWS EC2**
- π Domain:
yorkiebakery.com - π§ͺ Staging:
beta.yorkiebakery.com - π§ AWS SES β email verification & password reset
- πͺ£ AWS S3 β music tracks + images
6. Future Enhancements
- β User preference profiles (learn from history)
- β Collaborative filtering recommendations
- β Better ranking using LLM scoring + vector similarity
- β Admin analytics dashboard
