Skip to content

Instantly share code, notes, and snippets.

View domitriusclark's full-sized avatar
🏃‍♂️
Lost in the code

Domitrius domitriusclark

🏃‍♂️
Lost in the code
View GitHub Profile
@domitriusclark
domitriusclark / ECOM_OPTIMIZED.md
Created October 10, 2025 21:41
Ecommerce Recipe v2

Ecommerce Storefront Generation Recipe

Use as-is. Replace Inputs. Keep identifiers, paths, and events unchanged.

Inputs

Brand Name: "<YOUR BRAND NAME>"
Aesthetic Theme: "<YOUR AESTHETIC THEME>"
Reference Sites:
npm create @tanstack/start@latest
npm install @tanstack/ai @tanstack/ai-react @tanstack/ai-openai
git add -A && git commit -m "initial commit of our demo"
gh repo create -s=. --public --push
netlify deploy --create-site <your-site-name> --prod
// src/routes/api/chat.ts
// We'll need to import createFileRoute from Tanstack Router
import { createFileRoute } from "@tanstack/react-router"
import { chat, toStreamResponse } from "@tanstack/ai";
import { openai } from "@tanstack/ai-openai";
// Then we'll wrap the POST request in the expected shell using createFileRoute
export const Route = createFileRoute("/api/chat")({
server: {
// components/Chat.tsx
import { useState } from "react";
import { useChat, fetchServerSentEvents } from "@tanstack/ai-react";
export function Chat() {
const [input, setInput] = useState("");
const { messages, sendMessage, isLoading } = useChat({
connection: fetchServerSentEvents("/api/chat"),
});
// src/routes/index.tsx
import { createFileRoute } from '@tanstack/react-router'
import { Chat } from '../components/Chat'
export const Route = createFileRoute('/')({ component: App })
function App() {
return (
<div className="min-h-screen bg-gradient-to-b from-slate-900 via-slate-800 to-slate-900 text-white">
<Chat />
</div>