A complete full-stack application with FastAPI backend and React frontend for querying real Yelp data from PostgreSQL database.
- Businesses: Query 150K+ businesses with filtering by city and star rating
- Reviews: Access 6.9M+ reviews with filtering by business and user
- Users: Browse 1.9M+ user profiles
- Tips: Query tips with filtering by business and user
- Checkins: Access check-in data by business
- RESTful API: Complete CRUD operations with automatic documentation
- Business Search: Search and filter businesses with modern UI
- Review Browser: Browse reviews with pagination and filtering
- Responsive Design: Mobile-friendly interface
- Real-time Data: Connected to live backend API
# Backend
source yelp-fastapi/bin/activate
uvicorn src.main:app --host 192.168.0.123 --port 8000 --reload
# Frontend
cd frontend
yarn start# One-command deployment
./deploy-complete.shβββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β React App β β FastAPI β β PostgreSQL β
β (Frontend) βββββΆβ (Backend) βββββΆβ (Database) β
β S3/CloudFront β β Fargate/ECS β β RDS β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
| Option | Monthly Cost | Features |
|---|---|---|
| AWS Standard | $25-35 | Full production setup with ALB |
| AWS Budget | $15-25 | Direct Fargate access |
| AWS Ultra-Budget | $8-15 | Lambda + RDS (serverless) |
- Complete AWS Deployment Guide
- API Documentation (when running locally)
- Frontend Demo (when running locally)
βββ src/ # FastAPI Backend
β βββ main.py # Main FastAPI application
β βββ api/ # API route handlers
β β βββ business_routes.py # Business endpoints
β β βββ review_routes.py # Review endpoints
β β βββ user_routes.py # User endpoints
β β βββ tip_routes.py # Tip endpoints
β β βββ checkin_routes.py # Checkin endpoints
β βββ core/
β β βββ config.py # Application configuration
β βββ crud/
β β βββ crud.py # Database operations
β βββ db/
β β βββ database.py # Database connection
β β βββ models.py # SQLAlchemy models
β βββ schemas/
β βββ schemas.py # Pydantic schemas
βββ frontend/ # React Frontend
β βββ src/
β β βββ components/ # React components
β β βββ services/ # API service layer
β β βββ types/ # TypeScript definitions
β β βββ App.tsx # Main app component
β βββ public/
β βββ package.json
βββ requirements.txt # Python dependencies
- Install dependencies:
pip install -r requirements.txt- Configure environment variables:
# Copy the example environment file
cp .env.example .env
# Edit .env with your database credentials
DATABASE_HOST=localhost
DATABASE_PORT=5433
DATABASE_USER=your_username
DATABASE_PASSWORD=your_password
DATABASE_NAME=your_database- Run the backend:
# Using uvicorn directly
uvicorn src.main:app --reload --host 192.168.0.123 --port 8000
# Or using the run script
python run.py- Run the frontend (optional):
cd frontend
npm install
npm startThe frontend will be available at http://localhost:3000
GET /api/v1/businesses/- List all businessesGET /api/v1/businesses/{business_id}- Get specific businessGET /api/v1/businesses/city/{city}- Get businesses by cityGET /api/v1/businesses/stars/{min_stars}- Get businesses with minimum star rating
GET /api/v1/reviews/- List all reviewsGET /api/v1/reviews/{review_id}- Get specific reviewGET /api/v1/reviews/business/{business_id}- Get reviews for a businessGET /api/v1/reviews/user/{user_id}- Get reviews by a user
GET /api/v1/users/- List all usersGET /api/v1/users/{user_id}- Get specific user
GET /api/v1/tips/- List all tipsGET /api/v1/tips/{tip_id}- Get specific tipGET /api/v1/tips/business/{business_id}- Get tips for a businessGET /api/v1/tips/user/{user_id}- Get tips by a user
GET /api/v1/checkins/- List all checkinsGET /api/v1/checkins/{checkin_id}- Get specific checkinGET /api/v1/checkins/business/{business_id}- Get checkins for a business
Most list endpoints support pagination:
skip: Number of records to skip (default: 0)limit: Maximum number of records to return (default: 100)
Example: GET /api/v1/businesses/?skip=0&limit=50
The React frontend provides:
- Business Explorer: Search and filter businesses by city and rating
- Review Browser: Browse reviews with engagement metrics
- Responsive Design: Works on desktop and mobile
- Real-time Data: Live connection to the FastAPI backend
- Modern UI: Clean, intuitive interface with loading states
- Business grid with search filters
- Review cards with star ratings and engagement
- Responsive mobile design
- Interactive pagination
Once the server is running, visit:
- API Documentation: http://192.168.0.123:8000/docs
- Alternative Docs: http://192.168.0.123:8000/redoc
- Frontend App: http://localhost:3000 (when running frontend)
Once the server is running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
The application uses the following environment variables (defined in .env file):
DATABASE_HOST: Database host (default: localhost)DATABASE_PORT: Database port (default: 5432)DATABASE_USER: Database usernameDATABASE_PASSWORD: Database passwordDATABASE_NAME: Database name
API_HOST: API server host (default: 127.0.0.1)API_PORT: API server port (default: 8000)DEBUG: Debug mode (default: false)
API_TITLE: API title (default: Yelp Data API)API_DESCRIPTION: API descriptionAPI_VERSION: API version (default: 1.0.0)
The application uses the following PostgreSQL tables:
business(business_id, name, address, city, state, postal_code, latitude, longitude, stars, review_count, is_open, attributes, categories, hours)reviews(review_id, user_id, business_id, stars, useful, funny, cool, text, date, year, month)yelp_users(user_id, name, review_count, yelping_since, friends, useful, funny, cool, fans, elite, average_stars, compliment_*)tips(user_id, business_id, text, date, compliment_count, year)checkins(business_id, date)