How arpan7777-dot/my-shopping-site works
This is an Astro client-site application with a product catalog, wishlist and product-management APIs, Google sign-in, content-led marketing pages, and invoice/resume tools. Its principal data workflow is product browsing through the catalog API, which reads Turso and caches results; admin/import APIs mutate catalog data and invalidate that cache. Wishlist changes pass through the browser script and API, using Cloudflare KV with Turso-backed persistence. The README is generic Astro starter documentation, so site capabilities are inferred from the file tree and shown excerpts; unsampled page and component internals are not assumed.
Main entry points: turso.ts Turso client · products Product mutations · wishlist.ts Wishlist API · products.ts Product catalog API
Components 26
Site experience
- Home page
src/pages/index.astro - Site components
src/components - Site content
src/content - Page layouts
src/layouts
Catalog and admin
- Product search
src/components/ProductSearch.astro - Product cards
src/components/ProductCard.astro - Product catalog API
src/pages/api/products.ts - Product mutations
src/pages/api/products - CSV product import
src/pages/api/import-drive-csv.ts - Product tag parser
src/scripts/tagParser.ts - Admin page
src/pages/admin.astro - Turso client
src/lib/turso.ts - Turso database
- Product cache
src/pages/api/products.ts
Identity and wishlist
- Login page
src/pages/login.astro - Google sign-in
src/pages/api/auth - Wishlist controls
src/scripts/toggleWishlist.ts - Wishlist API
src/pages/api/wishlist.ts - Pending wishlist store
- Wishlist sync
src/pages/api/syncUserData.ts - Sparkle effects
src/scripts/sparkles.ts - User dashboard
src/pages/user-dashboard.astro
User tools
- Invoice builder
src/pages/tools/invoice-builder.astro - Resume builder
src/pages/tools/resume-builder.astro
Other components
- Site visitor
- Google identity
Connections 16
- Product catalog API → Turso client: queries through
src/pages/api/products.ts - Turso client → Turso database: connects to
src/lib/turso.ts - Product catalog API → Product cache: reads and updates
src/pages/api/products.ts - Product mutations → Turso client: writes through
src/pages/api/products/add-product.ts - Product mutations → Product catalog API: invalidates cache
src/pages/api/products/delete-product.ts - Product mutations → Product tag parser: parses IDs with
src/pages/api/products/delete-product.ts - CSV product import → Turso client: imports into
src/pages/api/import-drive-csv.ts - CSV product import → Product cache: clears cache
src/pages/api/import-drive-csv.ts - Google sign-in → Google identity: exchanges code with
src/pages/api/auth/callback/google.ts - Google sign-in → Turso client: upserts user through
src/pages/api/auth/callback/google.ts - Wishlist controls → Wishlist API: requests wishlist
src/scripts/toggleWishlist.ts - Wishlist controls → Sparkle effects: creates effects with
src/scripts/toggleWishlist.ts - Wishlist API → Pending wishlist store: reads and writes
src/pages/api/wishlist.ts - Wishlist API → Turso client: loads fallback from
src/pages/api/wishlist.ts - Wishlist sync → Pending wishlist store: reads and deletes
src/pages/api/syncUserData.ts - Wishlist sync → Turso client: updates users through
src/pages/api/syncUserData.ts