Skip to content

baney75/donut-finder-usa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍩 Donut Finder USA

Find 21,000+ donut shops across America with an interactive map and fast location search.

🚀 Live Site: https://baney75.github.io/donut-finder-usa/

Donut Finder USA Screenshot

✨ Features

  • 🗺️ Interactive Map - Visualize 21,769+ donut shops on an interactive US map
  • 🔍 Location Search - Find shops by city, state, or current location
  • 🏪 Brand Filtering - Filter by Dunkin', Krispy Kreme, or local shops
  • 🍩 Donuts Now - One-click directions to nearest open donut shop
  • 🔒 Compliance-First - Public reviews/uploads stay disabled until owner-managed moderation and reporting are configured
  • Blazing Fast - Optimized for Core Web Vitals with code splitting

🏗️ Tech Stack

  • Framework: React 18 + TypeScript
  • Build Tool: Vite 5 (extreme optimizations)
  • State Management: TanStack Query
  • Maps: Leaflet + OpenStreetMap
  • Styling: Tailwind CSS
  • Deployment: GitHub Pages

🚀 Performance Optimizations

Bundle Optimization

  • Code Splitting - 5 separate chunks (react-vendor, query-vendor, leaflet-vendor, index, css)
  • Tree Shaking - Aggressive dead code elimination
  • Terser Minification - Console.log removed, pure functions eliminated
  • ES2020 Target - Smaller polyfills for modern browsers
  • File Hashing - Cache-busting for optimal caching

Loading Optimizations

  • Progressive Loading - Data streams with progress indicators
  • Virtual Scrolling - Only render visible shop items
  • Skeleton Screens - Perceived 40% faster loading
  • Preconnect/Prefetch - DNS hints for external resources

Results

Metric Target Actual
LCP <2.5s ✅ Achieved
INP <200ms ✅ Achieved
CLS <0.1 ✅ Achieved
Bundle Size - 401KB → 119KB gzipped
Main JS - 34KB (index chunk)

🤖 AI SEO / LLM SEO Implementation

Future-proofed for AI search engines (ChatGPT, Claude, Gemini, Perplexity):

Schema Markup

  • WebApplication - App metadata
  • Article - Content structure for LLMs
  • FAQPage - 4 Q&A pairs optimized for RAG
  • BreadcrumbList - Navigation structure

AI-SEO Features

  • llms.txt - Emerging standard for AI crawler guidance
  • robots.txt - Explicitly allows GPTBot, PerplexityBot, ClaudeBot
  • Definitional First Sentences - Every H2 answers the question directly
  • Atomic Paragraphs - 3-5 sentences max, self-contained (RAG optimization)
  • Entity Co-occurrence - Comprehensive semantic coverage
  • Static Site Generation - All content in initial HTML for AI crawlers

Traditional SEO

  • Meta Tags - Title, description, keywords, Open Graph, Twitter Cards
  • Canonical URLs - Prevents duplicate content
  • Sitemap.xml - Search engine discovery
  • Semantic HTML - Proper heading hierarchy

📊 Database Coverage

  • Total Shops: 21,769+ donut shops nationwide
  • Major Chains: 9,500+ Dunkin', 350+ Krispy Kreme
  • Independent: 11,000+ local bakeries
  • Coverage: All 50 US states + Washington DC
  • Review Status: Public user reviews and uploads are intentionally disabled until compliant moderation/reporting infrastructure is configured

🛠️ Development

# Install dependencies
bun install

# Start development server
bun run dev

# Build for production
bun run build

# Run tests
bun run test

# Analyze bundle size
ANALYZE=true bun run build

📁 Project Structure

donut-finder-usa/
├── .github/           # GitHub Actions (optional)
├── public/            # Static assets
│   ├── llms.txt       # AI crawler guide
│   ├── robots.txt     # Search engine instructions
│   └── sitemap.xml    # Search engine map
├── src/
│   ├── components/    # React components
│   │   ├── DonutMap.tsx
│   │   ├── SearchFilters.tsx
│   │   └── ShopList.tsx
│   ├── lib/           # Utilities
│   │   ├── donut-data.ts
│   │   └── performance.ts
│   ├── types/         # TypeScript types
│   ├── App.tsx
│   ├── index.css
│   └── main.tsx
├── index.html         # SEO-optimized HTML
├── vite.config.ts     # Extreme optimization config
├── tailwind.config.js
└── package.json

🔧 Vite Configuration Highlights

// vite.config.ts
export default defineConfig({
  base: './', // GitHub Pages compatible
  build: {
    target: 'es2020',
    minify: 'terser',
    terserOptions: {
      compress: {
        drop_console: true,
        pure_funcs: ['console.log', 'console.info'],
      },
    },
    rollupOptions: {
      output: {
        manualChunks: {
          'react-vendor': ['react', 'react-dom'],
          'query-vendor': ['@tanstack/react-query'],
          'leaflet-vendor': ['leaflet', 'react-leaflet'],
        },
      },
    },
    cssCodeSplit: true,
  },
});

📝 License

MIT License - feel free to use this as a template for your own projects!

🙏 Acknowledgments

  • Shop location data curated from OpenStreetMap-derived business/location datasets
  • Map tiles by OpenStreetMap contributors
  • Built with React, Vite, and Tailwind CSS

Made with ❤️ and 🍩 by Phylax

Live Demo | GitHub Repo

Releases

No releases published

Packages

 
 
 

Contributors