bởi Kai

A SQLite database schema and WAL (write-ahead log) artifact for an AI-powered product recommendation engine, storing cached products with style, occasion, color, and size tags alongside user style profiles and persisted recommendation sets with line items. Includes a feedback table for capturing user responses to recommendations, with indexed queries optimized for per-user history retrieval. Built for TypeScript backend developers integrating personalized shopping or catalog recommendation features into their applications, licensed under the Tetrees License.
Backend 8F2X is a TypeScript backend service that powers an AI-driven product recommendation engine. It manages a local SQLite database to cache products, store user style profiles, generate outfit/product recommendations, track recommendation line items, and collect user feedback — all optimized for fast, personalized retrieval.
| Layer | Technology |
|---|---|
| Language | TypeScript |
| Database | SQLite (WAL mode) |
| Storage Format | Local file (data/ai-recs.sqlite) |
better-sqlite3 or @libsql/client)npm install
The SQLite database file is located at:
data/ai-recs.sqlite
The WAL (Write-Ahead Log) mode is active, indicated by the presence of ai-recs.sqlite-shm and ai-recs.sqlite-wal files. Ensure these files are kept together and are not split across deployments.
npm run dev # Development
npm run build # Compile TypeScript
npm start # Production
products_cache| Column | Type | Notes |
|---|---|---|
product_id | TEXT PK | Unique product identifier |
title | TEXT | Product name |
price | REAL | Default 0 |
currency | TEXT | Default USD |
in_stock | INTEGER | Boolean 0/1 |
style_tags | TEXT | JSON array |
occasion_tags | TEXT | JSON array |
colors | TEXT | JSON array |
sizes | TEXT | JSON array |
item_role | TEXT | Default other |
image_url | TEXT | Optional |
updated_at | TEXT | Auto timestamp |
user_profile_cache| Column | Type | Notes |
|---|---|---|
user_id | TEXT PK | |
preferences | TEXT | JSON object |
style_profile | TEXT | JSON object |
updated_at | TEXT | Auto timestamp |
recommendations| Column | Type | Notes |
|---|---|---|
recommendation_id | TEXT PK | |
user_id | TEXT | |
title | TEXT | |
summary | TEXT | Optional |
total_price | REAL | |
matching_reason | TEXT | Optional |
created_at | TEXT | Auto timestamp |
recommendation_items| Column | Type | Notes |
|---|---|---|
recommendation_item_id | TEXT PK | |
recommendation_id | TEXT | FK → recommendations |
product_id | TEXT | |
variant_id | TEXT | Optional |
item_role | TEXT | Default other |
sort_order | INTEGER | Default 0 |
recommendation_feedback| Column | Type | Notes |
|---|---|---|
feedback_id | TEXT PK | |
user_id | TEXT | |
recommendation_id | TEXT | FK → recommendations |
feedback_type | TEXT | e.g. liked, dismissed |
created_at | TEXT | Auto timestamp |
Specific HTTP routes are not visible in the provided source. Endpoint documentation will depend on the router layer built on top of this data layer. The schema supports the following logical operations:
| Action | Description |
|---|---|
| Upsert product | Cache or refresh product data |
| Upsert user profile | Store or update user style preferences |
| Create recommendation | Generate and persist a new AI recommendation set |
| Add recommendation items | Attach products to a recommendation |
| Submit feedback | Record user response to a recommendation |
| Fetch recommendations | Query by user ID, ordered by recency |
Tetrees License
Khởi chạy sandbox cách ly và chạy phía máy chủ — không cần cài đặt cục bộ.
Lần kiểm định sandbox đã hoàn tất và đường chạy được phát hiện đã đạt yêu cầu.
This Express backend / api completed archive review. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
Quy trình avcp-2026-08-04.1 · SHA-256 8d33f7d4b10028ed…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
Đã đánh giá 4 thg 8, 2026
Hướng dẫn cài đặt đầy đủ và prompt tích hợp sẽ mở khóa sau khi mua.
Đưa sản phẩm này thẳng vào AI IDE, trình tạo web hoặc cloud IDE của bạn.
Kết nối Tetrees với AI IDE tương thích để liệt kê sản phẩm bạn sở hữu và nhận ZIP đã xác minh mà không cấp quyền tải lên của người bán.
24 đánh giá
Better than I expected. Used this store / POS to sell my storefront and it cut days off the build.
Great starting point. Picked up "AI Recommendation & Activity Backend Kit" for a client storefront — Handles the edge cases I usually have to patch myself. Minor tweaks needed for my use case but nothing broke.
Rock solid so far. Setup was a single command and it ran first try, and the walkthrough got me running in minutes. Support answered my question fast.
Worth every point. As someone who sells these all day, setup was a single command and it ran first try.
Better than I expected. Dropped this store / POS straight into the storefront; the walkthrough got me running in minutes.
Saved me a ton of time. As someone who sells these all day, the code is readable and the structure makes sense. Would buy from this seller again.
Dropped it into my stack and it just worked. Dropped this store / POS straight into the storefront; examples matched the actual API, which is rare. Would buy from this seller again.
This is a keeper. As someone who sells these all day, zero mystery dependencies, everything is documented.
Worth every point. Picked up this store / POS for a client storefront — TypeScript types are actually accurate, no fighting the compiler.
Rock solid so far. No spaghetti — the folder layout is sane, and examples matched the actual API, which is rare.
Sign in to join the discussion
Loading discussion…