How atharv-rem/design-index works
Project Type and Purpose
• This is a frontend-centric, single-page React application (“Design Index”) that provides a searchable directory of design resources.
• It’s hosted on Vercel (static assets + a serverless function for sitemap), connects to Supabase for data/search, and uses Cloudflare R2 to store and serve images.
File Structure Analysis
• Top level
– design-directory/
• api/sitemap.js (Vercel serverless function)
• public/ (robots.txt, sitemap.xml stub)
• src/ (React entrypoints, components, assets)
• supabaseClient.js (Supabase init)
• zustand-global-storage.js (global state management)
• vite.config.js, vercel.json (build & deploy configs)
• Components follow a flat structure under src/components (about, homepage, search bar/results, etc.)
• database.json in src likely mocks or seeds data locally.
• Configuration: package.json, eslint.config.js, Tailwind + Vite setup.
README Insights
• Core tech: React + TailwindCSS, React Router, Zustand, Tanstack Virtualization.
• External services: Supabase (Postgres & search), Cloudflare R2 (static image hosting), Vercel (hosting + functions).
• Purpose: Curated, fast searchable catalogue of mostly free design assets.
a. Main Components
• User’s Browser (React SPA)
• Vercel CDN & Edge (serving index.html, JS bundles, CSS)
• Vercel Serverless Function (api/sitemap.js)
• Supabase (database + search engine)
• Cloudflare R2 (image storage & delivery)
b. Relationships & Data Flows
1. Browser → Vercel CDN (fetch static assets)
2. Browser → Supabase via supabaseClient (REST/GraphQL calls for search & resource data)
3. Browser → Cloudflare R2 (pre-signed URL image fetch)
4. Vercel Function → Supabase (generate sitemap from DB) → returns XML to Vercel → CDN
c. Architectural Patterns
• SPA (frontend heavy) with API-first design
• Serverless functions (sitemap generation)
• External Backend-as-a-Service (Supabase)
• CDN + Object Storage (Vercel + Cloudflare R2)
• Global state via Zustand; virtualization via Tanstack for performance
d. Key Technologies
– React, React Router, TailwindCSS, Zustand, Tanstack Virtualization
– Vite (build tool), Vercel (hosting + functions)
– Supabase (DB & search), Cloudflare R2 (images)