- Location + Niche Input: Search for businesses by location and industry type
- Real Business Discovery: Google Places API & Yelp Business API integration
- Comprehensive Website Analysis:
- Accessibility scoring
- SEO optimization analysis
- Performance metrics
- Mobile-friendliness assessment
- Security evaluation
- ๐จ Professional Redesign Mockups: Complete HTML mockups with industry-specific styling and personalized business names
- ๐ผ๏ธ Visual Preview System: Auto-opening previews in new tabs with improvements panel
- โ Fixed 404 Errors: Robust URL handling with Railway backend integration
- ๐ Business Personalization: Redesigns use actual business data instead of generic placeholders
- AI-Powered Analysis: Industry-specific scoring and recommendations
- Multi-Channel Outreach: Email, WhatsApp, and SMS templates
- CSV Export: Complete business data with scores, redesign links, and outreach messagest MVP
A production-ready 48-hour MVP built with FastAPI (backend) and Next.js (frontend), following the BMAD Method for agile AI-driven development.
This application automates local business discovery, comprehensive website analysis, generates professional HTML redesign mockups with visual previews, and creates personalized outreach campaigns for lead generation.
The application supports both REAL and MOCK data modes:
- ๐ด REAL MODE: Uses Google Places API & Yelp API for actual business data (requires API keys)
- ๐ก DEMO MODE: Uses mock data for immediate testing (default for quick demos)
For production use with real business search, see REAL_DATA_SETUP.md for API configuration.
- Location + Niche Input: Search for businesses by location and industry type
- Real Business Discovery: Google Places API & Yelp Business API integration
- Comprehensive Website Analysis:
- Accessibility scoring
- SEO optimization analysis
- Performance metrics
- Mobile-friendliness assessment
- Security evaluation
- ๐จ Professional Redesign Mockups: Complete HTML mockups with industry-specific styling
- ๐ผ๏ธ Visual Preview System: Full-screen preview with improvements panel
- AI-Powered Analysis: Industry-specific scoring and recommendations
- Multi-Channel Outreach: Email, WhatsApp, and SMS templates
- CSV Export: Complete business data with scores, redesign links, and outreach messages
- 4-Stage Loading Progress: Real-time feedback during analysis
- Professional Error Handling: Comprehensive error states with retry options
- Toast Notifications: Instant user feedback system
- Form Validation: Real-time input validation and guidance
- Responsive Design: Mobile-optimized interface
- Auto-Opening Preview: Redesigns automatically open in new tabs for immediate viewing
- ๐ง Fixed URL Issues: Corrected Railway/Vercel URL priority for working previews
- ๐ Comprehensive Logging: Detailed API request/response tracking for debugging
- ๐ข Business Data Integration: End-to-end personalization with actual business names
# The project is configured for Vercel deployment
# Frontend files are in the /frontend directory
# vercel.json is configured to handle the monorepo structure
# Deploy with Vercel CLI:
npm i -g vercel
vercel --prodcd backend
# Add Procfile for deployment:
echo "web: uvicorn app.main:app --host 0.0.0.0 --port \$PORT" > Procfile# Backend Dockerfile example:
FROM python:3.10-slim
WORKDIR /app
COPY backend/requirements.txt .
RUN pip install -r requirements.txt
COPY backend/ .
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]Create .env files in both directories:
Backend (.env):
OPENAI_API_KEY=your_openai_api_key
GOOGLE_PLACES_API_KEY=your_google_places_api_key
YELP_API_KEY=your_yelp_api_keyFrontend (.env.local):
NEXT_PUBLIC_API_URL=https://your-backend-url.com| Component | Technology |
|---|---|
| Backend | FastAPI (Python 3.10+) |
| Frontend | Next.js 15 (React 18, TypeScript) |
| Styling | Tailwind CSS |
| APIs | Google Places API, Yelp Business API |
| AI Integration | OpenAI GPT API |
| Data Analysis | BeautifulSoup4, Requests |
| Methodology | BMAD Method (story-driven agile AI) |
/backend/ โ FastAPI application
/app/
main.py โ API endpoints and server setup (updated with business_name support)
ai_service.py โ Enhanced AI integration with personalized redesign generation
real_data_service.py โ Google Places & Yelp integration
/frontend/ โ Next.js application
/src/
/app/ โ App router pages
/api/redesign/route.ts โ Enhanced with comprehensive logging and Railway URL fixes
/components/ โ React components
BusinessSearchForm.tsx โ Updated to pass business names to redesigns
BusinessResultsTable.tsx โ Fixed URL priority (Railway over Vercel)
RedesignPreview.tsx โ Auto-opening preview with improved UX
LoadingState.tsx โ Professional loading states
ErrorState.tsx โ Comprehensive error handling
Toast.tsx โ Notification system
/utils/
api.ts โ Enhanced with detailed logging and fallbacks
/contexts/ โ Toast notification context
/docs/ โ BMAD methodology documentation
architecture_document.md
execution_plan.md
story_*.md โ Feature development stories
README.md โ This file
IFRAME_FIXES.md โ Detailed documentation of 404 fixes and improvements
requirements.txt โ Python dependencies
package.json โ Node.js dependencies (now includes concurrently)
- Node.js v20+
- Python 3.10+
- pip / virtualenv
- API Keys (optional for enhanced features):
- OpenAI API key
- Google Places API key
- Yelp Business API key
git clone https://github.com/bmad-code-org/BMAD-METHOD.git
cd BMAD-METHODcd backend
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate
pip install -r requirements.txtCreate .env file in backend directory:
OPENAI_API_KEY=your_openai_api_key_here
GOOGLE_PLACES_API_KEY=your_google_places_api_key_here
YELP_API_KEY=your_yelp_api_key_hereStart Backend:
python app/main.pyBackend runs at: http://localhost:8000
cd frontend
npm installCreate .env.local file in frontend directory:
NEXT_PUBLIC_API_URL=http://localhost:8000Start Frontend:
npm run devFrontend runs at: http://localhost:3000
- Start Backend (Terminal 1):
python app/main.py - Start Frontend (Terminal 2):
npm run dev - Open Browser: http://localhost:3000
- Enter Search Criteria: Location and business niche (e.g., "New York, NY" + "restaurants")
- Business Discovery: System finds 5-10 local businesses using real APIs
- Website Analysis: Each business website scored across 5 categories (0-100)
- ๐จ Redesign Generation: Sites scoring < 70 can generate professional HTML mockups with personalized business names
- ๐ฑ Auto-Preview: Redesigns automatically open in new tabs with working Railway URLs (404 errors fixed!)
- ๐ผ Business Integration: All redesigns use actual business data for professional, personalized results
- AI Recommendations: Personalized outreach templates and improvement suggestions
- Export Results: Download comprehensive CSV with all data and recommendations
| Endpoint | Method | Description |
|---|---|---|
/businesses |
GET | Find businesses by location & niche |
/score |
POST | Analyze website and return comprehensive scores |
/redesign |
POST | Generate professional HTML redesign mockup |
/preview/{preview_id} |
GET | Serve HTML mockup for preview |
/outreach |
POST | Create personalized outreach messages |
/export-csv |
POST | Export results to CSV |
Backend (.env):
OPENAI_API_KEY: For AI-powered analysis and generationGOOGLE_PLACES_API_KEY: For business discoveryYELP_API_KEY: For additional business data
Frontend (.env.local):
NEXT_PUBLIC_API_URL: Backend API URL
The application includes comprehensive fallback systems:
- Mock data when APIs are unavailable
- Fallback scoring for inaccessible websites
- Graceful degradation with error handling
- FastAPI with async/await for performance
- Modular services (AI, Real Data, Scoring)
- Timeout protection (5s individual, 15s total)
- Error resilience with fallback responses
- Next.js App Router with TypeScript
- Component-based design with reusable elements
- Context API for global state (toast notifications)
- Tailwind CSS for responsive styling
- Accessibility (Alt text, semantic HTML, heading structure)
- SEO (Title tags, meta descriptions, H1 optimization)
- Performance (Load time analysis and optimization)
- Mobile Friendliness (Responsive design, viewport meta tags)
- Security (HTTPS, security headers, SSL certificates)
- Industry-Specific Templates: Tailored designs for restaurants, lawyers, dentists, etc.
- Personalized Business Names: Uses actual business names instead of generic placeholders
- Professional HTML/CSS: Complete, responsive mockups with modern styling
- Auto-Opening Preview: Redesigns automatically open in new browser tabs
- Fixed URL Issues: Corrected Railway/Vercel URL handling to eliminate 404 errors
- Visual Preview System: Clean, professional preview interface with success messaging
- Score Improvement Predictions: Expected improvements across all categories
- Conversion Optimization: Strategic CTA placement and user flow design
- Industry-specific prompts for accurate analysis
- Contextual redesign suggestions based on business type
- Multi-channel outreach (Email, WhatsApp, SMS templates)
- Personalized messaging using business details
- Professional HTML generation with responsive design patterns
cd backend
pytestcd frontend
npm test- Test with various location/niche combinations
- Verify error handling with invalid inputs
- Check CSV export functionality
- Test responsive design on mobile devices
- โ Test redesign generation for low-scoring websites (< 70 points)
- โ Verify auto-opening preview functionality (no more 404 errors!)
- โ Test business name personalization across different industries
- โ Verify Railway URL integration for consistent preview access
- Test comprehensive logging for debugging API issues
- Test industry-specific styling with actual business data
- GitHub Repository with clean, documented code
- README.md with comprehensive setup instructions
- Working MVP with enhanced features
- Real API Integration (Google Places, Yelp)
- Professional UI/UX with loading states and error handling
- ๐จ Redesign Mockup Generation with personalized business names
- โ Fixed 404 Preview Errors with proper Railway URL integration
- ๐ข Business Data Personalization throughout the redesign flow
- ๐ Comprehensive Logging for debugging and monitoring
- Auto-Opening Preview System for improved user experience
- Industry-Specific Templates for professional website redesigns
- Production-ready features (timeouts, fallbacks, validation)
- Detailed Documentation including IFRAME_FIXES.md
- Request timeouts prevent hanging connections
- Async processing for concurrent website analysis
- Error boundaries maintain application stability
- Responsive caching for repeated requests
- Auto-opening previews reduce user interaction friction
- CORS configuration for secure frontend/backend communication
- Input validation on all form inputs
- API key protection through environment variables
- Error sanitization to prevent information leakage
- โ Fixed 404 Preview Errors: Corrected URL priority to use working Railway endpoints
- ๐ข Business Personalization: All redesigns now use actual business names
- ๐ Enhanced Logging: Comprehensive request/response tracking for debugging
- ๐ง Auto-Opening Previews: Improved UX with automatic new tab opening
- ๐ ๏ธ Robust Error Handling: Better fallback mechanisms and error recovery
[Link to Loom video walkthrough (โค5 min) will be added here]
- Advanced scraping with Playwright/Selenium
- Machine learning scoring models
- Real-time notifications for completed analyses
- Team collaboration features
- White-label customization options
- A/B testing for redesign variations
- Performance analytics for redesigned websites
- Client portal for sharing redesign mockups
This MVP demonstrates:
- Professional full-stack development with modern technologies
- Real-world API integration beyond basic mocking
- Production-ready architecture with error handling and performance optimization
- BMAD methodology implementation for structured, story-driven development
- Creative problem-solving with enhanced UX and robust fallback systems
- ๐จ Advanced visual features including HTML mockup generation and preview systems
- Industry-specific customization for enhanced user experience
Built with focus on code quality, functionality, and user experience that exceeds typical MVP standards.
Built with โค๏ธ using the BMAD Method