Let fate decide your next meal!
test.mov
A fun, interactive restaurant selection app built using the BMAD (Build, Measure, Analyse, Deliver) methodology. This project demonstrates modern full-stack development with AI-assisted workflows.
This project was developed using the BMAD methodology - a structured approach to AI-assisted software development that combines traditional product management practices with AI agent orchestration.
What is BMAD?
- Build - Structured development using specialised AI agents (Product Owner, Architect, UX Expert, Developer, QA)
- Measure - Quality gates and validation checkpoints throughout development
- Analyse - Continuous refinement based on feedback and testing
- Deliver - Production-ready code with comprehensive documentation
AI Agents Used:
/po- Product Owner for requirements and validation/architect- System design and architecture decisions/ux-expert- UI/UX design and specifications/dev- Implementation and coding/qa- Quality assurance and test implementation (142 tests built with QA agent)
Key Benefits:
- Systematic approach to AI-assisted development
- Role-based AI agents for specialised tasks
- Comprehensive documentation from planning to deployment
- Quality-first development with built-in validation
Learn More:
- BMAD Method GitHub Repository - Official BMAD methodology and resources
- BMAD Process Documentation - How this project was built using BMAD workflows
- ๐ฏ Instant Decision - Fast 1-second random selection
- ๐จ Beautiful Grid Layout - 6 restaurants with photos in 3x2 grid
- ๐ Clickable Cards - Click any restaurant to view details instantly
- ๐ Celebration Effects - Confetti explosion on every spin
- ๐ฑ Fully Responsive - Works perfectly on mobile and desktop
- โก Live Restaurant Data - Google Places API integration with smart hotel filtering
- ๐ Auto Location Detection - Or manual location entry
- ๐๏ธ Adjustable Search Radius - Control search distance from 1km to 10km
- ๐ Refresh Options - Don't like the options? Get 6 more!
- โญ Google Reviews - View reviews and get directions for any restaurant
- ๐ญ Cuisine Info - Shows restaurant type on each card
- Node.js 20.9.0 or higher
- npm or pnpm
- Google Places API key (for live restaurant data)
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env.local
# Add your Google Places API key to .env.local
# Run development server
npm run devOpen http://localhost:3000 to see the app!
- Visit the homepage - grid loads automatically
- Allow location access when prompted (or enter manually)
- Adjust search radius (1-10km) using the slider if needed
- Wait for nearby restaurants to load (6 options)
- Option A: Click "SPIN!" button to randomly select a restaurant
- Watch the fast random animation (1 second)
- Celebrate with confetti! ๐
- Option B: Click any restaurant card directly to view its details
- View restaurant details in the popup:
- Click "Get Directions" to navigate via Google Maps
- Click "See Reviews" to read Google reviews
- Click "Different Options" to load 6 more restaurants
foodspin/
โโโ app/
โ โโโ page.tsx # Home page with grid spinner
โ โโโ layout.tsx # Root layout
โ โโโ globals.css # Global styles & design tokens
โ โโโ api/
โ โโโ restaurants/ # Google Places API proxy
โโโ components/
โ โโโ GridSpinner.tsx # Main grid spinner (6 options)
โ โโโ SpinButton.tsx # Animated spin button
โ โโโ ResultCard.tsx # Restaurant result display
โ โโโ LocationInput.tsx # Manual location entry
โ โโโ ErrorState.tsx # Error handling UI
โ โโโ ErrorBoundary.tsx # React error boundary wrapper
โโโ __tests__/ # Comprehensive test suite
โ โโโ api/ # API integration tests
โ โโโ components/ # Component tests
โโโ lib/
โ โโโ hooks/ # React hooks
โ โ โโโ useGeolocation.ts # Location detection
โ โ โโโ useRestaurants.ts # Restaurant fetching
โ โโโ utils/ # Utilities
โ โโโ mockRestaurants.ts # Fallback mock data
โโโ types/
โ โโโ restaurant.ts # Restaurant types
โ โโโ google-maps.d.ts # Google Maps types
โ โโโ google-places-api.ts # Google Places API types
โโโ public/ # Static assets
- Next.js 16.1.6 - React framework with App Router
- React 19.2.3 - UI library
- TypeScript 5.x - Type safety
- Tailwind CSS 4.x - Utility-first CSS
- Framer Motion 12.x - Animation library
- canvas-confetti - Celebration animations
- 3x2 grid showing 6 restaurants
- Restaurant photos from Google Places API
- Clickable cards - Click any card to view details instantly
- Fast random animation (1 second) on spin
- Jumps randomly between options
- "Different Options" button to refresh
- Confetti celebration on selection
- Glassmorphism design with backdrop blur
- Restaurant photo with gradient overlay
- Floating emoji badge
- Rating, cuisine types, distance info
- Two action buttons:
- "Get Directions" - Primary button for navigation
- "See Reviews" - Secondary button to read Google reviews
- Smooth spring animation entrance
- Modal popup with dark overlay
- Smooth slider from 1km to 10km
- Real-time radius adjustment
- Visual gradient indicator
- Continuous movement (0.5km increments)
- Gradient background (orange โ gold โ yellow)
- Hover & tap micro-interactions
- Loading state with spinning icon
- Disabled state handling
All animations optimised for 60fps:
- โ
GPU-accelerated transforms (
willChange: 'transform') - โ Reduced blur effects (blur-xl instead of blur-3xl)
- โ Removed continuous animations (static backgrounds)
- โ Simplified text shadows (2 layers instead of 4)
- โ Minimal SVG filters
- โ Optimised confetti particle count
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
- Mobile browsers (iOS 14+, Android 5+)
- User favourites (localStorage)
- Social sharing with custom cards
- Filter by cuisine type and price level
- Settings UI for minimum rating adjustment
- Intelligent meal-time filters
- Reduced motion mode
- Save recent searches
- Restaurant favouriting system
npm run dev # Start development server (localhost:3000)
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm test # Run test suite (Vitest)
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage reportComprehensive test suite with 100% pass rate:
npm test # Run all testsTest Results:
- โ 142 tests passing (100%)
- โ 95 component tests - All UI components fully tested
- โ 47 API integration tests - Complete API route coverage
- โ 0 TypeScript errors - Fully type-safe codebase
- โ 0 ESLint warnings - Clean, maintainable code
Test Coverage Includes:
- Component rendering and interactions
- Google Places API integration
- Caching and rate limiting
- Error handling and edge cases
- Accessibility features
- Keyboard navigation
- Missing data scenarios
- URL generation and routing
Testing Stack:
- Vitest - Fast unit test framework
- React Testing Library - Component testing
- TypeScript - Type safety
- ESLint - Code quality
- Location Detection - Allow location access or enter manually with autocomplete
- Search Radius - Adjust slider from 1-10km and see different results
- Grid Display - Should show 6 restaurants with photos (hotels filtered out)
- Click Cards - Click any restaurant card to view details instantly
- Spin Animation - Click "SPIN!" for random selection (1 second)
- Confetti - Should explode when selection completes
- Result Modal - Should show with dark overlay backdrop
- Get Directions - Should open Google Maps navigation in new tab
- See Reviews - Should open Google Maps reviews page in new tab
- Refresh Options - Click "Different Options" to see more restaurants
- Responsiveness - Try on mobile & desktop
# Upgrade to Node 20+
nvm install 20
nvm use 20# Clean build and reinstall
rm -rf .next node_modules
npm install
npm run devFixed! All hydration issues resolved by loading restaurants client-side only.
Copy .env.example to .env.local and add your Google Places API key:
GOOGLE_PLACES_API_KEY=your_api_key_here
NEXT_PUBLIC_GOOGLE_PLACES_API_KEY=your_api_key_hereGet your API key from Google Cloud Console.
โ Production Ready
- 100% Test Coverage - 142 tests passing (95 component + 47 API tests)
- Type-Safe - 0 TypeScript errors
- Clean Code - 0 ESLint warnings
- Fully Documented - Comprehensive docs and inline comments
โ Core Features Complete
- Grid-based restaurant selection (6 options)
- Clickable restaurant cards for instant details
- Google Places API integration with smart hotel filtering
- Real-time location detection with city name display
- Manual location entry with autocomplete
- Adjustable search radius control (1-10km slider)
- Error handling with helpful messages
- Fast random animation (1 second)
- Google Reviews integration
- Two action buttons (directions + reviews)
- Responsive design
- Caching and rate limiting for API efficiency
This is a portfolio project demonstrating:
- Modern full-stack development skills
- AI-assisted development workflows (BMAD methodology)
- Production-quality code standards
- Systematic problem-solving approach
Feel free to fork and customise! If you're an employer or recruiter, check out the BMAD Process Documentation to see the development methodology in action.
- BMAD Methodology - Structured AI-assisted development approach
- Claude Code - AI development environment
- Next.js & React - Core framework
- Icons from emoji
- Mock photos from Unsplash
- Animations by Framer Motion
- Confetti by canvas-confetti
Want to see how this project was built using BMAD? Check out:
- BMAD Process Documentation - Detailed walkthrough of the development workflow
- Demonstrates systematic use of specialised AI agents (PO, Architect, UX Expert, Developer)
- Shows quality gates, validation checkpoints, and iterative refinement
- Highlights skills relevant to modern software development roles
Made with โค๏ธ using BMAD methodology and Claude Code