SmartDine is an AI-powered restaurant recommendation system designed to simplify the question of "Where should I eat?" It dynamically collects and analyzes restaurant information, such as reviews, menus, and third-party data, to label restaurants with custom attributes. Users can customize preferences through an intuitive, step-by-step selection process to get highly personalized recommendations.
-
Interactive Meal Selection Flow
- Three-step selection process with animated transitions
- Each step presents one key question with visual choice options
- Questions include:
- Dietary Preferences (Meat/Veg)
- Cuisine Type (Chinese/Thai/Japanese/Korean/Pizza/BBQ)
- Contextual Factors (Temperature/Distance/Time/Price/Ambiance/Spice Level)
- Random selection option available at each step
- Smooth left-swipe transitions between questions
- Maximum 3 selections for quick decision-making
-
Restaurant Review & Rating System
- Grid-style layout similar to Yelp
- Visual-first approach with restaurant photos
- User ratings and detailed reviews
- Filter and sort capabilities
- Interactive review cards with expandable details
-
User Profile & Preferences
- Personal account management
- Customizable dining preferences
- Review history and favorites
- Dietary restrictions and preferences storage
- Account settings and notifications
-
Dynamic Restaurant Labeling
- Collects reviews and metadata from Google Maps, Yelp, and other third-party platforms.
- Uses AI/NLP to label restaurants with attributes like:
- Is the food oily?
- How busy is the restaurant during holidays?
- Average dining time (fast or slow)?
-
Customizable Decision Trees
- Users can input specific conditions like:
- Weather preferences (hot meals for cold weather).
- Dietary goals (low-calorie, healthy options).
- Time constraints (fast lunch, slow dinner).
- Users can input specific conditions like:
-
AI-Powered Recommendation Engine
- Personalized restaurant ranking based on user preferences and past feedback.
- Integrates scores from user ratings and historical restaurant performance.
-
Data Aggregation
- Combines real-time restaurant data, customer reviews, and menus to generate insights.
- Efficient data crawling ensures up-to-date recommendations.
graph TB
%% Frontend Applications
subgraph Frontend["Frontend Applications"]
Web["Web App<br/>React"]
Mobile["Mobile App<br/>React Native"]
WeChat["WeChat Mini App"]
end
%% AWS Cloud Infrastructure
subgraph AWS["AWS Cloud Infrastructure"]
%% Content Delivery
CDN["CloudFront CDN"]
%% Frontend Hosting
subgraph Static["Static Hosting"]
S3["S3 Bucket<br/>Static Website"]
end
%% Network Layer
subgraph Network["Network Stack"]
VPC["VPC"]
subgraph Public["Public Subnets"]
ALB["Application<br/>Load Balancer"]
IGW["Internet Gateway"]
end
subgraph Private["Private Subnets"]
ECS["ECS Cluster"]
NAT["NAT Gateway"]
end
end
%% Backend Services
subgraph Backend["Backend Stack"]
Fargate["Fargate Service<br/>FastAPI"]
AutoScale["Auto Scaling"]
end
%% Data Layer
subgraph Data["Data Layer"]
DDB["DynamoDB<br/>Restaurant Data"]
Cache["ElastiCache<br/>Redis"]
Assets["S3<br/>Media Assets"]
end
end
%% Connections
Web --> CDN
Mobile --> CDN
WeChat --> CDN
CDN --> S3
CDN --> ALB
ALB --> Fargate
Fargate --> ECS
AutoScale --> Fargate
Fargate --> DDB
Fargate --> Cache
Fargate --> Assets
%% Network Connections
IGW --> Public
Public --> NAT
NAT --> Private
%% Styling
classDef primary fill:#2496ed,stroke:#fff,stroke-width:2px,color:#fff
classDef secondary fill:#248f24,stroke:#fff,stroke-width:2px,color:#fff
classDef aws fill:#ff9900,stroke:#fff,stroke-width:2px,color:#fff
class Web,Mobile,WeChat primary
class Fargate,ECS,AutoScale secondary
class CDN,S3,ALB,DDB,Cache,Assets aws
-
Frontend Layer
- Web Application (React)
- Mobile Application (React Native)
- WeChat Mini App
- All frontends share common API client library
-
Content Delivery
- CloudFront CDN for global content delivery
- S3 bucket for static website hosting
- Edge caching and optimization
-
Network Stack
- VPC with public and private subnets
- Internet Gateway for public access
- NAT Gateway for private subnet outbound traffic
- Application Load Balancer for traffic distribution
-
Backend Stack
- ECS Cluster running Fargate tasks
- FastAPI application containerized
- Auto Scaling based on demand
- Health checks and monitoring
-
Data Layer
- DynamoDB for restaurant and user data
- ElastiCache (Redis) for session and caching
- S3 for media assets and static files
-
Frontend to Backend Communication:
- All frontend apps use a unified API client library
- Requests flow through CloudFront CDN for caching and edge optimization
- API Gateway handles request routing and throttling
- Cognito manages authentication/authorization
-
Data Flow:
- Real-time requests handled by Lambda functions
- Heavy computations managed by Step Functions
- ElastiCache provides caching layer for frequent queries
- DynamoDB stores user data and processed restaurant information
- S3 stores raw crawled data and static assets
-
Background Processing:
- EventBridge triggers scheduled crawling jobs
- Step Functions orchestrate the crawling workflow
- SQS queues manage crawling tasks
- Data Processor enriches raw data with AI/ML processing
-
Frontend Apps:
// Unified API Client class APIClient { async getRecommendations(preferences: UserPreferences): Promise<Restaurant[]> async updateUserProfile(profile: UserProfile): Promise<void> async submitFeedback(feedback: Feedback): Promise<void> }
-
API Layer:
# FastAPI Backend @app.get("/recommendations") async def get_recommendations(preferences: UserPreferences): restaurants = await recommendation_service.get_recommendations(preferences) return restaurants
-
Data Processing:
# Lambda Function def process_restaurant_data(event, context): raw_data = s3.get_object(event['raw_data_location']) processed_data = ai_processor.analyze(raw_data) dynamodb.put_item(processed_data)
- Web & iOS: React Native + Expo
- React Native Web for browser support
- Expo for iOS deployment
- WeChat Mini App: Taro Framework
- Allows React-style development
- Compiles to native WeChat Mini App
- AWS Lambda + API Gateway
- FastAPI (Python) for API development
- AWS Step Functions for workflow orchestration
- Amazon EventBridge for scheduling
- Amazon SQS for job queues
- Amazon S3 for data storage
- Amazon DynamoDB for user data and preferences
- Crawling: Python (Scrapy/Selenium)
- AI Processing:
- OpenAI GPT for restaurant attribute labeling
- Custom rule-based systems for basic classification
- Caching layer for optimization
- Data Storage:
- S3 for raw data
- DynamoDB for processed data
- Docker for local development
- AWS CDK for infrastructure as code
- GitHub Actions for CI/CD
- Data Crawling Module
Scrapes restaurant reviews, menus, and attributes from:
- Google Maps
- Yelp
- TripAdvisor
- AI Data Processor
Applies NLP (Natural Language Processing) to analyze reviews and extract restaurant features like:
- Oiliness
- Crowdedness
- Dining speed
- Decision Tree Engine
Filters and ranks restaurants based on user-defined parameters (weather, health goals, time).
- Recommendation Engine
Dynamically scores restaurants and provides personalized suggestions.
- User Feedback System
Allows users to rate restaurants and fine-tune future recommendations.
- Backend: Python, Flask/FastAPI
- NLP Models: GPT, SpaCy, or custom transformers
- Web Scraping: Scrapy, BeautifulSoup, Selenium
- Data Storage: PostgreSQL, SQLite
- Frontend: React.js / Vue.js
- APIs: Google Maps API, Yelp API, or similar
- Deployment: Docker\
- Integrate weather APIs for real-time weather-based recommendations.
- Enhance NLP models to provide deeper insights from reviews.
- Implement user profiles for persistent preference storage.
- Add restaurant reservation features via external APIs.
Contributions are welcome! Fork the repository, make changes, and submit a pull request.
This project is licensed under the MIT License.
For any inquiries or issues, contact rayc9823@gamil.com.
-
Initial Setup:
- Containerize all services using Docker
- Use environment variables for configuration
- Implement repository pattern for data access
-
Gradual Migration:
- Start with stateless services on Lambda
- Migrate data to S3 and DynamoDB
- Replace cron jobs with EventBridge
- Convert workflows to Step Functions
-
Final Phase:
- Move API Gateway
- Implement CloudFront for static assets
- Set up monitoring with CloudWatch
smartdine/
├── frontend/
│ ├── web/ # React Native Web
│ │ ├── src/
│ │ └── package.json
│ ├── mobile/ # React Native iOS
│ │ ├── src/
│ │ └── package.json
│ └── wechat/ # WeChat Mini App
│ ├── src/
│ └── project.config.json
│
├── backend/
│ ├── api/ # FastAPI Application
│ │ ├── src/
│ │ │ ├── routes/
│ │ │ ├── services/
│ │ │ ├── models/
│ │ │ └── utils/
│ │ ├── tests/
│ │ └── requirements.txt
│ │
│ └── workers/ # Background Workers
│ ├── crawlers/
│ │ ├── google_maps/
│ │ ├── yelp/
│ │ └── tripadvisor/
│ └── processors/
│ ├── ai_labeler/
│ └── data_enrichment/
│
├── infrastructure/ # AWS CDK Infrastructure
│ ├── lib/
│ │ ├── api-stack.ts
│ │ ├── frontend-stack.ts
│ │ └── worker-stack.ts
│ └── bin/
│
└── shared/ # Shared Code/Types
├── types/
└── constants/
- Frontend Setup
# Web/iOS Setup
cd frontend/web
npm install
cd ../mobile
npm install
# WeChat Setup
cd ../wechat
npm install -g @tarojs/cli
taro init- Backend Setup
# API Setup
cd backend/api
python -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows
pip install -r requirements.txt
# Workers Setup
cd ../workers
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt- Infrastructure Setup
cd infrastructure
npm install
npm run cdk bootstrap- Local Development
# Start Frontend (Web)
cd frontend/web
npm run dev
# Start Backend API
cd backend/api
uvicorn main:app --reload
# Start Local DynamoDB
docker-compose up -d- Testing
# Frontend Tests
cd frontend/web
npm test
# Backend Tests
cd backend/api
pytest- Deployment
# Deploy Infrastructure
cd infrastructure
cdk deploy --all- Docker Compose (docker-compose.yml)
version: '3.8'
services:
dynamodb-local:
image: amazon/dynamodb-local
ports:
- "8000:8000"
redis-cache:
image: redis:alpine
ports:
- "6379:6379"- Backend Environment (.env)
AWS_REGION=us-east-1
STAGE=development
OPENAI_API_KEY=your_key_here- Frontend Environment (.env)
REACT_APP_API_URL=http://localhost:8000
REACT_APP_STAGE=developmentflowchart TD
subgraph UserInterface["User Interface"]
HomePage["Home Page"]
subgraph SelectionFlow["Selection Flow"]
Step1["Step 1: Basic Preferences"]
Step2["Step 2: Cuisine Type"]
Step3["Step 3: Context Factors"]
Step1 -->|Slide Left| Step2
Step2 -->|Slide Left| Step3
Step3 -->|Complete| Results
end
subgraph ReviewSystem["Review System"]
GridView["Grid View"]
ReviewCard["Review Card"]
FilterSort["Filter & Sort"]
end
subgraph UserProfile["User Profile"]
Account["Account Management"]
Preferences["Preferences"]
History["History"]
end
end
-
Selection Flow Pages
- Circular selection buttons with icons
- Progress indicator (1/3, 2/3, 3/3)
- "Feeling Lucky" random option
- Smooth slide-out animations
- Clear, single-question focus
-
Review Grid System
- Responsive grid layout
- Image-centric review cards
- Quick-view ratings
- Filter sidebar
- Sort dropdown menu
-
Profile Management
- Clean, intuitive settings layout
- Preference management cards
- History timeline view
- Account security section
-
Selection Process
interface SelectionStep { question: string; options: Array<{ icon: string; label: string; value: string; }>; randomOption: boolean; } const steps: SelectionStep[] = [ { question: "What type of food today?", options: [ { icon: "🥩", label: "Meat", value: "meat" }, { icon: "🥬", label: "Vegetarian", value: "veg" } ], randomOption: true }, // More steps... ];
-
Review Component
interface ReviewCard { restaurantName: string; rating: number; images: string[]; preview: string; tags: string[]; priceRange: string; }
-
User Preferences
interface UserPreferences { dietaryRestrictions: string[]; favoriteCuisines: string[]; pricePreference: string; locationRadius: number; spicePreference: string; }







